Skip to content

ItsMaximum/NES-Input-Switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NES Input Switcher

A hardware adapter enabling a USB keyboard and an NES Controller to be used on an original Nintendo Entertainment System console. Built around the Raspberry Pi Pico 2 (RP2350).

Completed Build

Completed Build

Wiring Diagram

Wiring Diagram

NES Controller Pin Pico 2 Connection
Ground (GND) GND
Clock (CLK) GPIO 2 (Input)
Latch GPIO 3 (Input)
Data GPIO 4 (Output)
Power (+5V) VBUS

The Pico 2's GPIO pins are 5V-tolerant, so no level shifter is required. The NES console provides enough current to power both the Pico 2 and a standard USB keyboard.

Default Key Bindings

NES Button Key
Up W
Down S
Left A
Right D
A Numpad .
B Numpad 0
Start Numpad 5
Select Numpad 4

Flashing the Firmware

A pre-built firmware file (picofirmware.uf2) is included in this repository.

  1. Hold down the BOOTSEL button on the Raspberry Pi Pico 2, then plug it into your computer via USB. It will appear as a removable drive.
  2. Copy picofirmware.uf2 to the drive.
  3. The drive will automatically disconnect and the Pico 2 will reboot into the adapter firmware.

Building the Firmware Yourself

  1. Install Git and Visual Studio Code.
  2. Install the Raspberry Pi Pico extension from the VS Code Extensions marketplace. It will handle all SDK and toolchain dependencies automatically.
  3. Clone this repository and open the firmware/ folder in VS Code.
  4. Open the Raspberry Pi Pico extension in the sidebar and select Compile Project.
  5. Once compilation finishes, connect the Pico 2 in BOOTSEL mode (hold BOOTSEL button, plug in via USB).
  6. Copy build/picofirmware.uf2 to the RP2350 drive. The drive will disconnect automatically.

Custom Key Bindings

Key bindings are defined in firmware/keybinds.h using HID_KEY_* constants. Edit the values to remap any button, then rebuild and reflash using the steps above.

#define KEY_NES_A       HID_KEY_KEYPAD_DECIMAL
#define KEY_NES_B       HID_KEY_KEYPAD_0
#define KEY_NES_START   HID_KEY_KEYPAD_5
#define KEY_NES_SELECT  HID_KEY_KEYPAD_4
#define KEY_NES_UP      HID_KEY_W
#define KEY_NES_DOWN    HID_KEY_S
#define KEY_NES_LEFT    HID_KEY_A
#define KEY_NES_RIGHT   HID_KEY_D

A full list of valid HID_KEY_* constants can be found in the TinyUSB HID keycodes header.

About

A hardware adapter enabling a USB keyboard and an NES Controller to be used on an original Nintendo Entertainment System console.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages