
Rev. 1.00
288 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
15 Motor Control T
imer (MCTM)
Down-Counting
In this mode the counter counts continuously from the counter-reload value, which is defined in
the CRR register, to 0 in a count-down direction, then restarts from the counter-reload value and
generates a counter underflow event. This action will continue repeatedly. The counting direction
bit DIR in the CNTCFR register should be set to 1 for the down-counting mode.
When an update event 1 is generated by setting the UEV1G bit in the EVGR register to 1, the
counter value will also be initialised to the counter-reload value.
CK_PSC
CNT_EN
2
1
0
CK_CNT
3
F5
CNTR
CRR Shadow
Register
CRR
36
F5
36
0
1
0
1
PSCR
PSCR Shadow
Register
0
0
1
0
1
0
1
0
36
35
34
33
PSC_CNT
Counter Underflow
Update Event 1
Flag
Software clearing
Write a new value
1
Update the new value
Figure 75. Down-Counting Example