1
\$\begingroup\$

Here is the module I am looking at: 1.8" Serial 128X160 SPI TFT LCD Module Display + PCB Adapter with SD Socket

So my question is, is there any way I could convert a video signal from a composite source (i.e. DVD player, game console, etc.) to something which this module could process and display correctly?

Or if you have any other suggestions for a similar sized display which can easily interface (or be made to interface) with a composite video source, please let me know.

Thank you.

\$\endgroup\$
7
\$\begingroup\$

This is going to be an extremely tedious project to get working.

Here's how to do it, though:

  1. Sample the composite video signal at 5.5 MHz (the bandwidth of composite video) using a high-bandwidth ADC.
  2. Look for the line sync pulse. Once you've got that, you have a line of video in your buffer.
  3. Looking in your buffer, find the colorburst section of the data. This will let you split up the data into the two parts (luminance and chrominance)
  4. Since your LCD is a 160 pixels long, bin the luminance signal into 160 bins.
  5. Average each bin's value. This is the value of the luminance at that pixel.
  6. The color burst is going to be tricky. You're going to need to demodulate the quadrature encoded signal into the two color signals by looking at the phase differences of the signals. That's going to be some hardcore DSP. Once you're done with that, you have your two extracted color signals.
  7. Repeat the binning process for the first extracted color signal. This is your Cb signal.
  8. Repeat the binning process for the second extracted color signal (the one that's quadrature-encoded). This is your Cr signal.
  9. Repeat this process for each line of video until you get to the end of the field.
  10. Now, you need to repeat this for the next field. Remember that NTSC composite sends video interlaced, and not progressive.
  11. After this is done, you should have an array of CIE YCbCr values that is 160 pixels wide by about 525 lines tall.
  12. You need to compress the lines of video down to 128 (the height of the display). Average over the vertical column in your pixel array to find the separate Y, Cb, and Cr values for each pixel.
  13. Since your display uses RGB instead of CIE YPbPr, you'll need to convert each pixel to RGB. There's fixed-point formulas available that are optimal for doing it on a computer.
  14. As soon as you've got the RGB array, you'll need to write the data out to the display using the SPI interface. The display will have a protocol that explains how to write data to it.

Pitfalls

  • By averaging and binning the pixels without doing bicubic or any other sort of smart sampling, you're going to get terrible aliasing that makes the video look jaggedy and weird.

  • Since it's doubtful that your SPI clock is fast enough to write data to the display fast enough, you'll experience dropped frames. You'll need to ensure your controller can deal with that.

Other ideas

Don't reinvent the wheel. eBay sells a ton of wearable displays (with small screens) with composite inputs. I'd start with something like that and hack it to fit your application. Just remember to remove the optic in front of the piece that throws the image further away to make it easier for your eye to focus on (unless you want that, that is...)

\$\endgroup\$
1
  • \$\begingroup\$ Super response, thanks Jay. That does seem complicated, at least for an amateur like me. Actually, you explained the process extremely well, I just haven't the foggiest about how I would implement your steps. I will re-read it a few more times to see if I can absorb anything else. Regarding the wearable displays, they are extremely expensive, especially to tear apart. I don't think it would be worth it - unless you know of any cheap models (do you?). Thanks again. \$\endgroup\$
    – capcom
    Sep 24 '12 at 2:06
2
\$\begingroup\$

This particular panel has a digital (SPI) interface, which means that you'd need to digitize the composite video signal, down-sample and format the pixels before sending them to the panel. If you need 8 bits per pixel, you'd have to sustain an effective throughput of 614.4 kB/s for full-speed video (30 fps).

You'll be better off looking for a panel that accepts composite video directly. The controller for such a panel has these functions built into it.

ADDITIONAL:

If you really want to try to do this with this display, I would recommend getting something like the BF561 EZKIT from Analog Devices. This board includes a chip that can digitize the composite video for you and convert it into RGB data. It also includes a powerful DSP chip (the dual-core ADSP-BF561 "Blackfin" processor) that has more than enough horsepower to scale the image down from NTSC resolution to the 160×128 that the panel needs. It also has a high-speed SPI controller that can communicate with the panel. The only hardware development you'd need to do is to get the two boards correctly wired to each other.

On the software side, you need to accomplish two basic tasks: get the video scaled correctly and then pump the data out to the panel through the SPI interface. ADI has lots of code examples for both of these tasks that will help get you started.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks, David. Do you know where I can find more details about the process you mentioned? I tried Googling my question, but couldn't come up with anything - which makes me think that what I am doing is illogical, or I am searching incorrect keywords. Regarding the panel that accepts composite video directly, I couldn't find one which is around 1.5 - 2.0" in screen size. Do you know of any? \$\endgroup\$
    – capcom
    Sep 23 '12 at 18:16
  • \$\begingroup\$ No, I know of larger ones (I've used them before) in the 5" and up range, but not that small. There are smaller ones (<1") used as viewfinders for video cameras and in virtual reality goggles. These are used in conjunction with lenses to make the image look larger. \$\endgroup\$
    – Dave Tweed
    Sep 23 '12 at 20:04
  • \$\begingroup\$ Note that IIRC, the IC used in this display has an 18-bit standard datachunk, whether it's set to 8, 16 or 24 bit colour. I think the maximum fps works out to less than 10 (given max SPI speed), check for yourself though. \$\endgroup\$
    – Oli Glaser
    Sep 24 '12 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.