NTSC Video Out With The Papilio One

video_out_with_the_papilio_one

[Ben Leperchey] is working on building a Sega Master System clone using the Papilio One FPGA board, and although his ultimate goal has yet to be reached, he’s bringing some great stuff to the table in the meantime.

One component that is necessary for any sort of game system clone is NTSC/PAL video output, naturally. Since no one had constructed a TV output “Wing” (The Papilio One’s version of a shield or breakout board), [Ben] went and did it on his own. Using only 14 resistors and a low-pass audio filter, he was able to get the video output he was looking for with relatively little trouble. His VHDL code running on the Papilio does all the hard work of creating the video signal, while the wing he designed mostly handles the connectivity.

This is one of the first few projects/components we’ve seen come out of the Papilio camp, and it looks like things are off to a good start. We can’t wait to see the Master System implementation once it has been wrapped up!

Continue reading to see a quick video demonstration of the Papilio One and [Ben’s] TV output wing.

[youtube=http://www.youtube.com/watch?v=f9I8JYqx2YY&w=470]

13 thoughts on “NTSC Video Out With The Papilio One

  1. Colour NTSC and PAL, that’s pretty impressive, especially from a pure digital source. Usually external colour carriers are used. No wonder it requires a 64MHz clock.

  2. @o the resistors do have to be accurate, and also you should have an opamp if there is going to be any load/resistance on the output stage, otherwise that affects the R2R. the opamp can also be used to help with the tail off that a R2R usually has, by increasing the output voltage.

  3. that is amazingly tough, and very impressive. For color NTSC, you need to be able to create a 3.45MHz sine, of variable amplitude, and, the tricky part with pure A-to-D, variable phase.

    For example: you would need at least a 7MHz clock to create a sine output at 3.45MHz, and then you would not be able to adjust the phase at all, at least not without the amplitude getting wildly off. Each time you double that clock, you can get twice as many phases available, with less amplitude error for in-between phases. This circuit can still only create 8 different phases at exactly the intended amplitude, but in-between phases are probably not all that far off anymore.

  4. hi all,

    glad you enjoy it.

    @o @charliex : no, the precision is not that important, as it affects the relative brightness/saturation of colors but not hue, so the image doesn’t look too bad. you have to choose the correct value though (115 ohms for 3.3V digital output) to match the TV input impedance — otherwise you would indeed need an amplifier. BTW, a regular opamp cannot be used, as it would filter out the color carrier.

    @tyco: the phase shift was the solution I went for at first, but you pointed out its major drawback perfectly. I use an equivalent phase/quadrature modulation: it is much easier and it ‘only’ require a 4x clock with little extra some math. The high clock rate (64MHz) clock is needed to get a precise approximation of the NTSC (or PAL) color carrier. I could theoretically produce any number of colors, although the various noises create too much artefacts to see them well : the demo uses a 64 color palette (2 bit RGB)

  5. @ben: maybe you could consider getting rid of the RGB palette altogether, and just having the palette be direct YUV, maybe 3-bit instead of 2-bit. This would let you ditch the small rom you’re making to create a lookup table in the FPGA. AFAIK, this is pretty much how the NES works.

  6. @tyco i use a ‘palette’ to convert rgb to yuv, because the sega master system speaks in rgb. you could of course get rid of this lookup table if you chose to use yuv natively. even the nes doesn’t, though: it uses ysh (the polar coordinates), if i remember well.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.