2015-02-09 11:32 AM
Hi All,
I have a timer running on my STM32F0 and I would like to change the period of the timer mid-application. Do I need to rerun my timer configuration with the new timer period or can I simply update the single TIM_Period register. If so, how would I do that in my main application? Would this be acceptable just in main.c:TIM16->ARR = UART_CAPTURE_PERIOD_EOC;Thanks2015-02-09 12:20 PM
Yes, pretty much just by setting TIMx->ARR, normally the new value is used at the next update, as it moves the shadow register to the active one, or you can force it to preload immediately, but then you'd need to be more conscious of the current phase (TIMx->CNT) so as not to have a random phase hit where the current cycle is abruptly shortened.