Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
283
/
631
Counter mode
Up-counting mode
In up-counting mode, the counter will count from 0 to the value of the register TIMx_AR, then it resets to 0. And a
counter overflow event is generated.
If the TIMx_CTRL1.UPRS bit (select update request) and the TIMx_EVTGEN.UDGN bit are set, an update event
(UEV) will generate, and TIMx_STS.UDITF will not be set by hardware. Therefore, no update interrupts or update
DMA requests are generated. This setting is used in scenarios where you want to clear the counter but do not want to
generate an update interrupt.
Depending on the update request source is configured in TIMx_CTRL1.UPRS, When an update event occurs,
TIMx_STS.UDITF is set, all registers are updated:
Update auto-reload shadow registers with preload value(TIMx_AR), when TIMx_CTRL1.ARPEN = 1.
The prescaler shadow register is reloaded with the preload value(TIMx_PSC)
To avoid updating the shadow registers when new values are written to the preload registers, you can disable the
update by setting TIMx_CTRL1.UPDIS=1.
When an update event occurs, the counter will still be cleared and the prescaler counter will also be set to 0 (but the
prescaler value will remain unchanged).
The figure below shows some examples of the counter behavior and the update flags for different division factors in
the up-counting mode.