Loading files…
This project is designed to allow a modern USB keyboard to be used with a Commodore 128D/DCR in place of the original Commodore keyboard.
This was initially forked from https://github.com/Hartland/C64-Keyboard but I made lots of both hardware and software modifications to achieve my goal of supporting full C128 keyboard.
I have kept only USB section as PS/2 keyboards are becoming retro themselves.
This project requires SEEED XIAO SAMD21, which has USB-C socket. USB-C keyboards are rare yet. I use OTG USB-A (female) to USB-C (male) adapter to connect standard PC keyboard.
-- Maciej 'YTM/Elysium' Witkowiak
40/80, CAPS, second set of cursorsUse KiCad to open the project in kicad-c128keyb folder.
In the kicad-c128keyb/plots you will find ready to use Gerber files for manufacturing as well as schematic
The easiest way to order PCBs is through the shared project page on PCBWAY. Simply click this link and add to your cart.
C128D has +5V power exposed on pin 4 of the keyboard port. C128DCR doesn't have this feature. It's quite easy to make an internal modification in C128DCR and add that missing connection.
Here is one wire added to the bottom part of the C128DCR mainboard that connects +5V from joystick port to pin 4 of the keyboard port.
If you are unwilling to open your C128DCR, you can provide external power from nearby tape or joystick port instead.
In this case keep the jumper JP1 open and provide +5V to the Ext. power connector. Mind the polarity.
Options:
Ext. power for unmodified C128DCRExt. power; for C128D or modified C128DCRIf you don't want to keep the adapter sticking out of the side of computer you can make an extension cable.
You need:
Steps:
Use Arduino IDE to compile and flash sketch from SEEED/C128_keyboard/C128_keyboard.ino.
SEEED XIAO uses slightly modified USBHOST Arduino library SEEED/C64_USB_Host_Library_SAMD. This directory will need to be copied into the Arduino library directory.
SEEED XIAO will need its board driver installed into the Arduino IDE. See manufacturers instructions.
Key maps are defined in SEEED/C128_keyboard/keymaps.h. You can modify existing ones or add your own.
If you add a new keymap you need to add it to keymaps[] array at the bottom of that file. The first key map in that array is the default one.
Top row has keys assigned in C128 fashion. This layout works best if you have muscle memory of the original keyboard.
| USB key | C128 key |
|---|---|
| ESC | RUN/STOP |
| F1 | ESC |
| F2 | TAB |
| F3 | ALT |
| F4 | CAPS/DIN (toggle) |
| F5 | HELP |
| F6 | LINEFEED |
| F7 | 40/80 (toggle) |
| F8 | NO SCROLL |
| F9 | F1/F2 |
| F10 | F3/F4 |
| F11 | F5/F6 |
| F12 | F7/F8 |
| Print Screen | reset MT8816 switchboard |
| Scroll Lock | Shift Lock |
| Pause | switch to next keymap |
| Insert | POUND |
| Home | CLR/HOME |
| Page Up | RESTORE |
| End | RUN/STOP |
| NumLock | enable/disable joystick #2 on keypad |
| Shift+NumLock | enable/disable joystick #1 on keypad |
| (keypad) | C128 keypad |
| left CTRL | C= key |
| left SHIFT | left SHIFT |
| left ALT | C128 top cursor down |
| left Win | C128 top cursor up |
| right CTRL | C128 top cursor right |
| right SHIFT | right SHIFT |
| AltGr | RESTORE |
As you would expect from standard keycaps, e.g. SHIFT+2 is '@', not '"'.
Other changes:
Same as C128 positional, except that numpad keys are mapped to 1-0 keys above QWERTY row
Same as C128 symbolic, except that numpad keys are mapped to 1-0 keys above QWERTY row
Joystick mode is toggled when you hit NumLock (with or without SHIFT). When NumLock LED is ON then joystick mode is enabled.
Note that it's not supposed to replace your regular joysticks - joystick #2 actions may be interpreted by some games as keypresses.
No comments yet. Be the first to ask about this board.