USB <-> NES controller adapter
Table of contents
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 :Parts list:
- 1x ATtiny45 or ATtiny85
- 1x NES controller female connector
- 1x 100nF capacitor
- 2x 3.6V Zener diode
- 2x 68Ω resistor
- 1x 1.5kΩ resistor
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.
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.- AVR GCC project files. Licensed under the GPL v3. To burn using avrdude you'll need to adjust the Makefile for your programmer, then type make program fuse. Alternatively, burn the .hex with your favorite software and set the fuses to 0xe1, 0xdd, 0xff (low, high and extended respectively).
The Kit
A kit with a professionnally made PCB is available for purchase here.Contents
- 1x PCB
- 1x ATtiny45 or ATtiny85
- 1x DIP8 IC Socket
- 1x USB Type A Male PCB plug
- 1x NES controller female connector
- 1x 100nF capacitor
- 2x 3.6V Zener diode
- 2x 68Ω resistor
- 1x 1.5kΩ resistor
Assembly instructions
Buy the kit if you like, and have fun!
Comments
Allez savoir, ça dépendra de l'autre...
Very cool!! Its this adapter compatible with the Xbox Original (the first fat black)? Xbox has 4 USB 1.0 port, so
that will be nice to connect the old NES controller on it!!
BRAVO for your job;-)
Greetings from Electronic Guy in Switzerland!
Daruble@att.net
Any suggestions?
Will have to wait another 5 days to complete!
I know that the comment system needs improvement (lots of), I'm confident I'll allocate some time to work on it eventually ;-)
#define USB_CFG_DMINUS_BIT 3 //PB4, pin 3, pulled up to Vcc by 1.5k
#define USB_CFG_DPLUS_BIT 4 //PB3, pin 2, PCINT3 (note: not INT0!)
#define USB_INTR_CFG GIMSK
#define USB_INTR_CFG_SET _BV(PCIE)
#define USB_INTR_ENABLE PCMSK
#define USB_INTR_ENABLE_BIT PCINT4
#define USB_INTR_PENDING_BIT PCIF
#define USB_INTR_VECTOR PCINT0_vect
note: your comments system does not correctly HTML-sanitize input.
#define USB_INTR_CFG_SET (1
#define USB_CFG_DMINUS_BIT 3 //PB4, pin 3, pulled up to Vcc by 1.5k
#define USB_CFG_DPLUS_BIT 4 //PB3, pin 2, PCINT3 (note: not INT0!)
#define USB_INTR_CFG GIMSK
#define USB_INTR_CFG_SET (1