https://keshavdeeljur.wordpress.com/2015/09/12/ti-83-linkport-breakdown/
TI-83+ Linkport Breakdown
NOTE: This is a technical document explaining in detail how to work with the link on the TI-83+ (and its family). If you just want pre made assembly code, check out my LinkCable post.
All code example are written in assembly (without the use of any shells). Code included in this document was compiled using Brass assembler for the TI-83+. Assembly programs use the same extension as TI-BASIC ones (.8xp) and look the same on the “Program” menu on the calculator, yet they have to be run through the “Asm(” command (found in the catalog). e.g.: Asm(prgmLINKPORT)
The TI linkport is a feature that comes built in to the TI-83+ and similar calculators. It’s a 2.5mm (NOT the standard 3.5mm) phone jack found on the bottom for the TI+83+, and the top right for the TI-84+.
Pinout:
It’s a three-conductor barrel (TRS): two signal lines (Tip and Ring) and a common (Sleeve). Many documents on the Linkport out there refer to these two signal lines as White and Red. Red corresponds to the tip, and white the ring.
Hardware:
This schematic shows what the circuit looks like on each line:
It’s a half-duplex communication, implemented through two open-collector lines, with 10k pull-ups. The diode in series with the resistor is for protection against higher voltages on the input line, named S3 on the schematic. Setting S1 high would switch the transistor and consequently pull line S2 low. On the other hand, setting S1 low, (or even setting it to an input) would release S2, which gets pulled up by the resistor.
Interfacing with these lines is fairly simple: putting your own transistor on each line is sufficient. There’s no need to add your own pull-ups as it’s already handled by the one’s on the calc side; nor would it be safe, since your uC might work on different voltages. Here’s a schematic of my implementation for the driver:
The line from the calculator is called TIP here.
When TIP is high, is drives Q1, which pulls TIP_I low. My uC (an ATtiny chip) has internal pull-ups, which is why it is not visible on TIP_I.
Setting TIP_O activates Q2 which pulls the line low.
Controlling the lines:
NOTE: Assembly is used here to control the lines (all the code examples are in Z80 ASM)
The TI has a hardware Port dedicated for the Linkport: Port 00
Reading:
According to WikiTi, the data read from the port gives the state of the lines: reading a 0 from bit 0 or bit 1 indicates the line is pulled low, and a 1 indicates the line is high. The code to read the ring looks like this:
IN A, (00)NOP ;the hardware needs some delayBIT 0, AJP Z, Ring_Low |
The NOP here is crucial, else the data read wouldn’t be reliable.
Writing:
The values written to bit 0 and bit 1 of port 00 control the tip and ring lines, respectively. Writing a 1 to either bit pulls it low, and a 0 would release the line. The code to pull the tip low looks like this:
LD A, %00000001OUT (00), A |
Notice this is opposite to reading the lines, where a 0 indicates the line is LOW. Because of this, when writing to a line without modifying the state of the other, an XOR must be performed on the line we don’t want to modify, else it’ll get flipped on the following OUT instruction:
;assume we want to pull tip LOW without modifying the ring line,;and ring is currently LOWIN A, (00) ; bit 1 (ring) in A would read as 0NOPXOR 1<<1 ;now bit 1 in A is 1SET 1, A ;pull the tip lowOUT (00), A |
NOTE:
Executing any code straight away wont produce desired results, as the TI-OS would interfere. Go to this section
TI’s protocol:
The protocol TI uses for it’s various applications (sensors, transferring data to other calculators) is fairly simple. Data is sent by pulling a line low; the receiver pulls the other line low to acknowledge. The value of the bit transferred is determined by which line is pulled low first: if the tip is pulled low first, a 0 is written, else it’s a 1. The next bit can be sent when both lines are released. Data is sent as most significant bit first (MSb). Here’s an example of writing $C9 (%11001001):
The transfer rate is said to be at about 50 kbits/s.
TI-OS interference:
Since I wanted to implement my own protocol (with a clock and data line), it was necessary to make sure the OS doesn’t have any control over the lines, which could create interference.
Here’s a diagram showing how TI’s OS responds when the TIP line is pulled low:
First, the linkport has an interrupt attached to it (triggered on a low level). This makes sense since then the calculator would respond by pulling the other line low to ACK. So we first have to disable the interrupt. Port 03 is the interrupt mask port. Resetting bit 4 on this port disables the linkport interrupt. The code implementation of this is simple:
IN A, (03)RES 4, AOUT (03), A |
Next, TI-83+ and newer calcs have a hardware dedicated to reading and writing to the linkport: the link assist. I’m guessing this was put to free up CPU overhead. Port 08 controls the status of the link assist:
IN A, (08)SET 7, AOUT (08), A |
Now we’ve fully disconnected TI-OS from the linkport. I put the three code snippets together in a routine called “linkport_init” for convenience, which has to be called before touching the lines.
Note that when exiting a program, the interrupt mask is re-enabled. Because of this, the linkport_init routine must always be run at the startup of your assembly program. Also, since the interrupt is re-enabled, having a line pulled low at the end of a program would freeze the calculator in its OS’s interrupt routine, regardless whether that line is pulled low externally or from its own driver. So make sure both lines are always reset before exiting your program:
LD A, 0OUT (00), A ;write a 0 to bits 0 & 1 (i.e. release the line) |
That’s pretty much all there is to the linkport. Below I have attached a demo program which toggles the tip line a couple of times. You can connect an LED to the tip line (drive it through a transistor first, not directly or it will damage the port) or hook up an Arduino and have it print out the state on the Serial port.
Demo File
Sources/useful resources:
http://wikiti.brandonw.net/index.php?title=Category:83Plus
http://www.ticalc.org/archives/files/fileinfo/247/24750.html




