Hello!
Recently I've been tinkering with Arduinocade and having a go at writing my own implementation. I've done a lot of research into how NTSC works and feel I've got a good understanding. Of course, being similar to a retro console or retrocomputer, Arduinocade doesn't implement the NTSC specification to the letter; it only uses one field (so 240p60hz), doesn't include equalization pulses, doesn't adjust timing for VSYNC lines (they're single-pulse normal length lines rather than double-pulse 64usec lines) and uses artifact colors rather than generating real sine waves at 3.7MHz. This works fine though.
I've been configuring my AVR to produce a NTSC signal based on this diagram from Maxim (from
https://www.maximintegrated.com/en/design/technical-documents/tutorials/7/734.html#Composite%2FCVBS%20Interface):
My understanding here is that the line should be 63.5usec long, and the colorburst should begin 5.3usec after the falling edge of the HSYNC pulse.
When I generate a signal using the closest available approximations of these values, my test displays (a car reversing camera display with composite input, and a USB capture card; will have access to a real CRT from next week) don't seem to get a good vertical hold lock and the signal is interpreted as greyscale. I have verified that the program is producing the expected signal timing using a pocket DSO.
I will note here that I'm having trouble with voltage drop on the breadboard I'm using for prototyping; it's about 0.5V below the target 5V at the IC. I've tried using a power bank as a substitute power supply but its output was noisy and well above 5V at the low current draw this circuit has. I've got some PCBs on the way in 2-3 weeks which should resolve this.
Looking at the source for Arduinocade (
https://github.com/rossumur/Arduinocade/blob/e2ad97f164a6c520ea146478839cc6cd9102cb54/video.cpp#L41), lines are actually 63.7303003530484usec, and the colorburst begins at 6.2usec (TICKS_HBLANK).
If I plug these values into my program I get a good stable picture, which is great, but I'd like to understand
why these specific timings (which don't seem right) seem to work. Have they been adjusted slightly to compensate for some of the NTSC specification simplifications mentioned at the start? Or is it more likely that voltage drop is the real culprit, and it is coincidence that these adjusted timings seem to work?
Thanks.