cancel
Showing results for 
Search instead for 
Did you mean: 

generate timer interrupt at CNT value

Rafael1
Associate

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!

1 REPLY 1

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