This might be a bit of an off-topic post, but I wanted to share my recent experience, and I have this handy blog thing here…
For those that haven’t heard of it, the IBM Model M keyboard is regarded by some as one of the finest typing experiences available; not only that, but they’re built like brick outhouses and last an eternity. Mine was made in 1989 and is still kicking. The mechanical key mechanism they use produces great audible and tactile feedback, and is incredibly reliable.
After reading many articles such as this one on Ars Technica espousing the Model M I’ve been tempted to get hold of one for a while. I’m a regular on the bit-tech forums and, as luck would have it, a Model M recently came up for sale in the forum marketplace… for £10 (plus postage). At that price I wasn’t going to pass it up, even though it was a terminal keyboard which uses a non-standard protocol that isn’t compatible with PS2… See, since IBM set many of the standards for PCs in the early days, some Model M keyboards used the AT-style interface – AT is actually compatible with PS2 connectors, all you need is an adaptor. Not so with a terminal keyboard: they use an RJ45-type connector and even if you wired up the connections to the PS2 pins (since the number & function of pins is the same) it uses a totally different protocol which won’t be recognised.
Before I took the plunge and bought this keyboard, I made sure I could convert it to something I could use – USB or PS2, for example. The very first link mentioned something called Soarer’s Converter; an interface for Model M keyboards which, using a microcontroller, converts the keyboard to USB operation. Bingo. The recommended microcontroller is the Teensy++ 2.0 – a little pricey, but not really too expensive when you consider that Model M keyboards often go for £40/£50+.
Fast forward a week or two and I actually received the keyboard, which unfortunately had some plastics damage…
Not to be deterred however, I googled the model number to do a little research on it. Turns out that this is something of a hybrid keyboard; according to this deskthority thread, it was originally a French-Canadian layout which had been converted to a UK layout. Hence why there appear to be two model numbers on the bottom:
Also mentioned on the aforementioned deskthority thread was an alternative to the Teesny++ 2.0, this tiny ATMEGA32U4-based board. Most importantly, this board cost around £2.50, whereas the Teensy++ 2.0 is around £20. Bonus. There was very little information on the pinout for this board, but the post I found did mention that it’s compatible with the Arduino Leonardo; I recently discovered however that it’s actually a clone of the Sparkfun Pro Micro (which is cool, since the Pro Micro is open hardware). Further google-fu lead me to another deskthority post which actually showed me the pinout for connecting a Model M keyboard to this board. Sweet.
Fast forward to today, and I’ve now got all the gubbins I need to actually get started. The first thing I did was to program the microcontroller with Soarer’s Converter and upload the keymap file to the board. There was very little information about this online, so hopefully this post will serve as a good point of reference for others trying to convert a terminal Model M to USB.
First of all, here’s some pre-requisites – I’ve written this with Windows 7/8 in mind, I’m afraid you’re on your own with any other OS.
- Latest Arduino software – you don’t need the installer version, the ZIP file will do fine
- Arduino Builder – we’re going to use this to program the board, since Soarer’s Converter provides a compiled HEX file, and the Arduino IDE doesn’t support flashing HEX files.
- Latest Soarer’s Converter
First of all, plug in the microcontroller. If you open the Device Manager you’ll see that it’s not been recognised properly. Update the drivers and point it at the “Drivers” folder in the arduino software ZIP file; the drivers for an Arduino Leonardo should then be installed. At this point it’s worth testing the voltage of the board. The Sparkfun Pro Micro can be configured for either 5v or 3v3 operation; there’s a solder bridge on the board which changes the setting. My Chinese clone board had this bridge unpopulated, which would indicate that it’s 3v3. When I tested the VCC and Ground pin with a multimeter however it turns out it was actually running at 5V – great, since the keyboard will need 5v.
Now we want to flash the Soarer HEX file to the board, so open up Arduino Builder. First thing to do is to change the Arduino board setting from Uno to Leonardo. Now you want to load the HEX file – beware, there are several HEX files compiled for different microcontroller boards! In my case the correct file was Soarer_at2usb_v1.10_atmega32u4.hex, since the Pro Micro board uses the ATMEGA32U4 chip. Once you load the HEX file, choose the appropriate COM port – if you’re not sure which COM port the board is using, have a look in the device manager – the board should be listed under “Ports (COM & LPT)” and the correct one will be fairly obvious.
The board should flash – Arduino Builder will show you some summary guff when it’s complete – and you’ll notice that Windows should now be installing a new HID keyboard device automatically. The final thing I did before assembling the hardware was to upload a keymap file to the converter board. Take a look into the documentation that comes with Soarer’s Converter if you want to mess around with this a little more, but I used a file that had already been made by someone else. Simply copy and paste the “remapblock” file in that post to a text file. Once you’ve done that, you can drag and drop that file onto the file scaswr.bat – this comes with the Soarer’s Converter files and is located in the “Tools” subdirectory (you’ll have to unzip it first). What this does is compiles the keymap text file into a binary format and then uploads it to the converter board.
Now, on to the hardware installation! Dear me, do cover your shame!
I’m not going to cover disassembly of the keyboard here, but this is the main board you want. As you can see, there’s a 5-pin connector at the end of the connector which plugs into the main PCB – very handy.
Here’s the pinout for that connector – note, you’re advised to do some research on your own keyboard, since this pinout is for terminal keyboards only.
You can find out which pins on the Pro Micro are needed over here.
I’m sure there may be some Model M enthusiasts out there that will cringe at what I did here…
Ahh, my old friend, I haven’t seen you in a while…
All wired up and ready to go
Bow in fear at my super-neat installation skills! Obviously this isn’t final, I plan to tidy this up, and maybe 3D print a cover to go over the cable grommet at the back of the case.
All done, all plugged in and working a bloody treat.