Keyboard-Calculator Interface
Ever wish the TI Keyboard supported the 86? This module reads scancodes from a PS/2 keyboard,
translates them to the keycodes used by the 86, and sends them to the calculator using the remote control
packet format. It works in the TI-OS and any programs that use the _getkey call, with no software
needed on the calculator. It can easily be modified to work with other calculators (when I was testing it,
I wrote a version of the firmware that worked with the 83+, but realized it would be almost useless for anything
but entering equations), and it would be great if someone who has an 89 could modify the lookup tables to work
with it. I know that there's already the TI Keyboard, which does the same thing, but it doesn't work with the 86,
and it's much more fun to build your own anyways! ;-)
There is one major bug - if you cause an error with the keyboard plugged in, the calculator will freeze, and
require a full battery pull. This isn't my fault, though, it's a bug in the ROM (at least on my calc, with 1.6).
Still, it should be fine as long as you use it for something other than calculations, like writing BASIC programs
or word processing.
Key Mappings
Keyboard | Calculator |
A-Z | A-Z |
a-z | a-z |
0-9 | 0-9 |
Space | [space] |
[arrows] | [arrows] |
Esc | Exit |
Backspace | Clear |
Delete | Del |
Insert | Ins |
Enter | Enter |
= | = |
+ | + |
- | - |
(- on top line) | [negative] |
/ | / |
* | * |
^ | ^ |
( | ( |
) | ) |
[ | ( |
] | ) |
{ | [ |
} | ] |
Tab | More |
F1-F5 | F1-F5 |
F6 | sin |
F7 | cos |
F8 | tan |
F9 | [squared] |
F10 | log |
F11 | Graph |
F12 | Table |
LWin | Catlg-Vars |
RWin | Custom |
Menu | Prgm |
' | Poly |
; | : |
. | . |
, | , |
Home | [home] |
End | [end] |
Page Up | F2 |
Page Down | F1 |
Num Lock | [pi] |
Alt-F6 | arcsin |
Alt-F7 | arccos |
Alt-F8 | arctan |
Alt-F9 | [square root] |
Alt-F10 | ln |
Alt-F11 | Solver |
Alt-F12 | Simult |
Alt-1 | Base |
Alt-2 | Test |
Alt-3 | Mem |
Alt-4 | Cons |
Alt-5 | Conv |
Alt-6 | Strng |
Alt-7 | Matrx |
Alt-8 | Vectr |
Alt-9 | Cplx |
Alt-0 | Char |
Alt-, | [angle] |
Alt-Enter | Entry |
Alt-Esc | Quit |
Alt-Tab | Mode |
Alt-/ | Calc |
Alt-* | Math |
Alt-- | List |
Alt-+ | Stat |
Shift-Tab | -> |
Internals
Here's the schematic: as you can see, it's fairly simple, with the PIC doing most of the work.
If you want, you can add in some 0.1microFarad decoupling capacitors, but it works fine for me without
(I was going to put a couple in, but ended up not having space on the board). You could also take out
the 1K resistors, they're just there for protection, in case there's a short in the calc or keyboard,
to prevent too much current draw.
You'll also need the keyboard port pinout below (I forget where I got this image...). MAKE SURE you
get this right - I soldered the wires on backwards the first time, and it made me spend what seemed like
hours on troubleshooting. The diagram shows the pinout FACING INTO THE PORT ON THE BOX.
And here's the source code and the compiled firmware for the PIC.
I've commented the code fairly well, so if you want to change the lookup tables to work with another
calc *hint hint*, it won't be hard. I had to add a loop to detect when the keyboard turns on, and it
worked with a few of my keyboards that I tried it on, but I don't know if all keyboards act the same
at powerup or not. If it doesn't work with your keyboard, and you're sure it's the keyboard interface,
please send me the keyboard model and some scope traces of the clock line at powerup if possible.
Bill of Materials
U1: LM7805 5V 1A regulator
U2: PIC16F84A-04/P microcontroller
R1-2: 470-ohm 1/8 W carbon resistors
R3-6: 1K 1/8 W carbon resistors
D1: Red LED
D2: Green LED
C1: 22microFarad 16V electrolytic capacitor
SW1: SPST slide switch (from Radio Shack)
X1: 3.57 Mhz crystal
B1: 9V battery
Misc: 4" x 2" x 1" plastic box (Radio Shack cat# 270-1802), PCB (self-made or pre-printed),
1/16" stereo jack, 6-pin mini-DIN connector, 9V battery connector, 18-pin DIP socket,
LED mounting hardware (optional), 2 small screws (optional)
Construction
Be warned that you'll have to be careful about the layout to fit everything into the box, if you
use the same one as I did. I had to do a lot of resoldering and moving stuff around to get it all inside.
First, drill out the screw supports in the bottom of the box. They just get in the way. I did it with
a drill and chisel, but a Dremel tool should also work. Just be careful not to go through the bottom!
Now drill the holes for the keyboard connector and stereo jack to the calculator, one at either end of
the box. Depending on the length of the stereo jack, you might have to scrape away some of the plastic around
the hole to get it to go through far enough for the ring to screw on the other side. The keyboard connector
is mounted like this, although you could do it differently:
If it has tabs, drill two small holes on either side, and fit a couple of screws through to hold the connector
down as shown in the picture. Some glue wouldn't hurt either.
Now that the holes are done, solder some LONG wires onto the keyboard connector and feed them through the hole,
mounting the connector when they're all through (it's important to do this BEFORE soldering). Now for the lid...
Here's the positioning of the switch and LEDs, although as always you could do it differently.
The square hole for the switch can be VERY hard to cut; I found the best way is to drill out to near the edges,
then use a small file to carefully even out the edges. If you go outside the lines (as you probably will ;-) ),
fill in the extra space with glue or plastic wood or something. Now drill the holes for the LEDs. I was lucky
enough to have some nice little Motorola LED mounting kits, so it was easy to make the holes the right size and
snap the LEDs in and out. Get a couple if possible.
A view of the underside:
Now that the box is done, solder everything onto the PCB. It's important to make this as small as possible!
If you're too lazy to etch your own board, get one of the preprinted ones with the horizontal traces like these:
Here's the layout of the components - make sure to saw off any extra board (before you solder, that is).
The finished one should like something like this:
Once that's done, it's time to wire the switches and connectors to the PCB. Since there are so many ground
connections, it's better to twist all the wires together to solder then run one to one side of the switch, instead
of trying to attach them all directly to the switch terminal. Thin wire is by far the best (26-gauge), since it'll
all have to be compressed when the lid's put on. When the wires to the LEDs have been soldered, wrap the leads with
electrical tape and bend them so they're parallel to the lid - otherwise, the components on the PCB get in the way and
the lid won't fit on all the way. Stuff everything to one side, as shown in the picture,
then jam in a 9V battery. The battery should go in easily - if it doesn't, check to see what's taking up the
extra space. Before screwing on the lid, check to make sure everything works. If it doesn't, make sure all the wiring
is done correctly, the connectors aren't wired backwards, and the solder joints are all good. If it does work, screw
on the lid and make sure it still works. Congratulations - your 1337ness rating has just increased!
Some images of the finished box:

and in action:

Contact
If you have any questions, comments, flames, etc. please e-mail me at straney@umbi.umd.edu. I'm not responsible
for any damage that this device causes directly or indirectly, however, if you build it, I'd be interested in knowing
the results!
Donald Straney
burntfuse