Difference between revisions of "83Plus:Ports:03"
From WikiTI
m (Whoops... forgot the credit(s) :)) |
|||
Line 32: | Line 32: | ||
== Credits and Contributions == | == Credits and Contributions == | ||
+ | '''Michael Vincent''': For documenting [http://www.michaelv.org/programs/calcs/ports/port3.html here] on the interrupt bits. |
Revision as of 09:58, 28 March 2005
Contents
Synopsis
Port Number: 03h
Function: Interrupt Masking Port
This port controls what devices will be allowed to trigger interrupts.
Read Values
- Bit 0: Set if pressing the ON key will generate an interrupt.
- Bit 1: Set if the hardware timer will generate an interrupt (~150 times per second).
- Bit 4: Set if the linkport will generate an interrupt.
Write Values
- Bit 0: Set 1 to enable the ON key. Set 0 to disable it.
- Bit 1: Set 1 to enable the hardware timer. Set 0 to disable it.
- Bit 3: Set 1 to enable the LCD. Set 0 to turn off the LCD.
- Bit 4: Set 1 to enable the linkport interrupt. Set 0 to disable it. (Does not completely disable the linkport.)
Comments
For normal operation, write 0B (00001011) to this port.
Example
This example shows how to do a soft powerdown (similar to the auto powerdown) on the calculator. This may or may not wipe the LCD screen, so you should first copy it's contents to a buffer like saveSScreen and then copy it back afterwards.
push af ld a, 11h ;Enable linkport, ON key. Disable timer. Turn off LCD. out (3), a halt ;Wait for an interrupt (either ON key or insert link cable). ld a, 0Bh ;Enable ON key, tiemr. Disable linkport. Turn on LCD. out (3), a pop af
Credits and Contributions
Michael Vincent: For documenting here on the interrupt bits.