http://learn.cemetech.net/index.php?title=Z80:Ports:Port02&feed=atom&action=historyZ80:Ports:Port02 - Revision history2024-03-28T08:25:24ZRevision history for this page on the wikiMediaWiki 1.34.0http://learn.cemetech.net/index.php?title=Z80:Ports:Port02&diff=352&oldid=prevMaintenance script: Initial automated import2016-02-06T07:13:38Z<p>Initial automated import</p>
<p><b>New page</b></p><div>= Basic Info =<br />
<br />
'''Port Address: 02''' <br />
<br />
This port reports various status information, including battery strength, LCD driver status, and calculator type.<br />
<br />
= Writing to Port =<br />
<br />
'''TI-83+ (Non-SE)'''<br />
No effect.<br />
<br />
'''TI-83+SE, TI-84+, TI-84+SE, TI-84+CSE'''<br />
Bit 0: Write a 0 to acknowledge the ON key interrupt; write 1 to leave the status of the ON key interrupt alone.<br />
Bit 1: ACK HW timer 1<br />
Bit 2: ACK HW timer 2<br />
Bit 3: Ignored<br />
Bit 4: ACK Linkport<br />
Bits 5-7: Ignored<br />
<br />
= Reading from Port =<br />
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. The voltage cutoff can be configured in port 04.<br />
'''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).<br />
Bit 2: Set if Flash is currently unlocked.<br />
'''83+ only:''' Bits 3-5:<br />
Bit 3: Last value written to port 05 bit 0<br />
Bit 4: Last value written to port 05 bit 1<br />
Bit 5: Last value written to port 05 bit 2<br />
'''84+(SE) only:''' Bit 5: Set for TI-84+ and TI-84+ SE calculators. Reset for TI-83+ and TI-83+ SE calculators. More specifically, this indicates if the calculator is USB-capable or not.<br />
Bit 6: Indicates if Link Assist is available.<br />
Bit 7: Reset for a TI-83+ Basic. Set for everything else.<br />
<br />
= Example Uses =<br />
<br />
'''Battery checking'''<br />
<br />
<br />
push af<br />
in a, (2)<br />
and 01h<br />
call nz, BatteriesGood<br />
call z, BatteriesLow<br />
pop af<br />
<br />
<br />
'''LCD Testing'''<br />
<br />
push af<br />
WaitLoop:<br />
in a, (2)<br />
and 02h<br />
jr z, WaitLoop<br />
;Send a command, like 03 (LCD "On").<br />
call LCDIsReady<br />
pop af<br />
<br />
<br />
'''Device checking'''<br />
This example also uses Port 21h.<br />
<br />
<br />
in a, (2)<br />
rlca ;Roll bit 7 into carry.<br />
jp nc, Regular83Plus<br />
and 40h ;Test bit 5, now rotated into bit 6.<br />
jp z, Silver83Plus<br />
in a, (21h)<br />
and 03h<br />
jp z, Regular84Plus<br />
jp nz, Silver84Plus<br />
<br />
<br />
------<br />
<br />
{{lowercase}}<br />
[[Category:Z80 Assembly]]<br />
[[Category:Z80 Heaven]]<br />
[[Category:Z80 Ports]]</div>Maintenance script