Interrupt: Need to keep track of time spent in routine or ... ?

tms8c8:
That's what I was asking: is there a way to keep track of time through some sneaky manipulations or using the watchdog timer somehow. Evidently there is not.

You can, up to a point. You could have Timer1 (the 16 bit timer) used as a timer. With suitable prescaling and counting modes set up, it could time quite a long period (eg. 8 seconds). There is a trade-off between resolution and the time before it wraps around.

But, I just don't like the idea. :slight_smile:

The time for an interrupt to start executing isn't exact, so your adjustment won't be precise. You are better off keeping interrupt handlers short (well under a millisecond) and doing what you want by keeping track of elapsed time.