Vienna Wireless Society

Video Overlay Board

Ben Gelb, KF4KJQ


Summary

The video overlay board allows the display of a callsign and GPS data on an NTSC video signal. We used this on one of our balloon flights for the ATV downlink. The device locks onto the sync of an external NTSC signal (from a video camera), then pulls the video line high at the correct times to render text on the screen. It also takes as an input a 4800 baud NMEA-formatted data stream from a GPS receiver to update the GPS fields on the screen.

Circuit Description

The overlay board uses a clamp and biasing circuit and biasing circuit to raise the level of the NTSC sync pulses to just above 0 volts (but should be less than 100mv). This signal is then fed into one of the inputs of the Atmega8's on-board analog comparator. The other input of the comparator is connected to a voltage reference established by a diode and resistor divider. The comparator will give a positive output upon the arrival of each sync pulse. This comparator output causes an interrupt to fire.

There are a few values in this circuit that you may have to play with to get a stable tracking of the sync pulses. They are marked with an * in the schematic. The values in the schematic worked great on the breadboarded version. In the final version I ended up using a 470K resistor and a 10uF capacitor. Some experimentation is required here.

The output circuit has two parts - one output line to print white text, and another line to dim the background behind the text to ensure it is readable. The text output is isolated by a diode so that the output is either 5 volts or a high-impedance state. The output is connected in series with a 100 ohm resistor to limit the brightness of the text. This output is connected to the SPI port on the Atmega8 so that display bits can be shifted out in a fast and precisely-timed manner. Font size can be changed by altering the output bitrate.

The other output line controls the dimming of the background behind the text. This is acheived by pulling the video line to ground through a 100 ohm resistor. The I/O pin used is toggled between ground and high-impedance by toggling the pin's direction bit between input (Hi-Z) and output (GND). Both output resistors may be adjusted to control the text brightness and background dimming.

Software Description

The software routine for the overlay board is driven by two interrupts - the sync pulse interrupt and an 80us timer interrupt. The 80us timer interrupt is reset each time the sync pulse occurs (every 60us or so) so it will never be triggered unless there is no sync. Whenever the sync pulse interrupt occurs a few things happen - first it is determined whether or not the pulse is an H or V sync by looking at its length. If the pulse is a V sync, the line counter is reset to 0. If it is an H sync, the line counter is incremented by one and the corresponding line is outputted to the screen. If there is no data to output for a given line, the time is used to poll the serial port to read in the GPS data or to parse the GPS data. The serial port must be read at least once every 30 lines to keep up with the input data rate.

If the timer interrupt is triggerred, the line counter is reset to 0 and the serial port is read. It is important to continue to read the serial port regardless of the presence of a video signal so that intermittent sync cannot cause corruption of the data stream.

Source Code

The source code for the overlay board is available for download subject to the license conditions at the top of Main.c. This source code has been successfully compiled with the WinAVR development package. There ought to be no problem compiling it with avr-gcc under Linux, but I have not tried it.

overlay.zip (51K)

Acknowledgments

I owe a great many thanks to Gary Dion, N4TXI for making this project possible. He wrote most of the font-rendering code that I used for this project, as well as the NMEA parsing code. Gary also suggested looking at the circuit design of another overlay circuit designed by William Cooke as a starting point. I ended up utilizing this circuit with only a few modifications, and adapting it to the Atmega8 microcontroller. So, I also would like to acknowledge Mr. Cooke for making his design public for the rest of us to use and learn from.

Printer-Friendly Version


Web hosting provided by Pete Norloff, KG4OJT of Norloff Computer Corp.
Copyright © 2001-2007 Vienna Wireless Society. All rights reserved.
Winterfest ® is a registered trademark of the Vienna Wireless Society.