Interfacing with an NTSC TV

Rough outline of hi-res

The original Pong video used the low 2 bits of a 38 wide by 14 high array.

medium res demo used the low 4 bits (2 at a time) of a 37 by 16 arrray. Uses two copies of the 2 resistor D2A converter but only ONE D2A converter is really active at any time. By bit masking the for loop index, we step through the array twice. The first time we enable the low two bits (0-1) of PORTC using the DDRC command. The second time we enable the bits (2-3 ) using DDRC. The DDRC command is a single and runs after each scan line so you dont get jitter halfway down the screen.

High Res (proposal)
Eliminate the grey tone. Black and white only. Instead of two copies of a 2 bit D2A, we use 4 (or8) one bit D2A converters (330 ohm resistor). If you use all 8 this ties up all 8 bits of PORTB. We use one bit from another port to drive a 1K resistor to get "black level" when all 9 bits go low that is blacker than black.

Finally we make the frame buffer roughly 60 bytes wide by 8 bytes high and loop through it 8 times (4 for square pixels) enable a different bit each time with DDRC. The loop logic is REALLY funky, but you can see it work in the medium res demo.

The big problems are

  1. If you use all 8 bits of PORTB you loose hardware serial (could reduce vertical res and use a 6 bit port - needs thought here)
  2. the DDRC mask logic has to take a constant amount of time. Currently its an if/else but 4 or 8 options is hard to make constant time.
  3. The logic for looping through the array multiple times is a bit confusing (well REALLY confusing).
  4. it might be better to use only the low 4 bits and keep the high 4 for a working copy of the bitmap (thats how medium res works). 4 line pixels vs 8 line pixels depending on how you count it.
  5. Sync line ties up another digital out line.
  6. All the Pong type video programs depend let horizontal sync drift during the vertical sync period, it works but causes that top of the screen jitter. Looks like you keep sync tighter in Batsocks????