CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Video Level meter

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mjdale2003



Joined: 10 Oct 2004
Posts: 21
Location: UK

View user's profile Send private message Yahoo Messenger MSN Messenger

Video Level meter
PostPosted: Wed Dec 29, 2004 1:46 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Dec 30, 2004 5:38 am     Reply with quote

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

View user's profile Send private message Yahoo Messenger MSN Messenger

PostPosted: Thu Dec 30, 2004 11:45 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Dec 30, 2004 11:55 am     Reply with quote

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

View user's profile Send private message Yahoo Messenger MSN Messenger

mjdale2003
PostPosted: Fri Dec 31, 2004 8:49 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Tue Jan 04, 2005 1:55 pm     Reply with quote

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);
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group