Congratulations.
Now it'll be interesting to see how far you can go with this PicBasic approach to video.
Congratulations.
Now it'll be interesting to see how far you can go with this PicBasic approach to video.
Congratulations!
Very nice rocking chair! Who is on the couch?
Luciano
RUBiksCUbe,
Before I forget... You should post the code that created that video bar display. Maybe this way you'll get some useful ideas on how to proceed, and/or inspire others in there video related efforts.
Sure the code. BTW noone is on the couch, its just a knitted blanket thats all twisted and some pillows.
I used some really cheap delay methods, like setting the variable i to different things and setting a pin to a value twice to slow the pic down a bit because PAUSEUS actually pauses for about 1.4ish us. Come to think of it, setting a pin twice might create those voltage spikes...
DEFINE OSC 20
'Set them up as outputs
Output PortB.0
Output PortB.1
main:
'Front porch: 1.5us total delay
PortB.1 = 0
PortB.0 = 1
'SIMPLE DELAY
PortB.1 = 0
i = 11
i = i
'Synch: 4.7us total delay time
PortB.1 = 0
PortB.0 = 0
'SIMPLE DELAY
i = 3
i = i + 1
i = i + 1
i = 7
pauseus 3
'NEXT:
'Back Porch: 4.7us total delay time
PortB.1 = 0
PortB.0 = 1
'Simple Delay
PortB.1 = 0
pauseus 4
'SIMPLE DELAY
i = i + 1
'Time to get drawing! 52.6us total time to draw.
'Gray: 4.4us total delay time
PortB.1 = 1
PortB.0 = 0
Pauseus 3
'SIMPLE DELAY
i = i + 1
i = i + 1
i = i + 1
i = i + 1
i = i + 1
i = i + 1
'NEXT:
'Black: 20us total delay time
PortB.1 = 0
PortB.0 = 1
Pauseus 19
'SIMPLE DELAY
i = i + 1
i = i + 1
i = i + 1
'NEXT:
'White: 4us total delay time
PortB.1 = 1
PortB.0 = 1
Pauseus 3
'Black: 20us total delay time
PortB.1 = 0
PortB.0 = 1
Pauseus 19
'SIMPLE DELAY
i = i + 1
i = i + 1
i = i + 1
'NEXT:
'Gray: 4.6us total delay time
PortB.1 = 1
PortB.0 = 0
Pauseus 1
'SIMPLE DELAY
i = i + 1
i = i + 1
i = i + 1
i = i + 1
i = i + 1
i = i + 1
'NEXT:
goto main
And thats the magic. No vertical synch (yet) but it worked on my NTSC TV. Now I just need to fix those stupid i = i + 1 delays and make the video animated.
Ive been trying animated tv signals where the white bar moves back and forth, but it isnt working out. All I see is a white bar in the middle of the screen that gets warped at the top. I guess the vertical synch is important
Yes you will need Vsync, otherwise you'll get that bending affect you are seeing. Also be sure to leave some empty space (0.4 volt black level) of at least 3 scanlines before and after (more is better if it doesn't limit the viewable height of your bars). This is kinda like the front and back porch of the Vsync pulse.
Speaking of which, are your front and back porch adaquate for your Hsync? If you look at the diagram below you will see that you need to maintain at least 1.5 usec of space for the front porch, and about 4.7 usec on the backporch of the Hsync. To be safe, and because most TV's have considerable overscan, I would give it more (figure on only having about 48 usec of viewable active video, the rest just wraps around the CRT).
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=627&stc=1&d=1132554180 ">
For now don't worry about the colorburst, since I presume you are only fooling around with B&W. Also if you didn't already notice, IRE units are the same as volts*100.
When I timed every section of my code in MPLAB I got it as close as the specifications as possible. The front porch was 1.4us and the back porch was 4.6us, which is as close as I could get it without going over. I could try to extend the front porch to 1.6 us and see what happens. I dont think that anything would though.
Thats a good diagram. I wish I had that when I was still coding. Do you have one of those for the vertical synch? I cant find the timing for it anywhere.
Bookmarks