View previous topic :: View next topic |
Author |
Message |
mjdale2003
Joined: 10 Oct 2004 Posts: 21 Location: UK
|
Video Level meter |
Posted: Wed Dec 29, 2004 1:46 pm |
|
|
Hi, i am having trouble working out my latest project i want to measure the voltage level of a video line i know that i need to do this every 64us
to get a reliable result and the hard part is i not only need to measure the peak white level i need to measure the sync pulse voltage
firstly does any one know how to set up the timers to read the a to d at that sort of speed on an 877a and also i would prefer to do it with a 16f628a using the comparitors but i have no idea wher to start
kind regards mike |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Thu Dec 30, 2004 5:38 am |
|
|
You can use a video sync seperator chip (such as LM1881) to detect the beginning and the end of the horizontal and vertical sync pulses. During those times you can perform your measurements. |
|
|
mjdale2003
Joined: 10 Oct 2004 Posts: 21 Location: UK
|
|
Posted: Thu Dec 30, 2004 11:45 am |
|
|
The problem rearly is to remove the negative offset from the video signal itself ie lifting the signal so that it is always positive so that I can get a reading from the a to d. Does anyone have any circuit diagrams that may be of any use ? |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Thu Dec 30, 2004 11:55 am |
|
|
How about AC coupling it to the midscale of the A/D. Then you just measure the tip of the sync pulse and subtract from your video reading. It seems easier than doing a real DC restoration. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
mjdale2003
Joined: 10 Oct 2004 Posts: 21 Location: UK
|
mjdale2003 |
Posted: Fri Dec 31, 2004 8:49 am |
|
|
Thanks, that works well now the only problem i have is setting up the timer to overflow every 64us could any one show me some code that will do this and also explain how to work it out for my self
Regards,
mike |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Jan 04, 2005 1:55 pm |
|
|
Look at the setup_timer_2() function in the help file.
At 20MHz, the timer would increment every 200ns.
If we use a prescaler of 4, then it would increment every 800ns.
To get the period value, 64us / 800ns = 80 so...
Code: | setup_timer_2(T2_DIV_BY_4, 80, 1); |
|
|
|
|