Difference between revisions of "83Plus:Ports:3A"

From WikiTI
Jump to: navigation, search
(Comments: Changed sample routine to reflect timings specified in datasheet.)
(TI-84+CSE)
 
(One intermediate revision by the same user not shown)
Line 74: Line 74:
 
|}
 
|}
  
The TI-84+CSE backlight level is controlled by bit 5, which is connected to the CAT4004A Constant Current LED Driver (1-wire EZDim (TM) interface!). To turn the backlight off, reset bit 5 and leave it off. To turn the backlight on, set bit 5 and leave it on. As long as you want the backlight on, keep bit 5 set, except when you want to change the backlight level. When you turn the backlight on, it will reset to the brightest level. To reset the backlight to the brightest level, reset this bit for at least 3 ms and then turn it back on. To dim the backlight one level, reset this bit for at least 200 ns but not more than 100 µs. Each pulse will dim the backlight one level. There are 32 levels, from full brightness to off.
+
The TI-84+CSE backlight level is controlled by bit 5, which is connected to the CAT4004A Constant Current LED Driver (1-wire EZDim (TM) interface!). To turn the backlight off, reset bit 5 and leave it off. To turn the backlight on, set bit 5 and leave it on. As long as you want the backlight on, keep bit 5 set, except when you want to change the backlight level. When you turn the backlight on, it will reset to the brightest level. To reset the backlight to the brightest level, reset this bit for at least 3 ms and then turn it back on. To dim the backlight one level, reset this bit for at least 200 ns but not more than 100 µs. Each pulse will dim the backlight one level. There are 32 linearly dimming levels, from full brightness to off. Each level changes the LED's PWM dimming cycle by about 3.2 %.
  
Bit 4 is weird. This is normally set to output. But when you connect a cable and the calculator starts charging, it gets changed to input.
+
Bit 4 is weird. This is normally set to output. But when you connect a cable and the calculator starts charging, it gets changed to input. The charging chip is probably TI's bq2057C "Advanced linear charge management IC for single- and two-cell lithium-ion and lithium-polymer". The charge status pin reads high during charging, low when finished, and high-impedance on fault. (Is there a GPIO bit to check for a fault condition?)
  
 
== Comments ==
 
== Comments ==

Latest revision as of 16:34, 25 October 2014

This port only exists as a distinct port on the TI-83 Plus Silver Edition, the TI-84 Plus, and the TI-84 Plus Silver Edition. On the standard TI-83 Plus, it acts as a shadow of port 02.

Synopsis

Port Number: 3Ah

Function: GPIO Read/Write

This port appears to be for GPIO reading/writing. It's used for USB stuff, battery voltage testing, and on the TI-84+CSE, controlling the backlight. Port 39h appears to be the GPIO setup register. More work is needed to figure out what hardware these GPIO pins interface with. This port does not exist on the TI-83+SE, which does not have any GPIO.

On known hardware revisions for all TI-84+/C/SE, the upper three bits are wired for output and the lower five bits are for input. So, write E0 to port 39 for correct GPIO operation. Attempting to repurpose bits is unlikely to have a useful effect unless you modify the hardware. (And the OS likes to write E0 to 39 on a regular basis, so your changes won't stick long-term.)

TI-84+/SE Old hardware

Read Values

  • Bits 0-2 - Used for USB related stuff
  • Bit 2 - Seems to be set to indicate "old-style" charge pump for VUSB
  • Bit 3 - Set
  • Bits 4-7 - Unknown

Write Values

  • Bits 0-2 - Used for USB related stuff
  • Bit 3 - No effect
  • Bit 4 - Set after using port 04 to check batteries but then reset
  • Bits 5-6 - Unknown
  • Bit 7 - Set before using port 04 to check batteries

TI-84+/SE New Hardware

Read Values

  • Bits 0-3 - Reset
  • Bit 2 - Seems to be reset to indicate "new-style" charge pump for VUSB
  • Bits 4-7 - No significance

Write Values

  • Bits 0-3 - Unchangeable
  • Bits 4-7 - Quirky (no effect)

TI-84+CSE

Bit    Input/Output?    Description
0 I Unknown, possibly USB (Vbus?) related
1 I Unknown, possibly USB (Vbus?) related
2 I Unknown, possibly USB (Vbus?) related
3 I Unknown, possibly USB (Vbus?) related
4 I & O Has something to do with battery charging.
5 O Controls backlight; see below.
6 O Unknown
7 O Unknown, set when testing battery level, then reset.

The TI-84+CSE backlight level is controlled by bit 5, which is connected to the CAT4004A Constant Current LED Driver (1-wire EZDim (TM) interface!). To turn the backlight off, reset bit 5 and leave it off. To turn the backlight on, set bit 5 and leave it on. As long as you want the backlight on, keep bit 5 set, except when you want to change the backlight level. When you turn the backlight on, it will reset to the brightest level. To reset the backlight to the brightest level, reset this bit for at least 3 ms and then turn it back on. To dim the backlight one level, reset this bit for at least 200 ns but not more than 100 µs. Each pulse will dim the backlight one level. There are 32 linearly dimming levels, from full brightness to off. Each level changes the LED's PWM dimming cycle by about 3.2 %.

Bit 4 is weird. This is normally set to output. But when you connect a cable and the calculator starts charging, it gets changed to input. The charging chip is probably TI's bq2057C "Advanced linear charge management IC for single- and two-cell lithium-ion and lithium-polymer". The charge status pin reads high during charging, low when finished, and high-impedance on fault. (Is there a GPIO bit to check for a fault condition?)

Comments

The purpose of the lower 3 bits is unknown. Someone with a model (none) or A calculator will have to do some testing. If the old USB hardware is present, most of the USB ports work differently.

On the old hardware, port 39h also seems to be tied to the functions of this port.

Another way to check for the old USB revision is to check port 15h for the value 44h.

The correct way to toggle an output bit is to first read from port 3A, then do a bitmasking operation, and then write the new value. This way you won't accidentally change the value of any other outputs. For example,

PulseBacklight:
	; Reset bit 5
	in a, (3Ah)
	and 0DFh
	out (3Ah), a
	; Set bit 5 again.
	or 20h
	out (3Ah), a
	ret