
Rev. 1.00
246 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
14 General-Purpose T
imer (GPTM)
Starting Two Timers Synchronously in Response to an External Trigger
▆
Configure GPTM to operate in the master mode to send its enable signal as a trigger output
(MMSEL = 0x1).
▆
Configure GPTM slave mode to receive its input trigger source from GT_CH0 pin (TRSEL = 0x1).
▆
Configure GPTM to be in the slave trigger mode (SMSEL = 0x6).
▆
Enable the GPTM master timer synchronization function by setting the TSE bit in the MDCFR
register to 1 to synchronize the slave timer.
▆
Configure PWM0 to receive its input trigger source from the GPTM trigger output (TRSEL = 0xA).
▆
Configure PWM0 to be in the slave trigger mode (SMSEL = 0x6).
TI0
TI0FP
f
DTS
=f
CLKIN
TI0S0ED
GPTM (TME bit)
GPTM (TEVIF)
TSE=1
Delay
GPTM CK_PSC
PWM0 (TME bit)
PWM0 (TEVIF)
PWM0 CK_PSC
0
1
2
3
4
GPTM CNTR
PWM0 CNTR
0
1
2
3
4
34
11
0
Write UEVG bit
Write UEVG bit
ITI
5
5
Master GPTM
Slave PWM0
Figure 71. Trigger GPTM and PWM0 with the GPTM CH0 Input