|
|
View previous topic :: View next topic |
Author |
Message |
Noah Guest
|
Timers and interruption. |
Posted: Thu Mar 01, 2007 7:03 pm |
|
|
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
|
|
Posted: Thu Mar 01, 2007 7:18 pm |
|
|
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
|
|
Posted: Thu Mar 01, 2007 8:59 pm |
|
|
Thanks for your help :\program files\picc\examples\ex_pulse.c
it's pretty much what I need. |
|
|
|
|
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
|