In this guide, you'll see how to adapt a Commodore 16 keyboard for use on modern computers using CircuitPython and an Adafruit KB2040 microcontroller board.
The techniques in this guide may also be helpful in converting other classic keyboards that use a key matrix. The keypad.KeyMatrix
class in CircuitPython makes this task actually quite simple.
The code in this guide is made for the KB2040, which was designed for exactly this kind of project! With adaptation it would work on many other CircuitPython boards, provided they support the KeyMatrix class, USB HID, and (for the advanced version) asyncio.
Homework
I received this bare keyboard with no documentation. Some internet image searches confirmed it was a Commodore 16 keyboard (the 4 arrow keys on the top row are a dead giveaway). This keyboard is much rarer than the more common Commodore 64 keyboard, which is similar but not 100% compatible.
The keyboard has 60-odd keys (including a physically locking shift key) and a 20-pin connector. Without more documentation or a plan, there are a lot of possible combinations to try.
Luckily, classic computers of this age tended to have good documentation, including schematics. A search for a Commodore 16 schematic finds the following (screenshot from archive.org):
From this, you can intuit the following pin numbers on the keyboard connector
- Rows: 6, 16, 1, 13, 11, 12, 8, 19
- Columns: 5, 3, 10, 9, 7, 17, 14, 15, 18
- Unused: 5, 20
- Optional GND: 4
- Orientation key: 2
From the source code of the Commodore 16's kernal (sic), I found the following table giving the key that corresponds to each row and column--noting that both "shift" keys as well as "shift lock" activate the same row & column:
del return £ help f1 f2 f3 @ 3 w a 4 z s e shift 5 r d 6 c f t x 7 y g 8 b h u v 9 i j 0 m k o n down p l up . : - , left * ; right escape = + / 1 home control 2 space c=key q stop
Armed with this information, you can connect your keyboard to a microcontroller. You can use individual jumper wire connections, or build an adapter cable as detailed on the next page of the guide.
Text editor powered by tinymce.