----------------------------------------------------------------------------- ----------------------------------------------------------------------------- TI-PORTS.TXT A Programmer's Guide to the TI-85 Ports Version 0.9 Copyright (c) 1995 Dan Eble ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- Direct questions to Dan.Eble@CommLink.org. Additions and revisions are welcome. Feel free to distribute this document in unmodified form. Bitmap Terminology: 1 Set bit 0 Clear bit . Used bit (1 or 0) X Unused bit ? Bit of unknown use All numbers are in hexadecimal, except where noted with (d). ----------------------------------------------------------------------------- Port 0 : Video Buffer Offset Write Only ----------------------------------------------------------------------------- Write ----- X?...... 00-3F: LCD shows memory at 100h*(C0+this value) Example: using a value of 3C, the LCD shows the normal memory, FC00 Note: The ROM uses 7C, although it appears to give the same result. ----------------------------------------------------------------------------- Port 1 : Keypad ----------------------------------------------------------------------------- Write ----- X....... 00-7F: prevents set of keys from being read Bit 6 = 1: masks out { F5 F4 F3 F2 F1 2nd EXIT MORE } Bit 5 = 1: masks out { STO> , xý LN LOG GRAPH ALPHA } Bit 4 = 1: masks out { 0 1 4 7 EE SIN STAT x-VAR } Bit 3 = 1: masks out { . 2 5 8 { COS PRGM DEL } Bit 2 = 1: masks out { (-) 3 6 9 ) TAN CUSTOM } Bit 1 = 1: masks out { ENTER + - * / ^ CLEAR } Bit 0 = 1: masks out { DOWN LEFT RIGHT UP } Read ---- ........ Bit 7 = 1: key pressed is one of { ALPHA x-VAR DEL MORE } Bit 6 = 1: key pressed is one of { GRAPH STAT PRGM CUSTOM CLEAR EXIT } Bit 5 = 1: key pressed is one of { LOG SIN COS TAN ^ 2nd } Bit 4 = 1: key pressed is one of { LN EE ( ) / F1 } Bit 3 = 1: key pressed is one of { UP xý 7 8 9 * F2 } Bit 2 = 1: key pressed is one of { RIGHT , 4 5 6 - F3 } Bit 1 = 1: key pressed is one of { LEFT STO> 1 2 3 + F4 } Bit 0 = 1: key pressed is one of { DOWN 0 . (-) ENTER F5} ----------------------------------------------------------------------------- Port 2 : Contrast Write Only ----------------------------------------------------------------------------- Write ----- XX...... 00-1F: sets contrast to value ----------------------------------------------------------------------------- Port 3 : ON Status, LCD Power ----------------------------------------------------------------------------- Write ----- XXX?.?.. Bit 3 = 1: turn LCD on 0: turn LCD off Bit 2 = 1: do not mask bit 2 0: mask bit 2 Bit 1 = 1: set bit 1 LCD status (on) 0: clear bit 1 LCD status (off) Bit 0 = 1: do not mask bit 0 0: mask bit 0 Note: Do not exit a program with bits 0 and 1 clear. The TI-85 freezes. Read ---- 0000.... Bit 3 = 1: ON not pressed 0: ON pressed now Bit 2 = 1: ? \__ timer? interrupt indicator? what? 0: ? / Bit 1 = 1: LCD is on 0: LCD is off Bit 0 = 1: ON has been pressed, but may not be now 0: ON has not been pressed ----------------------------------------------------------------------------- Port 4 : Video Buffer Width, Mystery Resistor ??? Write Only ----------------------------------------------------------------------------- Write ----- XXX....? Bits 4 and 3 = 00: 10-byte wide buffer 01: 12-byte wide buffer 10: 16-byte wide buffer (normal) 11: 20-byte wide buffer Bits 2 and 1 = 00: very low resistance: black screen and frozen calculator 01: low resistance: dark screen, top half of screen is doubled in lower half, and interrupts go faster 10: less-than-normal resistance: slightly darker than normal screen, top 1/4 of screen is doubled in bottom 1/4, slightly faster interrupts 11: normal Bit 0 = 1: freeze \_ don't know what this does 0: function / ----------------------------------------------------------------------------- Port 5 : Memory Page ----------------------------------------------------------------------------- Write ----- XXXXX... 0-7: sets memory page (accessed from 4000 to 7FFF) to value Read ---- 00000... Returns current memory page (0-7) ----------------------------------------------------------------------------- Port 6 : Power Mode ----------------------------------------------------------------------------- Write ----- ???????. Bit 0 = 1: normal power 0: low power Note: I don't know much about this port. To put the processor in low-power mode, first turn off the LCD (port 3), then write 40h to this port. To put the processor back in normal-power mode, write 41h to this port, then turn the LCD back on. Read ---- ???????. returns value written ----------------------------------------------------------------------------- Port 7 : Link Port ----------------------------------------------------------------------------- Write ----- ??....?? Bits 7 & 6 : have an effect, but don't seem to be important Bit 5 = 1 : white wire is negative or off 0 : white wire is negative or positive Bit 4 = 1 : red wire is negative or off 0 : red wire is negative or positive Bit 3 = 1 : white wire is negative 0 : white wire is positive or off Bit 2 = 1 : red wire is negative 0 : red wire is positive or off Bits 1 & 0 : have an effect, but don't seem to be important Therefore: 00000000 00: read Bare->Red and Bare->White currents 00000100 04: read Bare->White or Red->White current 00001000 08: read Bare->Red or White->Red current 00010000 10: read Bare->White current 00100000 20: read Bare->Red current Other combinations are redundant or useless. Note: The ROM uses values with bits 6 and 7 set. Read ---- 0000.... Bits 3 and 2 are the same as they were in the value last written. Bit 1 = 1: white is positive, but circuit is open 0: white is positive and electons are flowing, or white is negative Bit 0 = 1: red wire is positive, but circuit is open 0: red is positive and electons are flowing, or red is negative