Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
233
/
631
Down-counting mode
In down-counting mode, the counter will decrement from the value of the register TIMx_AR to 0, then restart from
the auto-reload value and generate a counter underflow event.
The process of configuring update events and updating registers in down-counting mode is the same as in up-counting
mode, see 11.3.2.1.
The figure below shows some examples of the counter behavior and the update flags for different division factors in
the down-counting mode.
Figure 11-5 Timing diagram of the down-counting, internal clock divided factor = 2/N
Center-aligned mode
In center-aligned mode, the counter increments from 0 to the value (TIMx_AR) – 1, a counter overflow event is
generated. It then counts down from the auto-reload value (TIMx_AR) to 1 and generates a counter underflow event.
Then the counter resets to 0 and starts counting up again.
In this mode, the TIMx_CTRL1.DIR direction bits have no effect and the count direction is updated and specified by
hardware. Center-aligned mode is valid when the TIMx_CTRL1. CAMSEL bit is not equal to "00".
CK_PSC
CNTEN
Timer clock = CK_CNT
Counter register
Update event
(
UEV
)
0002
0001
Counter underflow
Update interrupt flag(UDITF)
0000
0036
0035
0034
0033
Internal clock divided by
2
Internal clock divided by
N
CK_PSC
Timer clock = CK_CNT
Counter register
Update event
(
UEV
)
1F
20
00
36
Counter underflow
Update interrupt flag(UDITF)