
Rev. 1.00
263 of 486
July 31, 2018
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241
14 Pulse W
idth Modulator (PWM)
Asymmetric PWM Mode
Asymmetric PWM mode allows two center-aligned PWM signals to be generated with a
programmable phase shift. While the PWM frequency is determined by the value of the CRR
register, the duty cycle and the phase-shift are determined by the CHxCR and CHxACR register.
When the counter is counting up, the PWM uses the value in CHxCR as up-count compare value.
When the counter is into counting down stage, the PWM uses the value in CHxACR as down-
count compare value. The Figure 85 is shown an example for asymmetric PWM mode in center-
aligned counting mode.
Note: Asymmetric PWM mode can only be operated in center-aligned counting mode.
2 3 4 5 6 7
0 1
8
5 4 3 2 1 0
7 6
2 3 4 5 6 7
1
8
5 4 3 2 1 0
7 6
2 3 4 5 6 7
1
8
5 4 3 2 1
7 6
CNTR
CHxOREF
CHxOREF
CHxOREF
CHxOREF
PWM center align mode
CRR = 8
CR = 3, ACR = X
PWM center align mode
CRR = 8
CR = 5, ACR = X
Asymetric PWM center align mode
CRR = 8
CR = 3, ACR = 5
Asymetric PWM center align mode
CRR = 8
CR = 5, ACR = 3
CR = 3
CR = 5
CR = 3
ACR = 5
CR = 5
ACR = 3
Phase delay = 2
CRR = 8
Figure 85. Asymmetric PWM Mode versus Center-aligned Counting Mode
Timer Interconnection
The timers can be internally connected together for timer chaining or synchronization. This can
be implemented by configuring one timer to operate in the Master mode while configuring another
timer to be in the Slave mode. The following figures present several examples of trigger selection
for the master and slave modes.
Using one timer to enable / disable another timer start or stop counting
▄
Configure PWM0 as the master mode to send its channel 0 Output Reference signal CH0OREF
as a trigger output (MMSEL = 0x4).
▄
Configure PWM0 CH0OREF waveform.
▄
Configure PWM1 to receive its input trigger source from the PWM0 trigger output (TRSEL = 0x9).
▄
Configure PWM1 to operate in the pause mode (SMSEL = 0x5).
▄
Enable PWM1 by writing ‘1’ to the TME bit.
▄
Enable PWM0 by writing ‘1’ to the TME bit.