Jump to content
Sign in to follow this  
DaveThomasPilot

Composite Video Confusion

Recommended Posts

I haven't done much with video, so maybe someone could shed light on the composite video waveforms I'm seeing on my oscope.

I'm trying to generate a composite sync output like the LM1881 Mr. RC-CAM is using for his AI. Yeah, I could just use the LM1881, but I'm trying to implement the sync generation function in hardware in a Cypress PSOC.

It seems like it should be easy--just set a comparator threshold 70 mv "blacker than black". Only the sync tips should cross the comparator threshold so the output of the comparator is the composite sync waveform.

Problem is, the waveform doesn't seem to transition below the "blacker than black" threshold on each horizontal line.

I'm using a Tektronix 2215 which has a "TV field" sync. I can sync up with the composite video and clearly see the vertical blanking intervals about every 17 msec. If I cover the lens of the camera, I see -60 mV pulses about every 17 msec. The video portion of the waveform looks like a sawtooth with spikes. The sawtooth is about 5 mV PP with another 5 mV "spike" at the beginning of each tooth. So I can see a threshold that would generate the desired composite sync waveform (although it would have to be set very accurately).

When I uncover the lens, the sawtooth waveform becomes much bigger in amplitude (as expected). It's about 30 mV PP. But neither the top or the bottom of the waveform remains at a constant voltage. The most negative portion of the sawtooth waveform varies from +45 mV to -45 mV from one vertical blanking interval to the next--there is not a constant comparator threshold that could be used to recover a composite sync waveform.

I'm terminating the video into a 75 ohm resistor.

It's as if the video waveform is AC coupled or there is some lower frequency component on which the video is riding. I've tried my Sony HandyCam video output and a Panasonic camera output with similar results.

Maybe my scope is lying to me?

The LM1881 spec has some words that may be a clue:

Normally the signal source for the LM1881 is assumed to be

clean and relatively noise-free, but some sources may have

excessive video peaking, causing high frequency video and

chroma components to extend below the black level reference...

A clean composite sync signal can

be generated from these sources by filtering the input signal.

When the source impedance is low, typically 75Ω, a 620Ω

resistor in series with the source and a 510 pF capacitor to

ground will form a low pass filter with a corner frequency of

500 kHz. This bandwidth is more than sufficient to pass the

sync pulse portion of the waveform; however, any subcarrier

content in the signal will be attenuated by almost 18 db...

Maybe I need this filter? Mr. RC-Cam, are you using this filter on your AI?

Share this post


Link to post
Share on other sites
It's as if the video waveform is AC coupled or there is some lower frequency component on which the video is riding.

Yes, the video source is AC coupled, at least it should be (composite video signals are rarely DC coupled). At this point you are probably driving your PSOC'a analog input below ground. Everything must shift up.

Some sources are not natively AC coupled at their output and will contribute a nasty DC offset that will drive a simple video input's front-end nuts. The circuit must observe an AC source, so your hardware input should just AC couple at the get-go.

The problem with just picking a fixed threshold for the various video levels is that in the real world there are sources that violate the NTSC and RS-170 standards. You need to outsmart these little devils by implementing a very forgiving design. If your design is for a known video source then you can design it to work well for it and forget about all the ugly stuff that is out there.

Mr. RC-Cam, are you using this filter on your AI?

I am using the standard filter as a course of habit. You are not at a point where the filter will have any serious effect (that comes later when you are at the pixel level). But, adding the extra R and C now is not a bad idea since some video sources can be pretty dirty. BTW, the typical video board cameras, on a short cable, are usually decent noise-free sources.

Good luck. Video projects are a great way to burn a lot of free time up. ;)

Share this post


Link to post
Share on other sites

Thanks for the reply, Mr. RC-CAM.

Actually, I'm not even using the PSOC yet. I'm just looking at the waveform on the scope.

The problem with just picking a fixed threshold for the various video levels is that in the real world there are sources that violate the NTSC and RS-170 standards. You need to outsmart these little devils by implementing a very forgiving design.

From what I read from its spec, the LM1881 appears to use a fixed threshold 1.5 - 70 mV, right?

