I have made a working adapter for my XT Model F keyboard.
This is a work in progress. Please feel free to ask questions.
It is not meant to be a general electronics project how-to.
I started off with the following materials:
*
Teensy USB development board
* USB cable for the Teensy
*
Breadboard * Jumpers for the Breadboard
* Female DIN-5 Connector
* Solid Core Wires
* Soldering Iron & Solder
* Multimeter
[h=2]Hardware[/h]
I soldered the wires to the terminals on the female DIN-5 connector.
This is a diagram of the side of the connector you plug into; It
is backwards from the side you attach the wires to. If you have
a new DIN-5 connector, it will likely be labeled with tiny little
numbers.
You can skip pin 3 if you want, since it isn't actually used.
In theory, if you have a AT -> PS/2 adapter you could cannibalize
the DIN-5 end of the cable (using a multimeter or continuity tester
to figure out which wire is which). I actually tried this route
first but couldn't get the stranded wires in the cable to play
nice with the breadboard.
Next, I inserted the Teensy into the breadboard straddling the divide.
I jumpered the Teeny's VCC to the positive rail on one side
and GND to the negative rail on other side. I plugged in the
wires from the DIN-5 connector into the bread board at the
matching breadboard number labels (pin 1-5 -> breadboard 1-5).
Then I jumpered the Teeny's D1 to the XT clock pin (pin 1)
and D2 to the XT data pin (pin 2).
Finally, I jumpered the positive rail to XT pin 5 and the
negative rail to XT pin 4.
For a few of these connections multiple jumpers were used
due to lack of properly sized ones.
More pictures and diagrams forthcoming.
[h=2]Software[/h]
I developed the software for the Teensy board on Ubuntu Linux
using gcc-avr (1:4.3.0-4)¹ and avr-libc(1:1.6.2.cvs20080610-2)¹. The current source code can be
found at
http://patch-tag.com/r/thedward/xtkbd-usb.
To build from source, you will need to check out the project with darcs:
darcs get http://patch-tag.com/r/thedward/xtkbd-usb/pullrepo xtkbd-usb
Then you should just be able to build it with make:
cd xtkbd-usb
make
If you are unable or uninterested in compiling the firmware yourself,
I have attached a precompiled version to this article. It is called xtkbd.txt,
but you will need to rename it to xtkbd.hex to load it onto the Teensy.
To load the xtkbd.hex file onto the Teensy you can use the
Teensy loader application from PJRC.
Assuming everything went correctly you should now have a functioning XT -> USB
adapter for a XT Model F keyboard. It might work for other XT keyboards, but
I can't vouch for that.
It just works with Linux and OS X (as much as any PC keyboard "just works" with OS X),
but I have not tested with any version of Windows (since I have none). Some comments
in the example source code from PJRC lead me to believe you might have to create
an INF file for it under Windows. If anyone tries it, let me know.
[h=2]TODO[/h]
As I mentioned above, this is a work in progress.
I still have some things I want to fix:
* Make the Num Lock key do something useful.
* Make the Del key do something useful.
* Add a reset on idle timeout to the firmware²
* Embed the adapter inside the keyboard.
* Improve and update this article.
[h=2]References[/h]
This was basically a two day project for me. I could never have put this together in that kind of time frame without
all the great information I found online:
*
PC Keyboard FAQ V1.00 *
kbdbabel (open source keyboard protocol translator project)
*
Reimplementing the Symbolics Keyboard Adapter with Teensy (my inspiration for using the Teensy)
*
symbolics.c *
PJRC's Teensy pages (an invaluable resource for the Teensy programmer)
This is a great big thanks to everyone who did all the hard work for me.
¹ These are Ubuntu version numbers.
² In case the Teensy gets out of sync with the keyboard; This hasn't happened yet, but better safe than sorry.