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.

iPhone Exchange Out of Office (OOFy)

I bought a Mac Mini so I could write an iPhone application. This was my first Mac, and I was always a Non-Mac guy. I didn’t hate the Mac, but I didn’t care much about them either. I guess I knew OS X was built on Unix, but it was not until I strarted up the Terminal app and found myself at a bash shell that I really got it. This is my new desktop computer, but my laptop still runs Windows.

The Mac Mini

The Mac Mini

I’ve been a Microsoft .NET developer for a while now, so building something for the iPhone outside of Visual Studio was going to be fun. The end result is OOFy. It’s a dead simple iPhone app that lets you set your Exchange Server Out of Office message. It works on both Exchange Server 2003 and 2007. I’ve tested it out on a number of different server configurations, but it’s not guaranteed to work on any non-standard installations. I’ve done contract work at Microsoft and it works on their setup, so that’s good enough for me.

oofy_icon

Buy OOFy

OOFy is only $0.99 and it’s available in the Business Category of the App Store.

OOFy Main Screen

OOFy Main Screen

More information is available on the OOFy homepage.