So I have seen several examples of interfacing microcontrollers (PIC and msp430 specifically) to a TV by way of composite video out, but these examples have all been light on technical details in the way of explicit timing diagrams for these video signals. The motivation for making this interface is the inherent simplicity as we can create a basic black and white composite signal by connecting two digital I/O pins together through a pair of resistors, so, it is fairly easy to add video support to almost any microcontroller project and thus bring about a sense of nostalgia. First, I will explain the basics of composite video and then demonstrate a simple improvement to the system.

The NTSC composite video spec defines a way to transmit a 480 line color image at 30 frames per second using one conductor. The image is split into two fields (odd and even lines) which are updated at 60Hz and contain both the luma (brightness) information as well as chroma (color information). If we are dealing with monochrome image generation only, our signals of interest are only dc levels in the range of 0V to 1Vdc delivered at a 75Ohm load, our required bandwidth is also reduced to under 20kHz as compared to 3.5MHz for a full color signal.

Each horizontal line starts with a short sync pulse at 0V, then followed by a horizontal blanking interval at ~0.3V followed by a grayscale signal, where 0.3V is considered pitch black and 1V is considered bright white with the grayscale in between. There is a 300mVpp color burst between the sync pulse and the image data which generates a phase reference for QAM encoded color data, but it is not important for monochrome signal generation. Again, the DC levels of the active image data are responsible for the luma while the phases of the superimposed sinusoidal waveforms are responsible for the chroma. The NTSC spec calls for 525 lines, but as mentioned before, only 480 are active image data, the rest are responsible for the vertical blanking interval, these allow for the electron beam to travel from the bottom right corner to the top left, and for the TV to determine if field 1 or field 2 are being transmitted. As specified before, the image is interlaced, so first the odd lines are displayed (field 1) and then the even lines are displayed (field 2) in between two separate vertical blanking intervals. The timing waveforms are displayed below, for clarity. They are taken from these two sources:

(1) ni.com

(2) tek.com

In both of these applications (PIC and msp430) the composite signal is generated by connecting two digital I/O pins to a resistor bridge, say 1.2KOhm and 400Ohm, and then assuming a 75Ohm load, the digital outputs are set so that the device can output 0V, 0.3V and 1V based on a 0V and 5V digital outputs. One improvement is to replace the signal generation with a simpler 8bit DAC, to generate a wider range of grayscale. In monochrome, the bandwidth is limited to less than 20kHz, so we can use a slow DAC that is relatively inexpensive. The output of this DAC should then be put through a buffer with a 75Ohm resistor in series with the output to give the impression of a 75Ohm output impedance. The motivation for both of these is that the timing criteria for the video generation are pretty strict, so the quality of the displayed data could be exponentially increased by dedicating one piece of hardware to do digital (in memory) to analog (composite video) conversion and another to do the actual processing, be it for a game of PONG or something else, and as the devices are very cheap, the cost increase would be small. Having said this, a minimal hardware design with compact components and memory foot print does have its benefits and is a good decision in certain cases. A proof of concept design will follow in the not-too-distant future.

horiz.jpg

vert.jpg

0.1CE.gif

0.10F8.gif

del.icio.us | digg