Difference between revisions of "83Plus:Ports:03"
From WikiTI
m |
(write bit 3) |
||
| Line 17: | Line 17: | ||
* Bit 1: Set 1 to enable the first hardware timer. Set 0 to disable it. | * Bit 1: Set 1 to enable the first hardware timer. Set 0 to disable it. | ||
* Bit 2: Set 1 to enable the second hardware timer. Set 0 to disable it. | * Bit 2: Set 1 to enable the second hardware timer. Set 0 to disable it. | ||
| − | * Bit 3: Set | + | * Bit 3: Set 0 to put the calculator in low power mode if and only if the Z80 cpu enters the halt state (during the executing of a halt instruction). Set 1 to keep the calculator powered. |
* Bit 4: Set 1 to enable the linkport interrupt. Set 0 to disable it. (Does not completely disable the linkport.) | * Bit 4: Set 1 to enable the linkport interrupt. Set 0 to disable it. (Does not completely disable the linkport.) | ||
== Comments == | == Comments == | ||
| − | For normal operation, write 0B (00001011) to this port. | + | * For normal operation, write 0B (00001011) to this port. |
| + | * In low power mode it is known that at least the lcd driver enters standby mode and that the timer hardware has been disabled. | ||
== Example == | == Example == | ||
| Line 27: | Line 28: | ||
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. | 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. | ||
<nowiki> push af | <nowiki> push af | ||
| − | ld a, 11h ;Enable linkport, ON key. Disable timer. | + | ld a, 11h ;Enable linkport, ON key. Disable timer. |
| + | ;Set low power mode. | ||
out (3), a | out (3), a | ||
| − | halt ; | + | halt ;Enter low power mode (disabling various devices) |
| − | ld a, 0Bh ;Enable ON key, timer. Disable linkport. | + | ;and wait for an interrupt (either ON key or |
| + | ;link activity) which will enable all hardware | ||
| + | ;devices again. | ||
| + | ld a, 0Bh ;Enable ON key, timer. Disable linkport. | ||
| + | ;Keep calculator powered. | ||
out (3), a | out (3), a | ||
pop af</nowiki> | pop af</nowiki> | ||
Revision as of 01:58, 9 April 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 first hardware timer will generate an interrupt (range: 108Hz-512Hz).
- Bit 2: Set if the second hardware timer will generate an interrupt (range: 216Hz-1024Hz).
- 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 first hardware timer. Set 0 to disable it.
- Bit 2: Set 1 to enable the second hardware timer. Set 0 to disable it.
- Bit 3: Set 0 to put the calculator in low power mode if and only if the Z80 cpu enters the halt state (during the executing of a halt instruction). Set 1 to keep the calculator powered.
- 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.
- In low power mode it is known that at least the lcd driver enters standby mode and that the timer hardware has been disabled.
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.
;Set low power mode.
out (3), a
halt ;Enter low power mode (disabling various devices)
;and wait for an interrupt (either ON key or
;link activity) which will enable all hardware
;devices again.
ld a, 0Bh ;Enable ON key, timer. Disable linkport.
;Keep calculator powered.
out (3), a
pop af