THP Entry: A CPLD Video Card With VGA And NTSC

NTSC

[PK] is working on a very simple video card, meant to output 640×480 VGA with a cheap CPLD. The interface will be 5 Volt SPI, meaning there’s a ton of potential here for anyone wanting put a reasonable (and cheap) display in a microcontroller project. The project has come a long way, and his latest update showcases something that has only been done once before: color NTSC with programmable logic

The brains of the outfit is a $5, 100-pin CPLD from Xilinx. Apart from that, the rest of the components are a crystal, PLL, and an almost hilarious number of resistors for the R2R ladder. The one especially unique component is the 25.056815 MHz crystal – multiply by that by two, and it’s fast enough to drive a VGA monitor. Divide the crystal by seven, it’s the 3.579545 MHz you need for an NTSC colorburst frequency. That’s VGA and NTSC in a single programmable logic project, something the one FPGA project we could find that did color NTSC couldn’t manage.

The next step in the project is designing a PCB and figuring out the code for the framebuffer. [PK] put up a demo showing off both VGA and NTSC; you can check that out below.


SpaceWrencherThe project featured in this post is an entry in The Hackaday Prize. Build something awesome and win a trip to space or hundreds of other prizes.

[Read more...]

Demystifying NTSC Color And Progressive Scan

NTSC

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.

A Video Vectorscope Oscilloclock

Tek 520A Oscilloclock

Back in the days of analog TV, vectorscopes were used to view video signals. [Aaron] has taken an old Tek 520A NTSC vectorscope and converted it into his newest oscilloclock.

The scope was originally designed to look at the signal provided by composite video. It draws vectors on a polar plot. By using test patterns such as color bars, you can ensure equipment is creating the correct color output. These scopes were so commonly used that many digital systems still provide a simulated vectorscope for color analysis. Vectorscopes were designed to be left on constantly, which is a good quality for a clock.

[Aaron] has a history of converting oscilloscopes into clocks, which we have featured in the past. This build is similar, using his custom control hardware to drive the display. Since analog vectorscopes are pretty much obsolete, you can find them on eBay at low prices, so these oscilloclocks could be relatively cheap to build.

In the write up, you get a teardown of the Tek 520A, showing the modifications made to build the clock. After the break, check out a video of the Tek 520A Oscilloclock.

[Read more...]

Anti-Tetris project is a study in hand tracking

anti-tetris

The game of Anti-Tetris is played by standing in front of a monitor and watch falling Tetris pieces overlaid on a video image of your body. Each hand is used to make pieces disappear so that they don’t stack up to the top of the screen. We don’t see this as the next big indie game. What we do see are some very interesting techniques for hand tracking.

An FPGA drives the game, using a camera as input. To track your hands the Cornell students figured out that YUV images show a specific range of skin tones which can be coded as a filter to direct cursor placement. But they needed a bit of a hack to get at those values. They patched into the camera circuit before the YUV is converted to RGB for the NTSC output.

Registering hand movement perpendicular to the screen is also a challenge that they faced. Because the hand location has already been established they were able to measure distance between the upper and lower boundaries. If that distance changes fast enough it is treated as an input, making the current block disappear.

[Read more...]

Color NTSC video directly from an AVR chip

color-ntsc-from-avr-chip

We’ve seen composite video out from AVR chips many times before. But we can’t remember coming across one that managed to produce a color signal. This project does just that, producing a color video signal from an ATmega168 without using external integrated circuits.

[CNLohr] is seen here showing off his accomplishment. You’ll remember him from the glass-slide PCB server project he’s been working on recently. This time around it’s a small piece of gaming hardware which he’s working on. But using four pins from the microcontroller, connected via resistors in parallel, he is able to generate a color NTSC signal without using a chip like the AD723.

After the break you can see the two minute demo in which he shows the game running for just an moment, then gives a general overview of how the signals are being built. There isn’t a ton of explanation, but he did post his code as well as a resource for you to teach yourself more about the NTSC standard. Maybe you can make a color version of that AVR tetris game?

[Read more...]

Hacking a PAL SNES to output 50Hz or 60Hz with a single switch

snes-pal-ntsc-mod

[Derecho] grabbed a PAL format Super Nintendo but wanted to make it play nicely with a 60 Hertz NTSC screen. His hack added a single switch to choose between 50 Hz and 60 Hz.

Take a look at the image above to see his alterations to the mainboard. The jumpers soldered to the two chips at the top are by far the trickiest part of the project. Each of the pins he soldered to needed to first be lifted from the PCB pad so that they no longer make contact with the etched traces. The technique he used involves heating the pin with an iron, then gently lifting it with a pin or a razor knife/blade. If you’ve got some experience populating SMD boards with a handheld iron this shouldn’t prove too difficult. The rest of the hack involves adding a 3-position switch (along with a 2k2 resistor) to choose between output modes based on what format game is being played.

Using an oscilloscope as a composite video adapter

Confronted with a monitor that would display neither HDMI signal, nor composite video, [Joonas Pihlajamaa] took on a rather unorthodox task of getting his oscilloscope to work as a composite video adapter. He’s using a PicoScope 2204 but any hardware that connects to a computer and has a C API should work. The trick is in how his code uses the API to interpret the signal.

The first thing to do is make sure the voltage levels used in the composite signal are within the tolerances of your scope. [Joonas] used his multimeter to measure the center pole of the RCA connector and found that the Raspberry Pi board puts out from 200 mV to 2V, well within the PicoScope’s specs. Next he started to analyze the signal. The horizontal sync is easy to find, and he ignored the color information — opting for a monochrome output to ease the coding process. The next big piece of the puzzle is to ascertain the vertical sync so that he knows where each frame starts. He got it working and made one last improvement to handle interlacing.

The proof of concept video after the break shows off the he did. It’s a bit fuzzy but that’s how composite video looks normally.

[Read more...]

Follow

Get every new post delivered to your Inbox.

Join 97,759 other followers