Associate II
May 3, 2020
Question
Automatically count number of output compare events (without interrupts)?
- May 3, 2020
- 7 replies
- 2580 views
I set up Timer1 Ch4 and Timer2 Ch4 to toggle their Pins (PE14 and PE11) on Capture Compare. I use this as a step signal for stepper drivers with high microstepping (256x).
I recognized that when I activate the interrupts to count the number of pulses at high frequencies (>500kHz per Timer) a lot of CPU time is used to jump into the interrupt routine and clear the flags.
Is there a way to e.g. internally count via a counter the capture events, to count them without calling an interrupt routine?
I only found a solution to directly solder the step pin to an input pin of a low power timer and use them to count external clock events.
Any more elegant solution?
