
Rev. 1.00
249 of 486
July 31, 2018
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241
14 Pulse W
idth Modulator (PWM)
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. Once the counter reaches 0, the Timer module
generates an underflow event and the counter restarts to count once again from the counter reload
value. 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 a new value
Figure 65. Down-counting Example