2024-08-23 12:15 AM
Hello,
is there a way to generate a timer interrupt at a certain CNT value? I have not found anything about this.
And if this is possible, is it also possible to change this value on the fly?
Thank you!
2024-08-23 12:23 AM
That's called Compare. Just set one of the TIMx_CCRx to the desired compare value, enable the related interrupt by setting TIMx_DIER.CCxE, enable the timer interrupts in NVIC and write the ISR (Interrupt Service Routine).
I don't use CubeMX but I think this is called "Compare no output" in CubeMX.
And yes, you can change the compare value in TIMx_CCRx on the fly.
JW