Start
Video
Signal Anatomy
Transforming Digital I/O
Output Resolution
Memory Restrictions
Using
DMA
Perfect Fit
Sources and PDF
TRANSFORMING
DIGITAL I/O
The
M16C/62P microcontroller has 5-V digital outputs.
To transform these into an RGB video signal, you
need some additional circuitry. However, you can
limit it to a couple of simple resistors and transistors.
First,
you need to transform the M16C/62P microcontroller’s
0- to 5-V output to the 0.7-VPP video level. This
is easily achieved with a two-resistor voltage
divider. R8 and R10 form this voltage divider
for the red output signal (see Figure 5, p. 27).
R9 adds a small DC offset to it. Transistor T2
is connected as an emitter follower; with R11,
it provides the signal with the 75-W output impedance
that’s required for video. The green and blue
outputs are created with identical circuits. A
television’s input impedance is also 75 W so
the actual video signal level is half of the level
present at the transistor’s emitter. If you calculate
the high and low values for the three color components,
you’ll find that the difference is 0.6 V. That’s
about 85% of the maximum level (0.7 V), and it
produces nice bright colors.
|

(Click
here to enlarge)
|
Figure
5—The connectors on the left connect the CD-ROM
player to the M16C62P starter kit board. They
aren’t needed if you want to build only the
video production portion of the design. The
SCART connector on the right is the audio/video
connection on European televisions. For American televisions, replace it with cinch
connectors for the individual signals. |
A
similar circuit is used for the sync output. To
generate a pure RGB signal, it’s sufficient to
transform only the 0- to 5-V sync output from
the M16C/62P microcontroller into a 0.3-VPP signal
like with the R, G, and B outputs. But I added
something extra. The RGB output from a DVD player
often contains a complete CVBS signal on the sync
output. The synchronization pulses along with
the R, G, and B signals are used when connected
to an RGB input, and the complete CVBS signal
from the sync output is used when connected to
a CVBS input. I did something similar.
I
can’t create a complete color CVBS signal (it’s
too hard to encode the R, G, and B components
into the 3.58- or 4.43-MHz carrier wave), but
I can create an old-fashioned black-and-white
video signal from it. That involves simply adding
up the luminance of the R, G, and B components.
In the analog world, adding voltages involves
just tying them together with a few resistors.
Take
another look at the circuit diagram in Figure
5. R1, R2, R3, R4, and R6 mix the color and sync
signals. R5 creates small DC offset. Just like
with the color signals, T1 and R7 create a 75-W video output. The three color components are not
mixed in the same ratio. When converting to black
and white, green is brighter than red, which in
turn is brighter than blue. I mixed the green,
red, and blue component in a ratio of 4:2:1. This
results in eight evenly distributed shades of
gray in the black-and-white signal.
So,
if your television set does not have an RGB input,
connecting the sync signal alone to the composite
(CVBS) input provides a black-and-white image.
Alternatively, by tying R1 and R3 to G instead
of to R and B, the Sync output becomes a sync-on-green
output that can be used along with the R and B
outputs to feed into a television or monitor that
doesn’t have a separate sync input on its RGB
input.