Generate PAL Colour video with microcontrollers - Page 1
Forum section: electronics / projects

author: bopstar
author_rank: Regular Contributor
timestamp: January 25, 2018, 12:09:21 am
content: I would like to know how to get an off the shelf microcontroller from Atmel or Microchip and generate a PAL colour video signal. and i don't care what people say "It cant be done" or "its to hard" because i know its not and i have dabbled with black and white video generation with the AtMega328-PU.

author: BrianHG
author_rank: Super Contributor
timestamp: January 25, 2018, 01:04:29 am
content: I've done full NTSC generator with an EPM7128/EPM7192 (pld) wired to a PIC and 4 resistors dac. Pal shouldn't be a problem either, but, the source clock crystal with tuning diode first went to the pld, then the pld sent it onto the MCU. It also had built in sync and subcarrier color locking genlock, debug standalone color OSD and overlay using a 74HC4053 analog switch, H&V interrupt generator for the MCU. It also generated the black level camping timing for it's graphics overlay.This is an old project from the early 2000s when the EPM7192 first became available. It was a cheap acceptable solution at the time. If your CPU is making a monochrome PAL signal already, with a few additional bits out into a cheaper PLD, you might be able to create a subcarrier burst and few simple colors if the CPU device can produce an RGB or better component color signal.

author: amyk
author_rank: Super Contributor
timestamp: January 25, 2018, 01:36:28 am
content: Doing it with an ATmega88:https://www.linusakesson.net/scene/phasor/

author: bopstar
author_rank: Regular Contributor
timestamp: January 25, 2018, 01:40:32 am
content: Thank you for your very helpful responses i will attempt the project that you linked as i have many atmega88 chips.Kind Regards,Bopstar

author: bopstar
author_rank: Regular Contributor
timestamp: January 25, 2018, 01:42:37 am
content: Thank you for your quick reply, i thank you for your idea on the use of these chips and will give it a goKind Regards,Bopstar

author: BrianHG
author_rank: Super Contributor
timestamp: January 25, 2018, 02:02:03 am
content: Quote from: amyk on January 25, 2018, 01:36:28 amHmmm, my old PIC circuit with PLD, which at the time, the PIC couldn't pass out a 3.579545MHz from the 14.31818/28.63636MHz source clock. I generated this inside the PLD with some of the horizontal window times & genlocking and fed a second buffered output 14/28MHz to the PIC's clk_in + 1 input for H&V interrupt. Basically the newer more capable ATmega88 is using an output of the source clock/4 to make the sub-carrier and 2 transistor mixer is doing a similar trick to construct the color video on top of a resistor dac for the main B&W.When I made my design back in 2000, the PIC was still too simple an 8 bit MCU to do anything like a /4 clock fed to an IO. As for my PIC video out mixing, the 4 resistors on the PLD made a 16 level DAC and the I made an in/out pin inverter crystal driver on the PLD with a 3 state output seeding a tuning diode making a sub-carrier color locked system when I wanted to super-impose a source NTSC signal.

author: ale500
author_rank: Frequent Contributor
timestamp: January 25, 2018, 05:35:21 am
content: You could also try a parallax propeller. Video output is one of its strengths ! AND both PAL & NTSC can be generated even simultaneously

author: humbug11
author_rank: Newbie
timestamp: January 25, 2018, 06:01:39 am
content: Quote from: BrianHG on January 25, 2018, 02:02:03 amCan you elaborate more on this? It sounds very interesting. I have looked into overlaying a color OSD onto a video but haven't figured out a good way to phase lock the signal to the color burstSent from my A0001 using Tapatalk

author: bopstar
author_rank: Regular Contributor
timestamp: January 25, 2018, 12:37:57 pm
content: well its good to hear your interested. you don't need to phase lock loop them as such just give them the same sync. let me explain.you have your camera feed (analog) that you wish to overlay things. you take that signal and put it through a chip called an LM1881 which you can get for free if your a student from TI's website as a sample. from that chip it separates the syncing signal which you can then add to the video generator as a sync reference which will allow both signals to have the same sync.P.S. The lm1881 needs a 5-12v input just keep that in mind if your planning on using this on a drone if not just for video experimentation like menote this is just a simple explanation of what to do. if you tell me what video generator circuit your using i can draw one up that will apply the same sync as the camera.Kind Regards,Justin Harris

