# How to generate a composite video

I am working on a project that will output either NTSC or PAL video.

The video is mainly text (color and Hebrew text) on top of a background image (that I need to download to the microcontroller).

The board has a UART input and a PAL/NTSC output and according to the UART input different text is displayed (very slow rate).

If it wasn't for the background requirement I would probably try to implement the many hobby projects using a resistor ladder to output composite video using a simple microcontroller but that is not an option.

I did not find much information on making a cheap and relatively easy solution on the internet so what components would you recommend for this circuit?

• In old CRT TVs you can find a teletext decoder that also takes care of OSD. Some have I2C or SPI interface and output RGB video. Example SAA5281 May 21, 2014 at 9:02
• Thank you cornelius but it is for production May 21, 2014 at 9:09
• People have generated PAL/NTSC video in software on PIC and Arduino, search Hackaday.com for projects doing that. The MAX7456 IC can do mono OSD over colour PAL/NTSC video if that helps. May 21, 2014 at 10:39
• Thank you John but the background requirement obligates me for higher resolution solution and more colors. the hobby solutions is limited to about 8 colors at most! May 21, 2014 at 10:56
• Some clarification, please. When you say "NTSC or PAL", are you talking about honest-to-god composite video which is carried on a single output (like coax)? Or are you talking about NTSC/PAL timing, with composite sync on one wire and 3 separate RGB channels? In other words, what sort of display are you talking about driving? May 21, 2014 at 13:10

## 2 Answers

Actually, using a suitable micro you could get 12-bit colour and reasonable resolution.

For example, the STM32F407 has two 12-bit DAC's that can be continuously loaded by DMA to generate composite video. Allocate a section of RAM (it has 200kB) to be a frame buffer, fire up the DAC and DMA and off you go - reasonable video from an MCU for zero CPU cycles. You can get an STM32F4Discovery board for US$15, including an on-board debugger, and the free Coocox IDE is pretty reasonable for what you pay. For another$45 or so you can add a base board with an Ethernet port and an SD socket for image upload.

Just a thought.

• I don't beleive it will work. I tried doing the same with an STM32F105. the DAC is way too slow and the DMA M2M option takes about 10 cycles for each load. also to produce X colors it seems i need 3.58*X MHZ so if the DMA in the M2M takes 10 cycles i would need to work at 3.58*10*X for X colors May 21, 2014 at 12:13
• Sure, the DAC's not overly fast; so, use an 8-bit R2R DAC, or an external parallel DAC, and feed it using DMA. I'm not sure where you're getting the X in your calcs from; even at 10 clocks per update, with a 168MHz CPU clock the update rate should be 16.8MHz (although I doubt the R2R could work that fast). May 21, 2014 at 12:42
• @user43161 You might look into using an FPGA instead of a microcontroller. May 21, 2014 at 13:15

The answer is to use a DA video encoder that supports PAL/NTSC.

the encoder converts parallel digital inputs (e.g. 10 bits) to composite signal

for example the: ADV7393