Society of Robots - Robot Forum

Software => Software => Topic started by: henry on July 27, 2007, 04:21:39 AM

Title: ? timer uC
Post by: henry on July 27, 2007, 04:21:39 AM
how to get a time of interupt in uC??

example : I make the first interupt..and then the second....
I want to know the time between the first and the second interupt...


thanks

henry
   
Title: Re: ? timer uC
Post by: iNFINITE on July 27, 2007, 05:34:53 AM
Use a timer, set a proper prescale
Set the Timer counter(e.g TCNT) to zero in the first interrupt.
Read the timer counter value in the 2nd interrupt, which will give you the time inbetween the interrupts..
Title: Re: ? timer uC
Post by: Admin on August 11, 2007, 10:28:26 AM
first, what uC?

second, google for source code . . .