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

Capture module

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



Joined: 09 Mar 2004
Posts: 52
Location: Greater Manchester - UK

View user's profile Send private message

Capture module
PostPosted: Mon May 24, 2004 1:49 am     Reply with quote

Dear folks,

I wnat to use the capture module of the PIC16F874 to measure a frequency.

IF I set it to trigger every rising edge, can I assume that the the value in timer 1 will be the time between rising edges (1 cycle).

If so when it encounters the first rising edge will it start or generate an interrupt??

How do I set it to measure between rising edges???

Any ideas??
_________________
Best Regards
mvaraujo



Joined: 20 Feb 2004
Posts: 59
Location: Brazil

View user's profile Send private message

PostPosted: Mon May 24, 2004 8:14 am     Reply with quote

Asjad,

This is not like your thinking! Every rising edge you'll have the CCP module copying the current value of the Timer1 to a CCP register. So if you want to measure period of time what you have to do is always subtract current capture by last capture (it can be inside the interrupt). And yes, you can enable interrupt to warn you that a rising edge happened and it's time to collect data and make calculation.

I suggest you, before trying to implement stuff directly, to know your PIC device by reading the part datasheet and other documents that can be found at Microchip.com. If you don't know your hardware, no programming will get you to good results.

Marcus
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