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 CCS Technical Support

How to measure a duty cycle (on-off ratio) of a unknown freq

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



Joined: 30 Jul 2007
Posts: 112
Location: Moscow, Russia

View user's profile Send private message

How to measure a duty cycle (on-off ratio) of a unknown freq
PostPosted: Fri Sep 19, 2008 9:35 am     Reply with quote

How to measure a duty cycle (on-off ratio) of a unknown frequency? (Frequency is lower than 10 kHz). I know how to do this with 18Fxx31 series (with hardware period and pulse width measurement), but how to do this with common pic with CCP?
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: How to measure a duty cycle (on-off ratio) of a unknown
PostPosted: Fri Sep 19, 2008 11:06 am     Reply with quote

Use Input Capture mode. Configure for rising edge capture. As soon as you get a capture event, store the captured timer value (PR register) and re-configure for falling edge capture, etc. Subtracting consecutive captured times will give you the periods (on-time and off-time).
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
ferdem



Joined: 27 Aug 2008
Posts: 1

View user's profile Send private message

PostPosted: Tue Sep 30, 2008 12:33 am     Reply with quote

CCP and ECCP Tips 'n Tricks:
http://www.garcia-cuervo.com/picmania.garcia-cuervo.net/recursos/RedPicTutorials/Trucos%20Tecnicas%20Ideas/PICmicro%20CCP%20and%20ECCP%20Tips_n_Tricks.pdf
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