Re: LPC2138 timers



Frank van Eijkelenburg wrote:
.... If the timer was used only for measurement, it would
work I guess. However, the timer is also used as timeout timer (if for a long
period no edges are detected a timeout occures). I could manually detect if the
timeout period is elapsed, but this should be done outside the interrupt service
routine. Anyway, automatically reset the timer would be the best solution, but I
am afraid it isn't possible?!

I have a similar situation. (With a different processor.) In my case,
the precision required for timeout detection is much lower than the
one used to measure time intervals. So I use another lower repetition
timer in my system to detect timeouts as follows:

In the ISR for edge detection, reset the "edge" timeout counter every
time.

In the lower resolution timer ISR, increment the edge timeout counter
and declare a timeout if a limit is exceeded.
.


Quantcast