Aug 9
2012

Evening hack: NES controller

Tonight I made an adapter for my old NES control pads, so they would show up as USB devices on my computer.

I used a MinimusAVR USB v1 and a NES adapter from Parallax.

The code uses the LUFA USB stack on the Minimus to emulate a keyboard. Here are the key mappings, easy to find in the source code:

ButtonKey (Pad 1)Key (Pad 2)
Axv
Bzb
Selectaf
Startsg
UpUp arrowi
DownDown arrowk
LeftLeft arrowj
RightRight arrowl

Here's how the adapter looks:

Source code is on Github: github.com/nfd/nes_adapter. To use, run make dfu in the normal way.

Connect CLOCK to PORTD.3, LATCH to PORTD.2, DATA2 to PORTD.1, and DATA1 to PORTD.0.

As usual, please email me with suggestions or questions.