Port Number: 02h
Function: Calculator Status Information
This port reports various status information, including battery strength, LCD driver status, and calculator type.
- Bit 0: Set if the batteries are good. Reset if the batteries are low. The calculator will refuse to Garbage Collect or receive a FLASH App or OS when the batteries are low.
- 83+SE / 84+(SE) only: Bit 1: At 15MHz this bit resets for a set delay after a command or data is sent to the LCD, otherwise this bit is always set. The amount of delay is controlled by port 2F. On the TI-73, this bit is always reset (this is how you distinguish between the 73 and 83+ series hardware).
- Bit 2: Set if Flash is currently unlocked.
- 83+ only: Bits 3-5:
- Bit 3: Last value written to port 05 bit 0
- Bit 4: Last value written to port 05 bit 1
- Bit 5: Last value written to port 05 bit 2
- 84+(SE) only: Bit 5: Set for TI-84+ and TI-84+ SE calculators. Reset for TI-83+ and TI-83+ SE calculators.
- Bit 7: Reset for a TI-83+ Basic. Set for everything else.
- No useful effect.
See Port 21h for how to distinguish the 84+ Basic from the 84+ SE.
push af in a, (2) and 01h call nz, BatteriesGood call z, BatteriesLow pop af
push af WaitLoop: in a, (2) and 02h jr z, WaitLoop ;Send a command, like 03 (LCD "On"). call LCDIsReady pop af
This example also uses Port 21h.
in a, (2) rlca ;Roll bit 7 into carry. jp nc, Regular83Plus and 40h ;Test bit 5, now rotated into bit 6. jp z, Silver83Plus in a, (21h) and 03h jp z, Regular84Plus jp nz, Silver84Plus
Credits and Contributions
- Michael Vincent: Documentation of port 2 located here.