STM32 Timer Settings Changing
Let's say you update ARR as 90 when your CNT register is 95, when do you think the next update/reload happens?
Options:
when you set ARR check CNT if it's higher than next ARR value.(poor)
set CNT to 0 when you are updating ARR.(OK)
Enable relevant timer interrupt, update ARR only in timer overflow ISR.(Best in my opinion)