Hi Bruce. At the link above, you posted a timer code. I do not get it why you are adding the timer value to the T1LO/T1HI values instead off just loading the timer with the timout value.
Sorry I seem like Goofy right now....
Ioannis
Hi Bruce. At the link above, you posted a timer code. I do not get it why you are adding the timer value to the T1LO/T1HI values instead off just loading the timer with the timout value.
Sorry I seem like Goofy right now....
Ioannis
Hi Ioannis,
I think doing it that way accounts for any variance in latency etc. Since the code just polls TMR1 interrupt flag rather than actually cause an interrupt the timer may have counted "a while" before the code actually gets to reloading it. If you then simply reload it the time already passed since it overflowed will get lost. By adding the preload value to the actual value already accumulated in the timer you won't loose any time.
Does that make any sense?
/Henrik.
Ohh yeah! I see the light!
Thanks Henrik.
Ioannis
Last edited by Ioannis; - 19th May 2010 at 19:49.
Bookmarks