Shop OBEX P1 Docs P2 Docs Learn Events
cheap vid intf — Parallax Forums

cheap vid intf

ArchiverArchiver Posts: 46,084
edited 2001-07-12 04:12 in General Discussion
As I said this is cheap and dirty. It has its limits, lots of
limits. Ok, this is what it can do. About a foot in front of a old
Camcorder. I have a sheet of white paper with a horizontal stripe of
black electrical tape On the monitor tha paper fills the screen, with a
black bar in the center,, about .75 inch. Now when the Stamp program
is running a thin white line appears at the top of hte screen and
"scans" down till it overlays/alines with the black bar. When the black
bar travels up the white line travels up. When the bar lowers the white
line "scans" and locates the bar. At the same time (debug) is sending a
number 3 to 12.

Parts

* LM 1881 Video Sync Separator
* Lm 339 Level Comparator
* 2x .1uf cap
* 1x 10K pot.
* 1x 680K res.
* 1x 100res.

Now the "heart" of the interface is the Lm 1881 with a .1 cap and
680K in parallel to pull pin 6 to ground.. tap into the video with a
.1 cap to pin 2. Take the vertical sync at pin 3 to Stamp I/O
0...........

At the 1881 pin 2 connect the LM 339 pin 5, comparator #1 +
input......... The 339 output pin 2 connect to Stamp I/O 1 10K pot.
between +5 and ground, the wiper/center connect to 339/#1 - input pin 4
With a 100 res. connect Stamp I/O 2 to video / .1 cap point


PROGRAM /// CHECKOUT

Well the 1881 feeds I/O 0 with the video's vertical sync so we sync
the Stamp to it with a few lines of code

A var byte
0 input
1 input
2 output


low 2
A =1

Start:
if in0 =1 then Start
lopa:
if in0 =0 then lopa


( checkout ) pause 7

( second half code )

pulsout 2,11

goto Start


Well if I have succeeded in communicating the idea to you. When the
program is run. A thin white line should appear in the middle of the
video monitor. Now if it has a vertical "roll" something is wrong in
the 1881 section. If the line is not "rolling". You are halfway there
..... The pause value controls the vertical position .... The lower the
higher. The pulsout controls the line width. Higher the wider .......

SECOND HALF

OK ,,, set the wiper on the 10K pot. for 2.5 volt. Remove the (
checkout ) pause statement. And add this code ........

pause 1
pause A
if in1 = 0 then skp
A = A + 1
if A > 13 then rty

skp:
pulsout 2,111
debug dec a ,cr
goto Start

rty:
A = 1
goto Start


Theory
( Or how I think it works )

Well it seems that about every 16 milliseconds the video camera
sends a verticla sync signal to the monitor. The LM1881 "picks it up"
( sepatates it from the image information ) and sends it to the Stamp
I/O #0 .. Till then the Stamp loop's till it "see's" the back/rising
edge. So after we find the sync we have about 16 milliseconds to play
with the video image.

Ok for many applications the Stamp is "up to speed" but too slow for
video horizontal use. But who knows??

So as the camera scans it is outputting a voltage about .5 to 2.5
wolts dependign on what it "see's" .... So by comparing the video to a
2.5 volt reference with a LM339 we can tell the Stamp I/O #1 if the
camera is seeing a black or white image. Now by adjusting the pause
statement after the "Loop till Sync" statement we can control vertically
when the Stamp "takes a look"
.

Basically ending up with the equivalent of about 16 photo detectors
in a "line" ..... Now as I have said this is cheap an' dirty their is a
lot of room for improvment ..... But I love to "talk shop" so any
questions or comments are most welcome ... My next project will need a
bit more resolution than 16. So I am looking into off the shelf image
chips... That I can hook up to a Stamp but who knows??






[noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.