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

Timers and interruption.

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







Timers and interruption.
PostPosted: Thu Mar 01, 2007 7:03 pm     Reply with quote

I'm still learning how to use PIC , and I need Help for this problem . I need to know exectly the time between two events. Like when a external output , turn 0 to 1 , I use set_timer1(0) , and when other output turn 0 to I use the get_timer1(). The time diference between these two events its like 0.1- 0.5 miliseconds .
So I need to hold the routine to wait for a output turn 0 to 1, and when this event happen , start the counter immediately, then wait till other event happen to stop the counter right away . I'm using PIC16f877.
So could someone please help me , I don't know how to use interruptions well.
Thank you,
Noah
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 01, 2007 7:18 pm     Reply with quote

See these two CCS examples which show how to measure a pulse:

c:\program files\picc\examples\ex_pulse.c

c:\program files\picc\examples\ex_ccpmp.c
Noah
Guest







PostPosted: Thu Mar 01, 2007 8:59 pm     Reply with quote

Thanks for your help :\program files\picc\examples\ex_pulse.c
it's pretty much what I need.
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