const-iterator.de
122-key version of clee's Real USB Model-M PCB

This is a modified version of clee’s rump, a hardware project to retrofit IBM Model M keyboards with an USB connection. I added support for 122 key terminal keyboards by extending clee’s firmware and creating a new circuit board fitting the 122 key keyboards.

Motivation

In short: I can touch type best on IBM Model M keyboards. They usually don’t have USB. Additional keys are quite useful to me (especially for Emacs).

The IBM Model M

If touch typing is your main form of interacting with a computer and you are doing this routinely, using a good keyboard is very important. After all, along with the display it is the primary interface between you and the computer. Of course, different people have different preferences (and opinions) about the factors the make up a good keyboard. I personally prefer clicky keyboards, because for me they provide the best haptics and the most distinctive pressure point. My favourite keyboard model is the IBM Model M, using the buckling spring mechanism. If you are interested in details about the various keyboard mechanisms, there is plenty of information on the Geekhack forum and wiki.

Unfortunately, the original IBM Model M keyboards aren’t equipped with an USB connection. The 101/102 key versions are equipped a PS/2 connector, because the Model M is the PS/2 keyboard (as in the keyboard model originally shipped with the IBM PS/2 computer). As the PS/2 connection is disappering from the new computers, an adapter would be required to continue using Model M keyboards. Unfortunately, most adapters don’t work with the Model M because it needs more power than the adaptors can provide.

Real USB Model M PCB

A more drastic solution to this problem is to replace the PS/2 circuit board in the keyboard itself by a custom-made USB circuit board. This way you don’t convert the keyboard matrix output to PS/2 and then the PS/2 to USB, but instead convert the keyboard matrix output directly to USB. This is exactly what Chris Lee did in his rump project. He created a custom circuit board and firmware to retrofit a 101/102 key Model M keyboard with USB.

122 key keyboards

The Model M not only exists in the 101/102 key variant for the PS/2, but also in a 122 key variant for IBM 5250 terminals (in the AS/400 world). These are normally not PC compatible, as the host connection does not speak the PS/2 keyboard protocol, even less USB protocol. But of course it would be great to use such a keyboard on a modern PC (hey, twenty extra keys for Emacs!), so I bought a IBM 1394312 keyboard on ebay.

IBM 1394312 keyboard

The design of the 1394312 is very similar to the PS/2 version, so I decided to port the rump project to the 122 key variant.

Unicomp keyboards

If you don’t want to tinker with an original Model M there exists another alternative to get a USB equipped Model M: you can still buy a new one at Unicomp. I once ordered a 105 key “Space Saver” USB model and a 122 key PS/2 model there and won’t give them away anymore. They feel slightly different from the old IBM made ones, but I can’t decide which ones I like better.

Unfortunately, it you want a 122 key keyboard, currently only a PS/2 variant produces a single usage code per key. The USB variant (and the PS/2 variant if you buy the “Emulator” version) produces key combinations for the keys not found on the 101/102 key variants. (eg. Shift+F1 for F13). This is fine if you want to use an IBM 3270/5250 terminal emulator, because that are the combinations used to support the extra keys on the 101/102 key variant, but you can’t distinguish between Shift+F1 and F13 pressed anymore (at least not without resorting to timing measurements).

But let’s now continue with the rump port.

Hardware

The fundamental design of the 122 key Model M’s is the same as in the PC variants. The case likewise is opened with a 5.5 millimeter hexagon socket screwdriver (I got the one from Wiha Tools).

original IBM 1394312 circuit board (matrix connectors already desoldered)

The connectors between the keyboard matrix and the PCB also almost the same, but the the larger connector has 20 pins instead of 16. Fortunately, the ATmega16 used in the original rump project got enough free pins to accomodate these additional matrix lines.

Because of the different connector pin count I had to create a new schematic and board layout. You can find them in the git repository mentioned below. As I don’t do much electronics (yet), I think the board could be done better, but it works for me.

my custom PCB for the 1394312

For the matrix connectors I used the original ones desoldered from the initially fitted board. As I don’t think I will own an AS/400 or 5250, I won’t need the original board anymore.

I didn’t install a USB socket, instead I attached a fixed cable using a right-sized cable feedthrough. After the casing is closed, strain-relief is working. For the cable I simply sacrificed a 5 meter A-B connector cable.

Software

Of course, the firmware had to be adapted, too. You find the modified firmware in the git repository below in the ibm1394312 branch.

Source

You can find the source code for hardware and software on github under https://github.com/robin-eckert/rump. The master branch contains the refactorings on the original PS/2 rump project, but is still for PS/2 keyboards. The 122 key-specific logic ist currently maintained seperately in the ibm1394312 branch on top of master. The circuit diagram and board layout is located at circuit/ibm1394312/.

If you have questions to the project, feel free to drop me an e-mail to const@const-iterator.de.