2014-02-05 11:31 AM
How do I reload a running downcounting timer? Like this:
TIM_UpdateDisableConfig(TIM2, DISABLE);
TIM_SetCounter(TIM2, period);
TIM_UpdateDisableConfig(TIM2, ENABLE);
??
/Frank
2014-02-07 09:32 AM
Hi
''How do I reload a running downcounting timer?'' You may not have to. It depends on the mode the Timer is in. The TIMx_ARR register controls the period of the timer. The TIMx_ARR register is buffered so that it can be written to during operation. This is controlled in TIMx_SR1 The new value is used on the next TIMx_CNT overflow. Direction of count does not matter (unless you are trying to change it during operation!). I am sorry but I do not know how to use the Standard Peripheral Library to do this - I have been working with the Timer registers directly.