how to use the backpack board to select between two video sources
Francisco
Posts: 26
I am using the propeller backpack board and need to switch between two video feeds so that only one is being used as the video source at a time. I was was wondering if anyone knew what I need to update so that any new pin assignment to to VIDIN will dynamically select the new video source as input. Thanks!
Comments
Can you clarify what it is you're trying to do? As I read your question, I'm envisioning a situation where you're doing an overlay on video coming in through VIDIN, but that you have two video sources that you want to select between before they reach the Backpack board. Am I correct?
-Phil
Actually both video sources are directly into the board, maybe using 5 new pins if necessary, to allow the propeller to select between each as the source.
To clarify, I want to select between two video sources at any given time during run time. Basically i want to have a digital switch between both input videos that the propeller can select between.
Do you know if maybe this will work: use 5 new pins for video source 2 and wired up the same way that is in the schematic with components RP2, R3, C2, C3, Q1. Then have the chip select between these pins during run time as the video source, such as VIDIN. Thanks again.
--Francisco
-Phil
Here's a circuit that should work for you:
Propeller pin A3 gates the auxilliary input to the output pin. A11, which gates VIDIN to the output pin, should be low when A3 is high to avoid video conflicts. Also, you won't be able to add an overlay to the auxilliary input, but you said that would be okay.
The circuit mounts on a Proto-DB and uses the Parallax RCA jack adapter (mounted off-center):
The transistors are surface mount (couldn't find adequate ones in a TO-92, sorry) and mounted on "Surf Board" adapters. The awkward part will be getting the output signal to the VID headers on the Backpack. These have a 2mm spacing and don't line up very well with holes in the Proto-DB. But I'm sure you can figure something out.
-Phil
_
Post Edited (Phil Pilgrim (PhiPi)) : 12/31/2009 6:32:48 AM GMT
By the way are you thee Phi Pi that is trademarked on the backpack board?
-Phil
here is the code i am using to test the circuit:
When the program starts, the regular video is visible with the overlay but with a faint ghost image of the auxillary interlaced. Then when the the pins 11 and 3 swap state I don't see an image anymore.
In summary it seems like the A3 gate is not strong enough to keep the auxillary video from leaking in and when A3 goes high to let the auxiallry video in, even with A11 low there seems to be a video conflict.
Do you think I may have wired something incorrectly? Thanks!
Please let me know if this doesn't make sense.
(circuit pic is attached)
I can't really tell from your photo if things are wired correctly. Would it be possible to post a picture that's more in focus? Also, if you have an active overlay, A11 will still be high, and you can't force it low in your top-level program. (Outputs from multiple cogs are ORed, remember.) For the time being, the only way to force A11 low is to stop the overlay object. Meanwhile, I will try to come up with a way to disable the overlay without stopping the cog.
As to the ghosting, your auxiliary video may be AC-coupled, which means that the signal can make excursions below ground. This would allow partial conduction through the MOSFETs when A3 is low. It can be fixed using a diode clamp circuit ahead of the MOSFETs. This is something I'll have to address tomorrow.
Meanwhile, please try it without the overlay, and report back.
-Phil
I've attached a special version of the overlay object for you to try. It has two new methods: on and off. Each is called without arguments. off disables both the onboard video passthru and overlay text; on renables both. off is also available from the terminal program by using an argument value of 64 to SHODSP. Any argument between 0 and 63 will automatically reenable the passthru and overlay to the chosen display number.
You should use on and off (or SHODSP, 64) in lieu of messing with A11. Also, be sure to "break before make"; that is, turn one video off before turning the other one on. You should also delay about 17ms after invoking off, before raising A3, since the disabling is done on a video field boundary, and it could take up to 1/60 second for it to take place. Some video sources used for the overlay may take awhile to resynchronize when the passthru is reenabled, since sync tracking is also disabled during the "off" time. Also, since your two video sources are not genlocked to each other, your picture will probably roll once at each transition as your monitor resyncs to the new video signal. Finally, some LCD monitors, rather than rolling, will blank momentarily (sometimes as much as a second) when the video signal changes. What this means is that if you switch back and forth between sources too fast, an LCD monitor may never show anything but a blank screen.
-Phil
The video output is swapped back and forth between the overlay video and the auxiliary without a problem. The only issue is the coupling which is seen during the overlaid video with the auxiliary video faintly seen over it passing by and some jittering.
--Francisco
Okay, you probably need a clamp on the auxiliary video input. Here's a circuit that should help:
Install this ahead of the MOSFETs. What it will do is keep the sync tips at 0V, rather than allowing them to go negative. That way, when A3 is low, it (and the MOSFET gates) will not be above the video levels. If you still get leakage, add another diode in series with the one that goes to ground.
-Phil
Addendum: If you're absolutely sure that your auxiliary video source is AC-coupled, you can eliminate the cap from the above circuit.
_
Post Edited (Phil Pilgrim (PhiPi)) : 1/6/2010 9:07:59 AM GMT
I am guessing that leakage is happening on all the setups but it is less apparent on some because of the video quality, strength, etc.
I am going try to get my hands on an oscilloscope to see if i can get a better picture of what is actually happening.
--Francisco
When you connect your scope, look for the signal going to the monitor swinging negative by more than 0.62V w.r.t. Vss. This could happen if the signal on VIDIN has a negative component. If so, that could cause the lower MOSFET in the switch circuit I provided to turn partially on, even when A3 is at 0V. That's all it would take, since there will be conduction through the top MOSFET via its body diode.
If this is the case, I believe it can be corrected with a couple more passive components. But let's see what's going on first.
-Phil