An adapter to connect USB mice and joysticks to C64/C128, Amiga and Atari computers using a standard DE 9 connector.
This project includes ideas, software and schematics developed by Emanuele Laface (see LICENSES.txt). Many thanks to him for this great idea!
The main differences are:
- KiCAD schematics and PCB layout instead of Fritzing
- Single sided PCB layout using only standard THT components
- Track widths and component placing made for easily producing the PCB at home (e.g. with a Cubiko CNC mill)
- A nice case that can be closed without screws
- Also fits a Commodore C128D CR - The version with the metal case has the joystick ports set back
- Uses pioarduino IDE instead of Arduino IDE. Optionally PlatformIO can be used, too.
- No differentiation between PAL and NTSC
- Fixes for USB joysticks connected via learning mode
- Completely new C1351 mouse emulation for C64/C128 using MCPWM - Very smooth mouse movement with no position jumps anymore
- Important: Currently only basic joysticks, gamepads and mice are supported. There is still some code left from the original "configurator" but it's untested, most probably not working and will soon be removed and replaced by a nice web UI via WiFi interface.
- 1 x WaveShare ESP32-S3-Zero (or a compatible clone - be sure to carefully check the pinout!)
- 2 x 9 pin headers for ESP32-S3-Zero (if not included)
- 2 x 9 pin female headers
- 1 x 2N3904 NPN transistor
- 2 x 1kΩ resistors, 1% tolerance
- 2 x 150Ω resistors, 1% tolerance
- 1 x 5.1kΩ resistor, 1% tolerance
- 2 x BAT43 or BAT85 Schottky diodes
- 1 x Mini PCB 1P2T SPDT slide switch with 2.54mm spacing (size 8x4x10mm)
- 1 x D-SUB 9 / DB 9 / DE 9 female connector with solder cups (ideally remove the metal housing to prevent short circuits with the 5V line)
- 1 x PCB (milled/etched/lasered - whatever you prefer)
- 10-15cm drawn wire for wire bridges
When producing the PCB make sure the dimensions are according to the Gerber files as otherwise the 3D printed case won't fit. If you want to give CNC milling a chance and need help how to start just contact me. I've already gone through the valley of tears and have a bullet-proof method now with my cheap Cubiko CNC mill to produce great results.
As the metal-housed DE 9 connectors are potentially dangerous (if you don't look when plugging in you could cause a short circuit with the 5V line) it's recommended to remove it:
The easiest way is brute force: Use two pairs of pliers, one to hold and the other one to bend the metal tab (with the hole in it) up and down until it breaks. Then you can open up the connector. Depending on the brand and manufacturer it will either hold together or fall apart. In the latter case just use a little bit of superglue and glue the parts together.
Then solder the DE 9 connector and make sure it's aligned to the center and the PCB behind is levelled. If you already have the 3D printed case you can check with the bottom part if everything fits nicely.
Next solder the five short wire bridges from the upper part of the DE 9 connector and the two longer wire bridges. They are drawn in red in the pcb assembly drawing.
Then continue with the rest and make sure the diodes are in the correct orientation.
After the main PCB is finished, solder the pin headers to the ESP32-S3-Zero and make sure it fits the main PCB without bending any pins or headers.
Press and hold the "boot" button (left button when the USB-C port is facing up) while connecting the ADAPTR via USB-C to your computer. Then you can release the button. This activates the so-called "download" mode to flash firmware.
If you are using PlatformIO or pioarduino you'll probably know what to do next. If not the easiest way is to use the ESP Tool which is a browser application that can locally connect to your ADAPTR and flash the firmware:
Press the "Connect" button and select the corresponding serial port (something with "USB JTAG/serial debug unit"). After successful connection choose the flash address "0x0000", select the firmware file downloaded from releases and click on "Program" to upload the firmware.
If you want to put everything in a case then you have to 3D print the STL files in the case subfolder of this project. Ideally use PLA or other non-warping filament. Print both parts in their natural alignment, meaning the bottom part facing the bottom down and the top part the top up (with supports). Make sure to use a layer height of 0.16mm or below.
The case is designed to fit both the DE 9 connector with and without the metal housing but I still recommend to remove it.
The assembly is easy if you put everything together in the following order:
- Remove the ESP32-S3-Zero from the PCB and put it inside the top case with the USB-C port first
- Connect the PCB on the ESP32-S3-Zero
- Put the bottom case on the top case until the retaining tabs click into place
ATTENTION: Never ever attach the ADAPTR to your C64/C128/Amiga/Atari when the USB-C port is connected to a power source! This may be a computer (e.g. for firmware flashing) but also some (battery) powered controllers (especially wireless base stations etc.). Only use non-powered devices or attach a cable/adapter that removes the power line!
The power consumption from the 5V port in action (button/axis/movement) is about 75mA with an USB joystick and 85mA with a laser mouse attached and is still within the allowed 100mA according to the specifications. Don't connect devices that will draw more power e.g. by charging a battery or similar.
When looking at the ADAPTR from behind, there is the small switch where you can select if a mouse (switch is left) or a joystick (switch is right) is emulated. Set this switch to the device that is connected.
Alternatively ADAPTR is able to emulate a mouse as a joystick and a joystick as a mouse depending on what the switch is set to. The former is also a feature of the original Commodore 1351 mouse and is nice to e.g. play point-and-click adventures with the mouse even if they were programmed for joystick only.
A normal USB mouse should work out-of-the-box. When connecting a joystick you'll have to use the learning mode first to help ADAPTR learn your device's axis and buttons right.
In normal operation after powering or plugging in the LED will first turn red and then
- Green in joystick mode
- Blue in mouse mode
First make sure the Mouse/Joystick switch is set to Joystick mode before anything is connected to be able to test everything after learning is finished.
Then make sure no USB cable or device is connected and connect ADAPTR via the DE 9 plug to your computer. After you see the red LED, you have one second to press the "boot" button to enter the learning mode. If it worked you'll see the red LED flashing quickly and then turning green. Don't press the "boot" button too early or before connecting as this initiates the "download" mode for firmware updates.
Now connect your joystick via the USB-C port and the green LED turns off when the device is being recognized as a USB HID device. Now you'll have to learn the 4 axes and 3 fire buttons by repeating the following steps for UP, DOWN, LEFT, RIGHT, FIRE1, FIRE2, FIRE3 (exactly in this order):
- Press the boot button --> the LED will turn blue
- Move/press your joystick axis/button (starting in the first round with UP, see above)
- The LED turns off
- Next round with the next axis/button
After the seventh (FIRE3) button the LED will turn red and flash and then ADAPTR will reboot and can directly be used. The values are stored in EEPROM and will of course survive a power cycle.
Important: Axis and buttons can't be skipped and even if your joystick doesn't have a second or third button you'll have to learn it e.g. by pressing the same button again.
PS/2 to C64 Mouse Adapter from Viacheslav Skavinsky has some great explanation about the protocol used in Commodore 1351 mice. Source code on GitHub.
U.S. patent 4,886,941 describing "CIRCUIT FOR INTERFACING MOUSE INPUT DEVICE TO COMPUTER SYSTEM"




