
Mini57
Apr. 06, 2017
Page 233 of 475
Rev.1.00
MINI5
7
S
E
RI
E
S
TECH
NIC
A
L R
E
F
E
RE
N
CE
MA
N
UA
L
The EPWM period and duty control are decided by PWM down-counter register (PERIOD) and
PWM comparator register (CMPDATn). The PWM-Timer timing operation is shown in Figure
6.8-11 EPWM-Timer Operation Timing. The pulse width modulation follows the formula below and
the legend of PWM-Timer Comparator is shown in Figure 6.8-10 EPWM Legend of Internal
Comparator Output of PWM-Timer. Note that the corresponding GPIO pins must be configured as
PWM function for the corresponding PWM channel.
PWM frequency = HCLK / (clock divider) / (1)
Period = ( 1) unit
Duty ratio = CMPDAT / (1)
CMPDAT > PERIOD: PWM output is always high
CMPDAT <= PERIOD: PWM output high duty = (CMPDAT) unit
CMPDAT = 0: PWM always low
Note:
1. Unit = one PWM clock cycle.
+
-
PWM-Timer
Comparator
Output
CMPDATn
Update new
CMPDATn
Start
Initialize
PWM
PWM
Ouput
1
CMPDATn
PERIOD
PERIOD
CMPDATn
Note:
n= 0 ~ 5.
Figure 6.8-10 EPWM Legend of Internal Comparator Output of PWM-Timer
Comparator
(CMPDATn)
1
0
PWMn
down-counter
3
3
2
1
0
4
3
2
1
0
4
PWM-Timer
output
1
CMPDATn= 1
PERIODn = 3
Auto reload = 1
(CNTMODE =1)
Set CNTENn=1
(PWM-Timer starts running)
CMPDATn= 0
PERIODn = 4
Auto-load
(S/W write new value)
Auto-load
(Write initial setting)
(H/W update value)
(PWMIFn is set by H/W)
(PWMIFx is set by H/W)
Figure 6.8-11 EPWM-Timer Operation Timing
Center-Aligned PWM (Up/Down Counter)