The background

It all started with the Model M.

If you ask people what the perfect keyboard is, it probably won't be long before someone says "Go with the Model M." It's got the classic PC layout, which makes sense since the Model M basically defined the "classic PC layout"; it can withstand decades of use (literally!) because of the solid construction and the brilliant design; and, best of all, it's readily available on eBay and from several other vendors. The Model M has a devoted Internet following, with some people collecting dozens of them for no good reason other than to diminish the supply for the rest of us. But I think I can make a compelling argument that I love the Model M more than anybody else does.

The problem

The only problem with the design of the Model M is that it was done in 1984, according to IBM's copyright on the back, and 1984 was over a decade before the introduction of USB. At this point, I have more computers that lack PS2 ports than computers that include them, and that's kind of sad to me. (Also, the inclusion of a PS2 port on recent motherboards did not actually guarantee that the Model M would work on them; apparently the logic board that came in the Model M draws approximately 112mA at idle, which is about 100x more than most PS2 keyboards.)

Now, the solution that most sane people adopt to fix the lack of USB on the Model M is purchasing a PS2-to-USB adapter (which can be had for roughly $10 to $20 USD). And if you happen to be a little crazier than normal, you might try something like Ico Doornekamp's "almost native" mod where you desolder the PS2 connector, and solder a PS2-to-USB adapter inside the case directly to the logic board. (I even tried that myself, with some level of success!)

For some reason, though, I wasn't fully satisfied with that. I mean, it worked all right, but mine would randomly stop working after a few hours, requiring me to unplug and re-seat the USB connection to get the keyboard to come back. And I always thought "Somebody should just design a real USB-native logic board for these keyboards already."

Well, it took me a year and a half to get around to it, but nobody else stepped up before me (although, hilariously, Ronald Schaten implemented the same idea at almost exactly the same time as I did).

The solution

My friend Cliff started fooling around with some Atmel AVRs for his own nefarious purposes. He was showing me some of the cool things that people have gotten working on these chips... including a full USB stack. Hell, a Dane who goes by the name Spaceman Spiff even built a new logic board (with a firmware based on that same V-USB stack) for his Commodore64 keyboard.

With Cliff's help, I learned enough about circuit design and PCB layout to make a working logic board in EAGLE. I ordered some parts and put together a prototype on some perfboard. For the firmware, I started with Spiff's c64key project - hey, he practically did all the work for me! - with some simple modifications; the Commodore 64 keyboard has its keys arranged in a matrix with 8 rows and 8 columns, and keys on the Model M are in a matrix with 16 rows and 8 columns.

Once the changes necessary to support the Model M's key matrix were in place, I successfully generated the first real USB events directly from keypresses on an actual Model M keyboard.

Unfortunately, Spiff's firmware didn't handle ghost keys. I actually started generating unintentional ghost-key presses during normal use, so I had to implement a decent ghost key prevention algorithm.

And now it works. Arguably, better than it ever did with a PS2-to-USB adapter - some of the adapters I've used have had problems with ghost keys being handled incorrectly.

Current status

I have two keyboards with perfboard prototypes in them working perfectly. I ordered two PCBs from BatchPCB (who appear to be no longer in business), and both of the PCBs worked fine with ATMega16 AVRs and 12MHz crystals. I attempted to create a Kickstarter for this project to do a production run of 100 or so boards, but it was rejected, because it "wasn't the right fit for Kickstarter". I hear they've relaxed the rules somewhat, so maybe I'll try submitting again.

If anybody is interested in ordering the components to make one of these themselves, you can order parts using this parts list from Mouser; this includes everything you need except the flat-panel connectors for the keyboard ribbon cables and the protoboard/PCB for the build. Please feel free to contact me to let me know how your build goes!

Technical notes

Officially, the Atmel AVRs can't do USB well enough to pass a USB certification test - at least, not with the current firmware and circuit design. USB has very strict voltage and timing requirements, or so I'm told, and also, my firmware does no error handling at all. However, it's Good Enough that it works on every single USB host I've tried, including (in no particular order) every PC I have, under Windows XP and also under Linux, as well as my MacBook running OS X, and my PS3 and my Xbox 360. I would be very surprised, at this point, to find a USB host that this keyboard does not work with.

This logic board was originally conceived with an ATmega32 in mind, running at 16MHz; in reality, the current prototypes are working fine with ATmega16s running at 12MHz. The board layout still reflects the original intention, but you can easily swap in a 12MHz crystal or an ATMega16 and it should still work fine.

File Description rump-board.png PNG image of board layout rump-schematic.png PNG image of schematic rump-1.0.tar.gz Firmware source code rump.brd EAGLE board layout rump.sch EAGLE schematic

If you want to follow the development on the firmware (which is likely to be pretty uneventful now that there aren't any major bugs left to fix that I know of) you can track the git repository.

Thanks

Cliff, for getting me started with a breadboard and a multimeter, not to mention an initial electrical circuit

Spiff, for the c64key project which gave me a huge head start

Objective Development, for the V-USB stack that makes this all possible

Andrew Preater, for the inspiration for this color scheme :)

Who are you?

My name's Chris Lee (clee to my friends), and I'm an addict. I love the Model M and I'm not ashamed to admit it. Feel free to email me with any comments or questions you might have!