Project
Daryl Rictor
Render Up Some Video On
Your Next Digital Project
And Find a New Use for an Old Television
Have you ever wanted to add an inexpensive video
text display to your project? Well, now you can!
The Composite Video Text Display can generate
a 40 x 25 character display on a standard television set
(see Figure 1). The connection to your television is
through the composite video input jack. This is usually
the yellow RCA jack located on the back of most modern
televisions. If your television does not have this jack, a
standard video modulator (RadioShack P/N 15-1214)
can be used to send the signal to your set’s antenna input
on channel 3 or 4. The circuit supports the North
American NTSC standard and the common European
PAL standard.
Theory of Operation
F
o
r
E
l
e
c
t
r
o
n
i
c
s
At the heart of the circuit is an ATmega8 microcontroller
made by Atmel Corporation. It has an eight-bit RISC
core running at 16 MHz. Its pipelined architecture allows
for most instructions to be executed in a single cycle,
producing nearly 16 MIPS ( 16 Million Instructions Per
Second). It has 8 K of Flash programmable memory, 512
bytes of EEPROM, and 1,024 bytes of STATIC
RAM onboard. It also contains its own power on reset
control, internal timers, and up to 23 digital I/O ports. All
this is packed into a narrow, 28-pin IC!
NUTS & VOLTS
E
v
e
r
y
t
h
i
n
g
With the ATmega8, there
is enough speed and internal
resources to provide a basic
black and white display with a
minimum of external parts.
The software code only takes
3 K of the program memory,
leaving enough space to
provide a 512 character font.
Display data is stored in the
internal RAM. All external
components are controlled by
the ATmega8 through its
digital I/O ports.
Since the data RAM is
only eight bits wide, up to 256
different characters can be
52
displayed on the screen at one time. Therefore, the fonts
are organized into two sets. The primary font contains all
256 basic DOS characters, including the accented letters
and the box drawing set. These characters are displayed
in white on a black background. The alternate set
contains 128 standard ASCII characters with some
special graphic characters added. It can display white-on-black and black-on-white characters.
Program operation involves two processes (see
Figure 2). The main loop receives data from the host
device and updates the internal RAM accordingly. Data is
placed on the eight-bit input port by the host and a logic
high on the strobe input from the host will latch the data.
A busy signal is returned to the host. Once the data has
been processed, the busy line is released and the next
cycle can begin.
The eight-bit data presented at the input can contain
either a character or command. A character can be any
standard ASCII printable character such as a letter, number, or punctuation mark. Commands include several
ASCII control characters, such as line feed, carriage
return, tab, and backspace. In addition, the cursor can be
placed anywhere on the screen, turned on and off, and
displayed as a blinking or solid underscore or block. Refer
to Table 2 for a complete mapping of the input data.
To generate a composite video signal, video
synchronization (sync) pulses
and picture data are needed.
The ATmega8’s internal 16-bit
timer is used to generate
interrupts every 63. 5 µs. An
interrupt service routine is
used to provide the necessary
sync pulses via a digital I/O
port. The picture data is
generated by matching the
character data from the internal
RAM with the appropriate font
data in program memory. The
font data is written to a shift
register though eight digital
I/O ports and the resulting
serial data stream is combined
MAY 2004
Figure 1