I was just going to implement the clamp and comparator like is done on the LM1881. But with the waveforms I'm seeing, I don't think it would work, even if the waveform is DC blocked and biased to a more positive voltage. The "sync tips" ride on top of some lower frequency signal that will prevent a fixed threshold comparator from effectively recovering the composite sync signal.

I'm going to try looking at the signal on a different scope (at work) and I'll implement the single pole RC filter. Perhaps the filter will eliminate the problematic modulation of the video waveform. Also, I'll order an LM1881 and verify it handles the composite video (need a better trigger generator anyway).

Dave Thomas

Share this post


Link to post
Share on other sites

The bottom of the sync tips should be the most negative signal on your scope. Timing wise, directly after the H-syncs is the color burst ref. It should not be the culprit since it will ride at a slightly higher level. But, if it is (some video sources are goofy) then the filter will fix you up in a jiffy. And for sure the LM1881 will make an excellent video trigger for your scope, something that is helpful for debugging.

Edited by Mr.RC-Cam

Share this post


Link to post
Share on other sites

Well, I got the LM1881 in the circuit--the waveform looks the same as before. Can't see how the circuit documented in the LM1881 spec would generate the composite sync waveform.

The sync tips are the the most negative signal on the scope--clamped to 1.5V by the LM1881.

I'm getting the vertical pulse and the even/odd field pulse output O.K, but (not surprisingly given what the video input looks like), the composite sync is not what I'd expect from looking at the LM1881 spec.

Basically, I see just what I'd expect from a comparator with a threshold set slightly above the 1.5V clamp voltage. The horizontal sync pulses don't cross this threshold (on the negative side), so the composite sync does not have the horizontal pulses.

Haven't tried my Panasonic camera as the video source yet, just the Sony Handycam video output. But, given that both composite video waveforms looked similar, I don't expect anything different with the camera as the video source.

Mr. RC-CAM, do you use the composite sync, or do you just start timing from the vertical pulse or field output?

Dave Thomas

Share this post


Link to post
Share on other sites

I use the composite output. It is needed to allow the PIC to sync to each horiz line.

Share this post


Link to post
Share on other sites

Turns out there must be something wrong with my scope. I used the scope at work, and everything looks good--I'm getting a valid composite sync signal that incudes the horizontal sync pulses.

The H-sync pulses are about 4 usec wide, so my 60 Mhz scope SHOULD easily have sufficient slew rate to see the pulses. I tried both oscope vertical input channels and each appear to be slew rate limited. I wouldn't expect much common circuitry between the vertical amps, so maybe I have a bad probe (I only had one available).

Anyway, I now have to figure out why my o-scope seems to be such a dog--the LM1881 and PSOC work fine for extracting sync.

Dave

Share this post


Link to post
Share on other sites

Bad scope probe.

Borrowed scope probe from work, now all looks good on my scope.

Funny, don't see how a probe could fail this way--amplitude is correct in both 1X and 10X modes but it is very slow or capacitively loads the video input.

Dave Thomas

Share this post


Link to post
Share on other sites

I've repaired a lot of Tek scope probes in my travels. The failures are usually one of three items: Bad probe tip (compensation network), broken gnd wire, or bad scope lead.

If your probe is a Tek series, then the replacement parts are expensive. For example, the little disposable tip cartridges cost me about $45 each. But these probes are usually worth salvaging.

Share this post


Link to post
Share on other sites

Thanks, Mr. RC-Cam.

This probe is a "Probe Master" PM4901. It's labelled as a 150 Mhz probe. Got it with the scope at a Hamfest.

A buddy also says it should be trivial to fix, so maybe I'll get around to buggin it.

Pretty simple, though as I'm looking at it now. It looks like the base only has a resistor pot and a capacitive trimmer. Only the resistor pot is accessable when the housing is on the base.

Can't see much a the tip, other than the center wire solder connection (looks good). There is a three position switch (10X, gnd, 1X), but I can't figure out how to remove its housing (in the probe tip) or if it's even possible.

Anyway, the probe works fine as long as you don't want to watch something with a slew rate greater than a couple of volts per microsecond. I've used it a lot on audio frequency work with no problems. Doesn't hack it for video, at least not for trying to observe the 4 usec H-sync pulses.

Dave Thomas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×