Resman says hi.

USB <-> NES controller adapter

Table of contents

This project describe an adapter that allows to plug an original NES gamepad in a PC. This is mainly useful for emulators, but maybe it can be used with some modern games too.

Final prototype

Circuit

As with most purely digital projects the schematic is very simple. USB connector on one side, NES pad connector on the other, a few discrete component and one microcontroller to do all the work :

The schematic

Parts list:

As a prototype I hand-carved a small PCB. Here the PCB itself acts as the USB connector, however I don't recommend it as it adds a little too much stress to the port to my liking.

Prototype board, unfortunately wired wrong

Add a few layers of electrical tape on the back of the PCB to add some height. You can add some until there is enough, or do as I did and check the USB specification. The answer is that the tab should be 2.25mm high, so do that. Of course an actual plug has spring-loaded contacts so this won't be as good.

PCB as USB plug Add the µC

Actually I got the wiring wrong, I thought that the data lines could go anywhere and that it was just a matter of changing the configuration of V-USB, but it actually works only if D- is connected to INT0. Or at least I didn't manage to make it work with an interrupt-on-change pin. So I had to do a little point to point wiring. I also remade a proper layout using Eagle. You can download the project files below.

Code

The microcontroller firmware is based on V-USB. It relies on the internal oscillator calibration feature of the ATtiny45/85 to adjust the CPU frequency within tolerance of USB timings without the need to use a crystal, which allowed fo an even smaller PCB. Grab the project files below.

I'm using USB HID class, so no driver is needed. Just plug it in and it will pop in the available game controllers. I've tested it with Windows 7 and Ubuntu. I'm pretty confident it will pose no problem under Mac OS.

Windows properties window Windows properties window

The Kit

A kit with a professionnally made PCB is available for purchase here.

Kit

Contents

Assembly instructions

First make sure you have all the components. Refer the the parts list higher or to this picture. The DIL8 component socket is missing but you should have one in the kit.
Solder the components from the smallest to the biggest. Start by the 2 Zener diodes, then the resistors.
Place the USB plus and the IC socket. The socket serves to help avoid overheating the microcontroller, and makes replacing it easier. You don't have to use it if you wand to make the final circuit slimmer.
Now put the 100nF decoupling capacitor which is the highest component at this point.
Last component, the NES controller connector.
It has a 2mm pitch, which is slightly wider than the 1.6mm PCB, so you'll need to bend the pins on one side slightly.
Don't hesitate to put a large amount of solder to make sure it is well attached.
Put the microcontroller in the socket. The dot in one corner indicates which pin is pin 1. Place it in the socket so that pin 1 is next to the notch that is printed on the PCB.

And done !
Play some NES games now !

That's all there is to it. Plug it in your PC and it should show up as a standard game controller. Buy the kit if you like, and have fun!