
Rev. 1.00
289 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
15 Motor Control T
imer (MCTM)
15 Motor Control T
imer (MCTM)
Center-Aligned Counting
In the center-aligned counting mode, the counter counts up from 0 to the counter-reload value
and then counts down to 0 alternatively. The Timer Module generates an overflow event when the
counter counts to the counter-reload value in the up-counting mode and generates an underflow
event when the counter counts to 0 in the down-counting mode. The counting direction bit DIR
in the CNTCFR register is read-only and indicates the count direction when in the center-aligned
counting mode. The count direction is updated by hardware automatically.
Setting the UEV1G bit in the EVGR register will initialise the counter value to 0 irrespective of
whether the counter is counting up or down in the center-aligned counting mode.
The update event 1 interrupt flag bit in the INTSR register will be set to 1 when an overflow or
underflow event occurs.
CK_PSC
CNT_EN
F3
F4
4
CK_CNT
F2
F5
CNTR
CRR Shadow Register
CRR
4
F5
4
3
2
1
0
Counter Underflow
Update Event 1 Flag
Software clearing
Write a new value
Counter Overflow
1
2
3
Software clearing
Figure 76. Center-Aligned Counting Example