www
.mcu.com.cn
125
/
239
Rev.
1.00
CMS80F731x Reference Manual
17.4.2
Edge Alignment
In edge alignment mode, the 16-bit PWM counter CNTn starts counting down at the beginning of each cycle and
compares to the value CMPn locked in the PWMDnH/PWMDnL register, when CNTn= CMPn PGn outputs high, PWMnDIF is
set to 1. CNTn continues to count down to 0, at which point PGn will output low and PWMnZIF will be set to 1. When the
CNTn count reaches zero, if PWMnCNTM=1, CMPn and PERIODn will be reloaded.
The relevant parameters for edge alignment are as follows:
High time =
(CMPn+1) × Tpwm
(CMPn≥1).
Period =
(1) × Tpewm
Duty cycle = CMPn+11 (CMPn≥1).
At CMPn=0, the duty cycle is 0%.
Edge alignment timing is shown in the following figure:
continous mode enable when PWMnCNTM=1
,
when CNTn counts to zero point,
reload PERIODn and CMPn
0
CMPn(old)
CMPn(new)
PERIODn(old)
PERIODn(new)
0000H
0080H
012FH
07FFH
1A34H
PIFn/ZIFn
DIFn
PGn