author: BrianHG
author_rank: Super Contributor
timestamp: January 25, 2018, 05:12:33 pm
content: Quote from: bopstar on January 25, 2018, 12:37:57 pmYouneedto phase lock your color and the source video color subcarrier if you want to overlay a color on screen display which you are intending send out a new composite video signal. This method allows for a color overlay where you do not loose any quality of your source video at all, but, your overlay color may be slightly off and gets worse the more you saturate your overlay graphics if your source video has a weak chroma signal.You do not need to subcarrier lock if you are making a mono-chrome overlay, or operating inside a TV where you have access to overlaying on the RGB channel.If you color decode your source to YUV or RGB, then overlay there, only your standard color decoder needs it's built in subcarrier lock. After the overlay, your composite encoder will make it's own subcarrier. This overlay method has a lot more circuitry and your source video will suffer a color transcoding step back and forth.I would like to ask bopstar, in NTSC or PAL, if you were to super-impose, or genlock a COLOR graphics picture on-top of a composite video signal, and output a composite color picture of the 2 mixed video sources, how do you expect to have the right colors with the mix using nothing more than a simple CMOS analog switch and retain a lossless broadcast quality picture of the main source video signal?

author: BrianHG
author_rank: Super Contributor
timestamp: January 25, 2018, 05:28:14 pm
content: Quote from: humbug11 on January 25, 2018, 06:01:39 amYes I can, but:A) it is a little involved since instead of using a third party subcarrier clock locking IC, I did it the hard way, We are talking about using a MAX EPM7128 PLD with a home made 1 bit sampling algorithm to lock onto the color coming in filtered at the subcarrier frequency and used 2 output pins to tune the crystal. It's been 20 years, do you really want to go down this road? Simple analog color decoding ICs will lock their color crystal onto the subcarrier. Just use any one of them, amplify one of the crystal pins with a small transistor to feed your MCU+PLL it up a few x times on top of that, these color decoding ICs also have built in sync separator. All you don't need to do is use their cheap RGB output. Just look for old TV color decoding ICsB) For the hard way, I've done this for NTSC, not PAL, but it should be similar.

author: bopstar
author_rank: Regular Contributor
timestamp: January 26, 2018, 12:25:29 am
content: it was just a starting point not intended to "broadcast quality"

author: BrianHG
author_rank: Super Contributor
timestamp: January 27, 2018, 12:00:58 am
content: Quote from: bopstar on January 26, 2018, 12:25:29 amIt was just a point on how easy it is to pass a broadcast quality signal through, just superimpose some color graphics, and keep the main source video's spec perfectly lossless.But, you missed the point, when mixing color graphics on-top of a color video signal, you must have a locked chroma subcarrier signal, otherwise your color overlay's tint/hue will randomly modulate all over the place.This cannot be as easily done when trying to superimpose a color video signal ontop of an analog VCR signal if it is not time base corrected. The horizontal frequency alone randomly jumps all over the place due to the inaccuracies of the spinning video head. To mix video like this, your are better off using specifically designed ICs for this instead of just using a CMOS analog switch with 2 DC clamped video sources.

author: bopstar
author_rank: Regular Contributor
timestamp: January 27, 2018, 03:12:57 am
content: p.s. the LM1881 which is a Sync Pulse Separator can also provide a chroma/colour reference and black Porch which can be used to time the colour in the signal

author: BrianHG
author_rank: Super Contributor
timestamp: January 27, 2018, 05:06:26 am
content: Quote from: bopstar on January 27, 2018, 03:12:57 amCareful, that is a timed gated digital 0 to 1 pulse during just the color burst position. You can use it to engage your black level clamp and enable/disable you crystal's PLL circuitry's tuning loop. It is not a clock or carrier out.(NOT IMPORTANT) Also, this chip will mess up with Macrovision(TM) encoded video sources.

author: bopstar
author_rank: Regular Contributor
timestamp: January 27, 2018, 05:09:36 am
content: dose not happen to me

author: BrianHG
author_rank: Super Contributor
timestamp: January 27, 2018, 05:15:17 am
content: The macrovision comment was a joke. You would have to find an old movie studio release of a video tape, or output from a DVD player with the feature enabled on a movie to see such a signal.... Nothing you should run into today will have macrovision, though, I can always sell you one of my old video enhancers which removed the macrovision....

author: bopstar
author_rank: Regular Contributor
timestamp: January 27, 2018, 05:34:24 am
content: ill like the schematic for it if i could