Black and white NTSC is simple – it can, and was, done with vacuum tubes for a long, long time. Color is just weird, though. It runs at 29.976 frames per second, uses different phases of the carrier for different colors, and generally takes a while to wrap your head around. [Sagar] is doing a series on the intricacies of NTSC, and the latest post deals with color and progressive scanning versus interlacing, or as it is better known, how classic game consoles and home computers generate video.
The test bed for [Sagar]’s video experimentations is a circuit containing an ATMega16, a 4-bit shift register, and a 14.31818 MHz clock. This clock is much faster than the 3.579545 MHz clock in an NTSC carrier frequency – exactly four times as fast – allowing the shift register to output four different phases of the carrier frequency a 0°, 90°. 180°, and 270°. Playing with some of the pins on the ATMega in the circuit results in a palette being generated on any old TV.
NTSC requires interlaced scanning, or sending an entire screen of even lines, then an entire screen of odd lines, at around 60 fields per second. The Nintendos and Segas of yesteryear didn’t bother with this, instead opting to send half the vertical resolution at double the frame rate. This is known as a progressive scan. [Sagar] found that this resulted in some image artifacts when displayed on a modern LCD, and moving back to an interlaced mode fixed the problem. All the code and files are up on the gits. If you’re feeling adventurous, this is exactly how projects like the Uzebox have created homebrew game consoles using little more than the ATMega found in [Sagar]’s build.
(Many TVs also did color with tubes.)
Surely NTSC ran at 60/30 FPS?
The original B&W NTSC standard used 30 fps, when colour came in it was changed to 29.970 for technical reasons yet still be compatible with B&W.
Ye Olde Monochrome NTSC (and PAL) needed a clock frequency to time the field rate. The cheapest way to do it was to use the frequency of the incoming alternating current power.
Why Color NTSC (not Colour ’cause it’s American) went to 29.976 was for a couple of reasons. First was with the analog equipment and vacuum tubes that had pretty wide variances as temperature changed, there was not enough bandwidth in a channel to squeeze the chroma signal in.
Second was more accurate timing was required. AC line frequency has never been describable as a rock solid reference.
The third reason was avoiding harmonic interference showing up in the video from other devices on the same circuit or from the AC line the TV was plugged into.
The key to color was designing a vacuum tube timer circuit that could fit into a television receiver AND be affordable.
NTSC first got color in 1953 but it wasn’t until the mid 60’s that it really took off. There was little color programming in the USA until 1965 when about half of the shows went to color. IIRC NBC went 100% color in 1966 (except for reruns of course) and by 1967 ABC and CBS went all color too.
When transistors came along and by the early 70’s had booted vacuum tubes out of television (aside from the display itself), it was possible to make the TV transmission ‘tighter’ so it didn’t need so much bandwidth.
But there was that huge installed base of old TVs and transmitters and maintaining backwards compatibility, so while new transmitting equipment was most likely more efficient, expansions to NTSC couldn’t be made until the majority of transmitting end equipment had been upgraded. That’s when NTSC got stereo audio, and from there not much* changed until the early 21st century when analog NTSC was booted out for digital ATSC, chosen by the FCC over competitors that provided higher resolution while still maintaining full NTSC analog compatibility.
*Closed captioning and other things like (unfortunately) Macrovision got shoehorned into space that had always existed in the signal from the early years, the Vertical Blanking Interval. Aside from captioning, and copy protection on video tapes and DVDs, nothing else using VBI data took off in the USA. In some countries in Europe one-way Teletext services were fairly popular until the wide adoption of internet and WWW service.
In Canada it’s NTSC and Colour, good explanation though.
Nice explanation. Thanks, man.
NTSC is ~29.970 fps (30000/1001). The field rate is 59.940 (60000/1001). The rates you supplied would be correct if you are targeting 24fps originated footage for NTSC (via the 3:2 pulldown process).
That non integral frame rate is a real pain in some places nowadays. They really should have abandoned it (round it off) the day they went digital.
I wish I could upvote this comment. Fractional frame rates and interlaced video are things we should have let die a long, long time ago. At least we’ve got square pixels now…
That’s because a huge part of the world (read USA) don’t want to do it like the rest of the world.
When they do it will be way easy.
Analogue TV didn’t really have pixels, as I understand it, just lines.
And interlaced video formats should nowadays only be used as containers for progressive video. Not the silly “half of one frame and the other half of the next” that was a necessary evil back in the days.
Civilized world used PAL or SECAM.
/thread
Japan is civilized…
I make a statement that is is based on personal experience
You don’t have much experience?
Civilized world uses digital.
I said USED you tool.
In Soviet Russia, world civilizes you! (thank goodness, b/c you could use it!)
civilized world uses h.264 encoding
Possibly worth noting if you want to use a CPU to play with video signals, the Parallax Propeller was designed from the ground up with a video generator designed to bit-bang both NTSC and VGA signals. The rather coarse selection of digital phase shifts available limits the NTSC color output in interesting ways.
I agree, The Propeller is excellent at producing both VGA and NTSC/PAL video.
I have seen some remarkable video of the Props abilities in this area.
Nice open-sorce solutions exist so that it takes very little effort to use video out on a Prop…even for a newbie. What is nice is that there are so many old VGA and NTSC monitors available free for the asking….a great opportunity for hobbyists…
Please?
I did color composite NTSC on the ATmega with just 2 resistors.
Its not that difficult.
Awesome. B&W made intuitive sense but I never understood how color was done. Cool post.
Yep NTSC is fun to play around with. Great article with lots of detail.
“up on the gits” <- either trolling or a complete lack of understanding what git or github are.
If you troll in the writeup, why wouldn't you expect the commenters to troll you right back?
Because commenters are plain stupid?
Not all jokes are trolling, you spaz.
Now if only there was an easy way to de-progressive an old game console and make it into true 480i rather than 240p, maybe my Atari 2600 would work on LCD TV. Right now on my 32″ it displays weird like the TV’s circuitry blanks out even field because it never got the proper 1/2 line at the end of odd field. So I get full screen comb effect on Atari 2600 games. On a smaller 19″, it only works if I turn on the system first, then turn on the TV and pray it is still set to analog channel 3. Otherwise it’d display no signal. Only on my portable 7″ TV my Atari 2600 (via AV mod) displays fully with no noticeable artifact. The portable TV has only ATSC tuner so I can’t keep the 100′ long RF cable to trip fools (not that it matters, 7″ is pretty small to try and play from 100′ away)
If you have a picture when you connect it, live with it.
Otherwise do something about it.
Probably easier to emulate the whole thing in a FPGA than to try to fix the video.
There are plenty of FPGA eval board around these days.
http://hackaday.com/2010/09/15/atari-2600-recreated-in-an-fpga/
The Uzebox doesn’t use this method to create colors; it offloads the phase stuff to a dedicated chip, the AD725. This (what’s described by the linked article) is even more hard-core though, and interesting to learn from!
Funny, 4 bits is actually how the Apple II generated 16 colors in DHR (Double Hi-Res) mode. All of the colors in high-res modes are simply caused by the monochrome signal changing frequently enough that it gets pushed up into the portion of the band reserved for the color signal in composite video.
This image from DazzleDraw on the Apple II was generated by my NTSC post-processing shader from a purely monochrome image generated by MESS: http://i.imgur.com/SLpnxBc.jpg
The shader takes the output image from the emulator, encodes it into a composite NTSC signal at 4x the horizontal resolution by packing 4 samples into each pixel, and then decodes it from composite back to YIQ and then RGB using a second pass.
Hm, that’s a nice bit of work. Have you written it up?
What video mode were you “emulating” with your filter? How many colours etc? I’d like to see before and after shots. Have you submitted your work to MESS? Or maybe some other emulators?
I dunno if DOSBOX supports it, but many old CGA games took advantage of IBM’s cheap choice of video encoder chip. By putting certain pixels next to each other, you could produce lots of extra colours from the 4 that CGA graphics was stuck with. Only worked if you used a composite monitor on the matching connector, digital RGBI monitors were stuck with the bloody awful, what-were-they-thinking, palette of black, white, magenta and cyan (eeurgh!).
That’s why, if you ever played old CGA games, so many of them used vertical stripes so much, they showed up as extra colours on composite.
If DOSBOX doesn’t support it, or even if it does, your work would very probably find a grateful home in there.
http://en.wikipedia.org/wiki/Color_Graphics_Adapter
This page here mentions the composite colour “trick”. It’s similar to the Apple one, or “artifacting” on the Atari 8-bits.
NTSC demystified by deviating as far from the standard as your TV will let you get away with.
I did it in a 320×200 resolution on an ATmega1284 with nothing but 2 resistors and a 14.318 crystal.
https://www.hackster.io/janost/avr-videoblaster
No problems at all.
And you only got four colors out of it, including black. This is a much more functionally useful build.