There are reasons against this. Your friends and colleagues who are not as nearly as nerdy as you are will smile, perhaps a bit shamefacedly. You and your keyboards. Now this: you found this Commodore 64 keyboard somewhere in the bay or at your local flea market and you immediately wanted it to connect to your PC or Mac. No problem, there are enough recipes in the net, and here’s mine. Even if you are not a great tinkerer, this shouldn’t hinder you. All you need is a
- Teensy++ 2.0 (or similar; you’ll need something with 18 pins)
- a breadboard, cables, all incidentials for soldering things together
- a CBM 64 keyboard, complete with all cables coming out of its flipside
- Software: get the Teensy Loader Application, the Arduino software, and the Teensyduino Installer.
You may want to warm up yourself a bit if you haven’t done this before. I’d recommend following this tutorial which explains all install procedures and first bricolages. After recreating these and playing with the Keyboard sample, you’re ready.
There’s a bit of theory before proceeding, and Simon Inn’s article gives great information on the CBM 64’s keyboard layout. Each keyboard has a matrix circuit which makes the cabling of keyboards much easier than just wiring each single key to a chip. Making a keyboard USB-ready although it was constructed decades before USB requires a bit of reverse engineering, and this is well explained in Simon’s post.
After this, we are having a look at Anders Tonfeldt’s video series on his approach; he is using different hardware, but I found his solution rather inspiring. If you put a little time into this research, you’ll be ending with something like this:
This is the layout: connect the 64’s pins to your Teensy as depicted.
What’s missing now is the software, the program logic that interprets the various keypresses on the CBM 64 keyboard and sends them as keycodes to your computer. Find it here. It’s based on code written for a PET keyboard which I adapted to my needs.
Since the Commodore 64 has a very different key layout I’ve translated the special keys:
- Commodore key: becomes the Command (Mac) or Windows/GUI key (PC)
- INST DEL: Backspace; becomes Delete when shifted
- CLR HOME: Home; becomes End when shifted
- RUN STOP: becomes Alt
- Arrow up: becomes \, | when shifted
- Restore: becomes Tab (there is no NMI we would have to take into account anyway)
- CTRL, both Shift keys, cursor keys remain their original functions
Some keys caused me a bit of pain, though: ‘:’ and ‘;’ will work as expected, but shifting won’t give you braces ‘[‘ and ‘]’. Also, ‘£’ (which I tried to produce ‘{‘ and ‘}’) was a bit unruly. But let’s not overthink this. Your Commodore keyboard will be recognized as external keyboard and you’re ready to go. This is no high-end keyboard, its mechanics is rather wobbly, but it’s an interesting topic nonetheless which adds the keyboard of one of the most popular computers to your nerd machinery. Enjoy!