What is the best way to execute an event every constant time interval?
Hi,
My board is STM32F411RE Nucleo.
Currently, I'm using a timer (timer 2, channel 3 to be exact) in output compare (no output), using TIM_OCMODE_TIMING mode, interrupt enable.
My understanding is the timer will tick until it is overflowed (in this case, the overflow value is 2^32-1, as TIM2 is 32 bit) , and an event will trigger when the timer tick pass the period value. And since this period is a set value, the event will only trigger once.
So if my understanding is correct, in order to achieve what I want, I should also increment the Period to a new (that is multiple of the original value) every time an event is triggered.
Is this logic correct, and is there a better way to do this?