This project consists of two fundamental parts.
The first, and the more time consuming part, is the hardware design. The big problem is
--how does one generate color and display it onto the screen? The standard NTSC signal
consists of all levels of color, distributed in a fashion that allows the TV to distinguish
between them. As visible in the NTSC video signal image below, the video signal is comprised
of the beginning of the sync. Once this beginning is seen, a burst of signal is sent, followed
by the color. In this case, black corresponds to the lowest voltage level while white is the
It is relatively simple to get a black&white signal since all one has to do is produce a
burst and just select high or low logic levels to output with the TV signal. However the color
signal is more complicated. Given the timing and memory limits of the chip, it would be rather
difficult to produce color. The simple solution is to use a RGB-NTSC converter.
We chose to employ the Analog Devices AD724JR chip for this purpose. The chip uses separate
analog and digital power and ground connections (one must remember to use coupling capacitors
with both the power inputs, details are in the AD724 data sheet). It also requires a sync
signal, which allows it to synchronize itself to the RGB signal. The chip must be given separate
horizontal and vertical sync signals. In addition, it has three inputs that correspond to red,
green, and blue. This RGB signal is generated by the Mega32 with special timing. Once the chip
receives this RGB signal, it combines it with the horizontal and vertical sync pulses to create
a NTSC color signal. This signal is relatively high, in terms of ground. Thus, it must be decreased
using a capacitor and a resistor so that the TV can differentiate among critical aspects of the
video signal. Also, this signal is not a perfect NTSC signal and thus leads to noticeable
distortion/wiggle on the screen. The output signal is delivered through a standard RCA video
cable to the color TV.
For our purposes, a outside vertical sync signal is not required since our sync generates
is able to produce a composite sync. So, the vertical sync input on the AD724 is left high.
We chose the Elm Electronics 304 Sync Generator to deliver our sync signal. This chip also
requires a coupling capacitor to the power input. It produces an approximate of a 15KHz signal
that can be delivered to horizontal sync input of the AD724.
Both the AD724 and the ELM304 run on 3.58MHz clocks. This is required in order to adhere to
color video signal generation standards.
The Mega32 is interfaced to the AD724 through PORTC. Three of the pins of this port are
designated as red, green, and blue, that serve as inputs to the AD724. The Mega32 runs on a
16MHz clock. Yet, in order to be able to communicate with the AD724, the Mega32 software
must also have a 3.58MHz reference. For this purpose, an interrupt was designed to trigger
with the ELM304 signal and produce an RGB signal. PORTD is reserved for this interrupt.
PORTA of the Mega32 is used to interface with the Sega Genesis serial controller. This port
serves as both input and output for the controller where the inputs accept button-press
signals and the outputs supply power and ground.
A simple Sega Genesis controller was used to control the game on TV. This controller was chosen
over some other controllers on the market since it has no synchronous logic and the buttons
simply short connections to give a high or low signal. Low logic signals are interpreted as
button pushes. Since we had two controllers, we cut the plug off one of them in order to
determine which wires carried the signals for which buttons.
Other aspects of design
Initially, we tried to rely on the previous year's project's hardware design. However, since
that design was a bit different than that of ours and did include some errors, we decided
to base all our design on data sheets and internet resources.
There was a lot of confusion regarding the sync signal. According to the AD724 data sheet,
the vertical sync input can be held logic high only if a composite sync signal is being
provided to the horizontal sync input. However, we were not certain whether the ELM304
provided a true composite signal. Instead of following the suggested design in the ELM304
datasheet, which calls for the use of all ELM304 outputs in order to compose a composite
sync, we simply used the first output since it seemed to hold the most information. The
other two outputs simply contained other information that was not needed for our project.
It is also suggested that the initial design be done on protoboards and not directed soldered
onto a prototype board--especially if this is the first time that one is experimenting with
color. There is enough room for errors and it is much easier to be able to simply remove a
few wires instead of de-soldering them, for debugging.
The second part of this project is the software design.