A while ago, I found on the net a couple of projects about doing video with microcontrollers. One of them, made by a guy named Rickard Gunee, was a Pong game made with a single PIC microcontroller and a few resistors! The microcontroller was generating the (monochrome) video signal, sync and basic sound all at once with cycle-counting precision. Indeed, I found this pretty awesome and it finally motivated me to design my own console, built with some of my favorite microcontrollers, the Atmel AVRs. Additionally, I wanted it to be in color (at least 256 simultaneous colors), have good sound capabilities and some sort of retro input, like those good old NES or SNES controllers.
Of all the color generation methods, I opted for a simpler one and used a RGB-to-NTSC converter chip, the AD725 from Analog Devices. I also decided to invest time developing some sort of interrupt driven game engine that would mix music, read joypad status, generate video sync and render frames independently of the main game program. Although I knew I couldn't get around insane cycle-counting for the driver, once done, it would makes the actual game development a piece of cake.
Driving my design was the uttermost simplicity, something any hobbyist could build up in no time, ideally built out only of DIP chips. So, apart from the AD725, the console is solely based on an ATmega644, an 8-bit general purpose microcontoller based on Atmel's AVR architecture. It has 4K of RAM(!), 64K of flash for both code, sound and graphics data, lots of I/O lines and many peripheral features. The video is output on one of the ATmega's 8-bit I/O port as RGB, 3 bits are allocated for the red component, 3 bits for the green and 2 bits for the blue. Those are fed to a DAC composed of three R-2R resistor ladders. This gives 256 fixed but simultaneous colors on screen. Note that the pictures taken from the screen doesn't do justice. The picture is way sharper and the colors more vibrant when looking directly the TV, there's not even a slight flicker. Quite frankly, I'm amazed at the results, specially for a wire-wrap prototype!
The system runs overclocked at ~28.6Mhz (8 times the NTSC color burst frequency). Even if the part is rated at 20Mhz, I never experienced any problems to this day! The chip has only 4K of RAM and, since the video memory is very limited, there's no frame buffer. Instead tiles-based video modes are currently supported by the kernel:
The sound is composed of 3 waves channels and 1 LFSR-based noise or PCM channel. Each have independent timbre, frequency and volume. Resolution is 8-bit and is mixed at NTSC line rate (~15Khz) and is output on a single pin via pulse width modulation (PWM). A hi-level player can play specially formatted MIDI files. With any good music sequencer(Cubase, Cakewalk, etc), a MIDI IN input allows the creation of music and sound fx straight on the console.
For the input I initially opted for standard NES controller but then switched to SNES. Aftermarket SNES controllers are easy to buy these days contrary to NES. Moreover, SNES have more buttons and cool accessories have been made (like a mouse!). Although you can't buy the connectors anywhere, the best source is buying a SNES multitap from eBay (~6$+shipping).
Since it went live, the Uzebox got (or is about to get) a few new features like SNES joysticks, SD Card and Ethernet interfaces. All this development happened due to a cheerful community that brought up a lot of knowledge and ideas in the forums. Be sure to have a look and see the state of the project. Also, check the WIKI for a whole lot of documentation on the project.
I could not give enough thanks to Rickard Gunnee for his projects and excellent video tutorials which made this possible.
Copyright (c) Belogic
The Uzebox (including source code and hardware design) is released under the GNU GPL 3.0 Public Licence.
Pictures and content of this site is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
Uzebox is a reserved trademark.