Ever look at your Commodore 64 keyboard and wish you could use it with Vice emulation or PETSCII art programs? There are expensive but feature-rich commercial products such as Keyrah that do the same thing, but can we do it quickly and on the cheap? YES!
Notice this notice
While this project READS from the keyboard and so is relatively safe, you do still need to be careful because there are pins on the Arduino that output current. Make sure everything is connected correctly while power is off and if you see smoke or smell burning, pull the plug!
This project is here because through my own tired, careless stupidity, I managed to kill my Ultimate 64. After talking about how careful you need to be while using the user port on a C64 if you don’t want to burn up something difficult to replace.
What you need
This project requires:
- Working C64 or Vic 20 keyboard
- Arduino Pro Micro (or Leonardo)
- Jumper wires
- Optional LED and resistor
- USB cable
For now, the Arduino needs to be a version that is compatible with the Pro Micro or Leonardo because those use the ATmega32U4, which can emulate a keyboard directly, but I am going to test a version that ought to work on more boards after I have the key mapping all worked out on my known working configuration.
There are others that can do this, such as the expensive Teensy, but the Pro Micro has just enough pins to work and they are super cheap, especially if you don’t mind waiting for slow shipping. If you are in a hurry, you should be able to pick them up on Amazon etc.
Connect the Arduino pins to the Commodore 64
In addition, I wired up an LED with the long leg of the LED connected to VCC and the short leg connected to a 220 ohm resistor and then to Ground. This makes the LED light up when the Arduino is powered.
Programming the Firmware – July 2021 Update!
You might recall a previous, longer incarnation of this article.
Well, since I originally published, it had been bugging me that we had to choose between convenience and capability, and between firmware that was supported and firmware that was not just from years gone by but could not be uploaded using anything but certain versions of Windows.
So I got to work, and produced new firmware that works on Vice, BMC64, Ultimate64 and MiSTer FPGA (though I am still working out the quirks of that last one – watch this space).
Download the code from the C64 usb keyboard firmware repo here and add the HID library, then uncomment to set the key mapping you want, for example uncomment the BMC64 line if you want to use the keyboard with BMC64.