I've spent the better part of the last two days working on interfacing my Arduino with my (brother's, actually) TI-83 (plus, actually). I started by Googling to see if anyone else had done it and couldn't find anything (I can't imagine I'm the first, but hey, someone's got to be).
Using schematics for the home made serial cable I was able to figure out what the pins were supposed to do. When one gets pulled down it's a zero bit, when the other gets pulled down it's a one bit and I have to pull the opposite down to acknowledge receipt.
I wrote a short TI-Basic program to continuously send simple but changing data:
:0->A :While getKey=0 :Disp A :Send(A) :A+1->A :End
There's probably a better way to do it but it's just a test program...
And lo, I was able to get data out.
82 - C9 - B - 0 - 9 - 0 - 0 - 41 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 4A - 0 - 82 - C9 - ...
After noticing how often it repeated I was able to separate them into packets. I then realized that, even though the calculator was displaying an increasing number, the packets I was receiving weren't changing. I had to do more research.
After a long time of researching and fiddling I found a site with an incredibly complete description of the link protocol (had to realize I needed to be searching for "ti link protocol" and not "ti serial protocol").
Aha! So the reason it's not changing is because the calculator is asking if it can send stuff. (the second bit is the command). So I next had to figure out how to send it the ACK command, in addition to the CTS (clear to send) command. This was far more difficult than it turned out to be, I had the lines backwards.
Once I'd figured out how to send commands back I started receiving the actual data:
82 - C9 - B - 0 - 9 - 0 - 0 - 41 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 4A - 0 - Machine: 82, Command: C9, Data Size: 11 Bytes 82 - 56 - 0 - 0 - Machine: 82, Command: 56, Data Size: 0 Bytes 82 - 15 - 9 - 0 - 0 - 80 - 20 - 0 - 0 - 0 - 0 - 0 - 0 - A0 - 0 - Machine: 82, Command: 15, Data Size: 9 Bytes Digits: 2.0000000000000E0 82 - 92 - 9 - 0 - Machine: 82, Command: 92, Data Size: 9 Bytes 82 - C9 - B - 0 - 9 - 0 - 0 - 41 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 4A - 0 - Machine: 82, Command: C9, Data Size: 11 Bytes 82 - 56 - 0 - 0 - Machine: 82, Command: 56, Data Size: 0 Bytes 82 - 15 - 9 - 0 - 0 - 80 - 30 - 0 - 0 - 0 - 0 - 0 - 0 - B0 - 0 - Machine: 82, Command: 15, Data Size: 9 Bytes Digits: 3.0000000000000E0
I'm simplifying matters a little, I had to figure out how to decode the data portion of the packet, for example.
One odd thing I've come across is that the machine ID given by the calculator depends on how and what you're sending. Using TI-Basic's send() command gives it as 82 (in hex), presumably so it can communicate with the CBL (calculator based laboratory) things that were created for the TI-82. Using the link menu gives it as 83 and also uses different commands (sends Check ready (RDY) first). If you try and send a program it gives the ID as 7 and the command as D1 (which appears to be undocumented). Choosing "SendID" or "SendOS" gives it as 73 (TI-83 plus).
One problem that came up is that the data portion of the packet is of variable size and the Arduino language can't handle creating arrays on the fly. I tried putting in the "new" operators that were suggested in another topic somewhere but that only seemed to work once (the operators must not have been implemented correctly). I've left those in, though commented out, for when I (or someone else) figures out how to do it. Meanwhile I've created a hard coded array that handles a data size of up to 11 bytes (the size of the "variable header").
I will provide my code as soon as I can figure out the best way to do that. (I don't want to just paste it here as that'd be rather ugly)
Oh dang, I just realized this may not be the correct forum category for this. Though I'm not really sure, maybe it should go into software interfacing?[/edit]