Read Sega Genesis (Mega Drive) controllers with a STM32F103C8T6 "blue pill".
Download GenesisToUSBDual.zip which has the source code, arduino hardware drivers, Windows drivers, and firmware programing software.
Download and install the Arduino IDE. Installing from windows app store has limitations that will not work in this scenario.
- Open the Arduino IDE
- Open "File > Preferences"
- Add
https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/main/package_stmicroelectronics_index.json
to Additional Boards Manager URLs - Open "Tools > Board > Board Manager"
- Install STM32 MCU based boards
- Open "Tools > Board > Board Manager"
- Install Arduino SAM boards (Cortex-M3)
- Unzip the GenesisToUSBDual.zip
- From the
Install
folder copyArduino_STM32
to your Arduino hardware folder, typically atC:\Program Files (x86)\Arduino\hardware
or<user>\Documents\arduino\hardware
- From
Arduino_STM32\drivers\win
folder run theinstall_drivers.bat
file. This will take a while to run and accept all of the prompts.
If Windows does not detect the ST-Link usb device, you will need to download and install the drivers. Run the SetupSTM32CubeProgrammer_win64.exe
after registering and downloading.
The controller pins are as follows, looking face on to the (female) DB9 plug:
5 4 3 2 1
9 8 7 6
- Connect controller pin 5 to +5VCC
- Connect controller pin 8 to GND
- Connect pins 1,2,3,4,6,9 to a digital I/O
- Connect pin 7 to the digital I/O pin 8 on your Arduino
Modified and Published under MIT license Copyright (c) 2017 Jon Thysell For details on how SegaController reads the controller's state, see How To Read Sega Controllers.