Nintendo USB Controller Project

The finished controller

I saw Ed’s blog post earlier this year where he had the great idea of converting an NES controller to work over USB and stuffing a flash drive inside to hold an emulator and some roms. Ed used a USB keyboard controller to “talk” to the computer. When you push Up, Down, A, or B on the NES controller it would send keyboard letter presses to the computer, and the emulator would map those keys to the appropriate NES buttons. I thought that was cool, but I looked around on the Internet and saw some other projects that used a microcontroller to implement a true joystick interface that would be recognized by any computer (PC and Mac), and without any special drivers. I decided to build the adapter on Raphaël Assénat’s site and like Ed, include a flash drive in the controller case.

Here’s a quick rundown of what I did to build it:

First step: Buy Nintendo controllers

NES Controllers

NES Controllers from eBay.

I found some controllers on eBay. Two were in fair condition, two were a little beat up.

Next: Open it up

Inside the controller.

Inside the controller.

Not much inside the controller. We’ll keep everything except the original cord. Initially I cut the cord off right around where it bends before it goes outside the housing. Later on I cut down each wire to keep things a little neater. For now keep the cord as it is, we can keep some length to help testing after the adapter is built.

Next: Build the NES to USB adapter

Breadboard layout.

Breadboard layout.

I followed the instructions at raphnet.net and used his code to program the chip. I already had an SP12 programmer from a previous project, so I figured I could just use it again on this one. Probably one of the hardest parts of this project was programming this thing. I don’t mean writing the code, that’s already been done by someone else, I mean flashing the code to the Atmeg8 microcontroller. I rigged up my old programmer and got it to work, but I didn’t realize that I needed the other pieces (crystal, diodes, capacitors, etc) hooked up to the thing before I could flash it properly. Once I had that figured out the rest was just some soldering and getting everything to fit in the controller case.

Programming the microcontroller.

Programming the microcontroller.

I had to dust off my Windows XP machine to find a parallel port that I could use with my old programmer! I used avrdude from WinAVR to do the flashing.

Next: Test it out!

First test.

First test.

I wired the controller and a USB cable into the breadboard. You can see the USB cable is going into my laptop. At this point if you’ve built and flashed the adapter correctly your computer should register a USB device, and in Windows it should show up under the Game Controllers section in the Control Panel. On the Mac you can see the USB device in the System Profiler (try to hit refresh if you don’t see it).

Another test.

Another test.

Yeah, it’s working. :)

Next: Clean the controller

Cleaning the controller parts.

Cleaning the controller parts.

Next: Cram everything into the controller

Because this controller is actually two USB devices (joystick and flash drive) you need to include a USB hub inside the controller. I cut off two of the nubs on the bottom piece of the controller to allow the USB hub and the adapter to fit. You can figure out which ones to remove when you try to put the bottom piece back on.

A view of all the components.

A view of all the components.

What a mess.

Another view of all the components.

Another view of all the components.

The blue piece at the bottom is a 1 GB flash drive (thank you Sun Microsystems). The green square in the upper right is a 4 port USB hub (cut in half, only two ports are left). The NES to USB adapter is the mess with all the wires. The thing hanging off on the right side is the crystal for the micocontroller. It was kind of big so I ended up putting it under the NES board along with the flash drive. You can see that in the previous picture.

Next: Close it up and play

The finished controller

The finished controller.

This project was fun. The controller feels great and works on my Mac and PC(s). I actually made two controllers. One I gave away to a friend, the other I’m keeping for myself. If I was to do this again I would absolutely buy the pre-made circuit board from raphnet.net. Getting the thing to flash and then trying to make all those wires and resistors fit was a bit of a pain. $20 or whatever he wants is a fair price, and worth every penny.

I found some nice NES icons at IconArchive. Drop an autorun.inf file on the flash drive so you’ll get an icon and default action to run your emulator. You can use one of the bigger icons to change the drive icon on a Mac.

About mike

Mike Jablonski is a web/software/mobile developer who lives and works in Los Angeles, California.
This entry was posted in hardware and tagged , . Bookmark the permalink.

One Response to Nintendo USB Controller Project

  1. Paul Molloy says:

    Hey nice work man, Just in case anyone’s looking to buy any of these I’m making pretty much these exact same things and selling them on ebay:

    http://shop.ebay.com/infiniteneslives/m.html?_nkw=&_armrs=1&_from=&_ipg=&_trksid=p3686

    I can also sell them directly via email at a small discount. I haven’t got my site http://www.InfiniteNesLives.com set up yet to sell these but there are some pictures and other things.

    -paul@InfiniteNesLives.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>