So, my wife volunteered me for “Science
Day” at my son’s elementary school —
an annual half day program where moms
and dads taught mini-courses on
everything from rocketry to zoology to
chemistry. But what could I teach the
kids? No sooner did the thought cross
my mind, did I get
the answer: build
a video game!
NOTE – in the source code on the RetroGame
web-site, the duration table in music.asm is
incorrect. The note durations are wrong. The table
should read as follows. It isn’t fatal as is, though.
; dotted half
BY ERIC ROTHFUS
Thus, the “RetroGame” was born. The RetroGame is a
simple hand-held video game that was designed to be
assembled by third to fifth graders during a 45 minute
Science Day period. The game physically consists of a
PCB (printed circuit board) with a 5x7 LED matrix display,
two pushbuttons, and surrounding control and power
electronics. The games were fully soldered by the time the
kids got them, but the main parts including the processor
and display were socketed, so the kids would have to
“assemble” the games themselves.
I created two games for the RetroGame, each as a
separate firmware load for the processor PIC:
finding the basic parts, I went on a search for a cheap processor.
I decided on a PIC 16C620. It was small with 18 pins,
and had a useful amount of memory. Most importantly, I
could get a bunch of them cheap! Since the game is simple,
very few I/O pins were necessary. In fact, one remained
unused … which never happens in any of my projects.
I wasn’t sure how much memory I needed at first, so I
started with the 620, but quickly realized that movng up
to a 622A would be necessary. They are pin-compatible,
so it was an easy move.
The RetroGame circuit itself is very simple, and
consists of the following basic sections:
In this game, your “moon rover” (a flashing LED) has
to make its way through rough terrain which constantly
approaches from above. The buttons allow you to move
from side to side.
This is a mini Tetris where small pieces can be moved
from side to side, but not rotated. This proved to be the
most popular game.
I would have created a few more games, but ran out
of time. The software architecture lends itself to (relatively)
easy game creation, fortunately.
Building the RetroGame
My first task was to do the
basic design of the game, and
then try to procure the cheapest
parts I could, which would then
drive the final design of the
circuit and layout of the PCB —
though I already knew that I
wanted the PCB to look like a
retro video-game controller. After
38 April 2009
■ FIGURE 1
• Power: As my concerns were more with cost than efficiency, the power section of the circuit uses a 7805 five
volt regulator that converts the nine volts from the battery.
The regulator is old technology that you can get very cheaply,
but it uselessly dissipates a bunch of heat when in use. You
should notice fairly quickly that there is NO power switch
for the RetroGame. To turn it on, you plug in the battery
connector. Eliminating the switch saved some money and
the kids loved the hands-on feel of plugging in the power.
• Input: Two momentary push buttons pull two input pins
of the PIC controller to ground when pressed. Otherwise,
pull-up resistors (R9, R10) pull them to +5V. These
pushbuttons are the only user input for the game. I used
cheap switches which “bounce” quite a bit. The software deals with this issue. I briefly considered adding a
third pushbutton (because I already knew I wanted to
create Retris and wanted
rotation) but abandoned the
idea in favor of simplicity.
• Processor: The processor
section consists only of the
PIC 16C622A (the generic
16C620 is shown in the
■ FIGURE 2
schematic). Note that the
internal oscillator is being