circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

October 2006, Issue 195

Generate Video from Software

 


by René Geraets

Start Video Signal Anatomy Transforming Digital I/O Output Resolution Memory Restrictions Using DMA Perfect Fit Sources and PDF

OUTPUT RESOLUTION

The processor supplies the R, G, B, and sync signals on four of its I/O pins. Using four pins on the same I/O port makes it possible to change all of the levels in just one output operation (writing to the port register). To obtain a usable horizontal resolution, it must be possible to change the value on the R, G, and B outputs quickly. Each image line in the video stream lasts only 64 µs. Only 52 µs form the visible part on the television screen. The other 12 µs are for the sync pulse and horizontal flyback. Most televisions even clip a bit from the left and right when displaying the image, so you shouldn’t put important information near the edges of the screen. For this project, I assumed a guaranteed visible period of 45 µs on each image line.

To be able to show a reasonable amount of text on the screen, you need at least 120 pixels (20 characters) from left to right. Because the processor is clocked at 24 MHz, I aim for a pixel frequency of 3 MHz. This means the processor has eight clock cycles to output each pixel. Note that 45 µs at a 3-MHz pixel frequency gives a horizontal resolution of 135 pixels (i.e., 45 × 3). This meets the requirement of at least 120.

The number of lines in each field restricts the vertical resolution. A PAL image contains about 560 visible lines. An NTSC image contains about 470 visible lines. These lines are divided over the two fields of each frame. Thus, per field, it’s 280 for PAL and 235 for NTSC.

It doesn’t make sense to use a higher resolution in the vertical direction than in the horizontal direction. (Remember that the horizontal resolution is 135 pixels per line.) Using two video lines per pixel in the vertical direction gives a vertical resolution of 140 for PAL and 117 for NTSC, which roughly corresponds with the horizontal resolution. (In an ideal situation, you’d have square pixels, but this is close enough.) To be on the safe side (a television set might clip some more from the top and bottom), I restricted the area dedicated for output to the center 240 image lines for PAL and 200 image lines for NTSC. This resulted in a resolution of 135 × 120 for PAL and 135 × 100 for NTSC.