83Plus:Ports:02: Difference between revisions

From WikiTI
Jump to navigationJump to search
No edit summary
 
TheStorm (talk | contribs)
mNo edit summary
 
(13 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[Category:83Plus:Ports:By Address|02 - Status Port]]
[[Category:83Plus:Ports:By Address|02 - Status Port/Interrupt Acknowledge]] [[Category:83Plus:Ports:By Name|Status Port/Interrupt Acknowledge]]
[[Category:83Plus:Ports:By Name|Status Port]]
== Synopsis ==
== Synopsis ==
'''Port Number:''' 02h
'''Port Number:''' 02h
Line 6: Line 5:
'''Function:''' Calculator Status Information
'''Function:''' Calculator Status Information


This port reports various status information, including battery strenght, LCD driver status, and calculator type.
This port reports various status information, including battery strength, LCD driver status, and calculator type.


=== Read Values ===
=== Read Values ===
* Bit 0: Set if the batteries are good. Reset if the batteries are low. The calculator will refuse to Garbage Collect when the batteries are low.
* 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 [[83Plus:Ports:04|port 04]].
* Bit 1: Set if the LCD Driver can receive a command. Reset otherwise. This is basically the inverse of bit 7 from Port 10h.
* '''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 [[83Plus:Ports:2F|port 2F]]. On the TI-73, this bit is always reset (this is how you distinguish between the 73 and 83+ series hardware).
* Bit 5: Set for TI-84+ and TI-84+ SE calculators. Reset for TI-83+ and TI-83+ SE calculators.
* Bit 2: Set if Flash is currently unlocked.
* Bit 7: Reset for a TI-83+ Basic. Set for everything else.
* '''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. More specifically, this indicates if the calculator is USB-capable or not.
* Bit 6: Indicates if Link Assist is available.
* Bit 7: Reset for a TI-83+ Basic and TI-73. Set for everything else.


=== Write Values ===
=== Write Values ===
* No useful effect.
==== TI-83+ (Non-SE) ====
No effect.
 
==== TI-83+SE, TI-84+, TI-84+SE, TI-84+CSE ====
* Bit 0: Write a 0 to acknowledge the ON key interrupt; write 1 to leave the status of the ON key interrupt alone.
* Bit 1: ACK HW timer 1
* Bit 2: ACK HW timer 2
* Bit 3: Ignored
* Bit 4: ACK Linkport
* Bits 5-7: Ignored


== Comments ==
== Comments ==
See [[83Plus:Ports:21|Port 21h]] for how to distinguish the 84+ Basic from the 84+ SE.
See [[83Plus:Ports:21|Port 21h]] for how to distinguish the 84+ Basic from the 84+ SE.


== Example ==
== Examples ==
'''Battery checking'''
=== Battery checking ===
  <nowiki> push af
  <nowiki> push af
  in a, (2)
  in a, (2)
Line 29: Line 43:
  pop af</nowiki>
  pop af</nowiki>


'''LCD Testing'''
=== LCD Testing ===
  <nowiki> push af
  <nowiki> push af
WaitLoop:
WaitLoop:
Line 39: Line 53:
  pop af</nowiki>
  pop af</nowiki>


'''Device checking'''
=== Device checking ===


''This example also uses [[83Plus:Ports:21|Port 21h]].''
''This example also uses [[83Plus:Ports:21|Port 21h]].''
  <nowiki> in a, (2)
  <nowiki> in a, (2)
  rlca ;Roll bit 7 into carry.
  rlca ;Roll bit 7 into carry.
  jp c, Regular83Plus
  jp nc, Regular83Plus
  rlca
  and 40h ;Test bit 5, now rotated into bit 6.
rlca ;Roll bit 5 into carry.
  jp z, Silver83Plus
  jp nc, Silver83Plus
  in a, (21h)
  in a, (21h)
  and 01h
  and 03h
  jp z, Regular84Plus
  jp z, Regular84Plus
  jp nz, Silver84Plus</nowiki>
  jp nz, Silver84Plus</nowiki>


== Credits and Contributions ==
== Credits and Contributions ==
* '''Michael Vincent''': Documentation of port 2 located [http://www.michaelv.org/programs/calcs/ports/port2.html here].
* '''Michael Vincent''': Documentation of port 2 located [http://www.michaelv.org/programs/calcs/ports/port2.html here].

Latest revision as of 03:03, 25 August 2016

Synopsis

Port Number: 02h

Function: Calculator Status Information

This port reports various status information, including battery strength, LCD driver status, and calculator type.

Read Values

  • 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.
  • 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. More specifically, this indicates if the calculator is USB-capable or not.
  • Bit 6: Indicates if Link Assist is available.
  • Bit 7: Reset for a TI-83+ Basic and TI-73. Set for everything else.

Write Values

TI-83+ (Non-SE)

No effect.

TI-83+SE, TI-84+, TI-84+SE, TI-84+CSE

  • Bit 0: Write a 0 to acknowledge the ON key interrupt; write 1 to leave the status of the ON key interrupt alone.
  • Bit 1: ACK HW timer 1
  • Bit 2: ACK HW timer 2
  • Bit 3: Ignored
  • Bit 4: ACK Linkport
  • Bits 5-7: Ignored

Comments

See Port 21h for how to distinguish the 84+ Basic from the 84+ SE.

Examples

Battery checking

 push af
 in a, (2)
 and 01h
 call nz, BatteriesGood
 call z, BatteriesLow
 pop af

LCD Testing

 push af
WaitLoop:
 in a, (2)
 and 02h
 jr z, WaitLoop
 ;Send a command, like 03 (LCD "On").
 call LCDIsReady
 pop af

Device checking

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.