This week, I built a variation of the Uzebox open-source game console inside of a classic NES controller.

From the Uzebox website:

“The Uzebox is a retro-minimalist homebrew game console. It is based on an AVR 8-bit general purpose microcontroller made by Atmel. The particularity of the system is that it's based on an interrupt driven kernel and has no frame buffer. Functions such as video sync generation, tile rendering and music mixing is done realtime by a background task so games can easily be developed in C.”

The design of the Uzebox revolves around two central ICs, the ATmega644 microcontroller and the AD725 NTSC encoder. The ATmega644 processes the actual game code and generates analog RGB signals, and the AD725 generates a valid NTSC waveform from these signals for output to a television.

There are several implementations of the Uzebox hardware floating around the web, and I researched these thoroughly so that I could pick and choose design features that I liked into my own version. Yay for open source hardware, and big ups to Uze, Clay Cowgill, ladyada, and Steve Chamberlin!

Never having done anything with digital-to-analog converter, I first built a minimal version of the hardware that would allow me to understand the basics of DAC design as well as displaying greyscale video to a screen. This design consisted solely of the ATmega644 as well as a resistor ladder which mixes the 8 color channels with the horizontal sync signal. Once I got this working, I moved onto the color version. But first.....

****NOTES ON DAC DESIGN****

I had somewhat of a hard time finding a brass tacks summary of how to design an appropriate DAC for the Uzebox. Here’s a summary of what to do in order to design a simple resistor ladder DAC.

A (“binary weighted”) DAC can be implemented using a resistor ladder whose output overall output voltage is controlled by which resistors have current flowing through them. These resistors are chosen such that each is twice the value of the previous one, giving a summed output voltage that is proportional to the binary value of the inputs.

For example, in the color version of the Uzebox, each color channel’s output needs to be between 0 and .7 volts for input into the AD725. Finding the input resistors’ equivalent parallel resistor (given that each resistor value is twice that of the last) and solving the resulting voltage divider with the 75 ohm pull-down resistor gives the values of each unknown resistor.

So, the optimal resistor values are about 806, 1.6k, and 3.2k.

Unfortunately, since these exact values were not available, I chose the closest available values from the Digi-Key catalog.

Anyway, after confirming the functionality of the Uzebox kernel with the simple greyscale hardware, I set about designing a full-fledged color version to fit inside of a classic NES controller. I went after the controller with a set of calipers and designed a board outline in SolidWorks which would fit around the internal features of the controller. I then exported this drawing as a DXF and converted it into an Eagle script using a free utility. I then laid out the circuit board inside this board outline.

Next, I laser cut a hole in the back of the controller to allow access to the power and programming pins.

I finally re-assembled the controller around the board, uploaded the firmware, and commenced playing Pac-Man!

In the next version, I’d like to do a dual-layer board to save routing space so that there would be enough room to keep the batteries inside of the controller. Also, since the SNES controller is the “official” one used by the Uzebox, version 2 will live inside of an SNES controller.