Go Down

Topic: set Timer1 dynamically based on measured interval (Read 383 times) previous topic - next topic

robotman777

I have an external pulse triggering the hardware interrupt (INT0) at a slow rate and I want to accurately measure this (just compare readings of micros()?) and then use this interval to Timer1 to run at a rate that is exactly 24 times this speed.

Each new external pulse should help resync the Timer1 so there is no drift beyond counting up to 24.

What is the best way to implement this so that the there is little lag whenever Timer1 is reconfigured?

Go Up