
Rev. 1.00
225 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
14 General-Purpose T
imer (GPTM)
14 General-Purpose T
imer (GPTM)
CK_PSC
CNT_EN
F3
F4
F5
CK_CNT
F2
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
0
1
2
3
PSC_CNT
Counter Overflow
Update Event Flag
Software clearing
Write a new value
1
Update the new value
Figure 40. Up-counting Example
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 the update event is set by the UEVG bit in the EVGR register, the counter value will also be
initialized 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 Flag
Software clearing
Write a new value
1
Update the new value
Figure 41. Down-counting Example