Re: TV Pattern Generator
I can't help you with the program but I can explain the principle:
TV pictures are made of horizontal lines, starting at the left side, finishing on the right side and moving down slightly from top to bottom of the picture before starting at the top again. Each point along the line has a brightness associated with it, the changes in brightness as the picture is scanned, taking into account our persistence of vision, makes up the image we see.
Hidden from view is some more information, called sync pulses. These are not visible, in fact they are off the edges of the screen but they are necessary to ensure the horizontal and vertical scans start at exactly the right time.
What your software has to do is simulate these sync signals and a voltage to represent the brightness of the squares in your "chequer-board". The squares are easy, white can be a logic high and black a logic zero so all you have to do is make sure the signal changes at the right time. The syncs are also easy and because the TV locks to them, you don't have to make them too precise. The actual timing depends on which TV system you are using, it is slightly different between PAL/SECAM and NTSC systems. There is a very good explanation here:
http://www.batsocks.co.uk/readme/video_timing.htm
So your software has to do something like this:
1. create long vertical sync pulses
2. create horizontal sync pulse,
3. create square wave so you get alternating white then black pixels
4. go back to step 2 for as many times as you need to set the square height
5. create horizontal sync pulse
6. create square wave so you get alternating black then white pixels
7. go back to step 5 for as many times as you did in step 4 (so the height is the same)
8. go back to step 1.
I have ignored 'interlacing' in the example above as it isn't strictly necessary for your task. If you want to introduce it to give a sharper picture, you have to alter the vertical sync width each time you pass step 1 so that alternate scans are half of one line displaced.
For the analog side of things, threat syncs as zero volts, black as 0.3V and white as 1V. Again there are slight differences in these between TV systems but using those voltages will work just about everywhere. If you make the sync come out of one port pin and the video out of another, you can set these voltages with a simple resistor network.
I did something similar at this web page:
http://www.atv-projects.com/50p_SPG.html
Note that this produces syncs but not a 'chequer-board', however it does use intelacing, hence the different field (vertical scan) waveforms.
Brian.
Added after 31 minutes:
Looking at the link IanP sent - I would be very tempted to correct the odd phase shift with an LC network in the video 'DAC' to bring it back to normal RGB bars !
Brian.