
M451
May. 4, 2018
Page
448
of
1006
Rev.2.08
M4
51
S
E
RI
E
S
T
E
CH
NICA
L RE
F
E
R
E
NC
E
M
A
NU
A
L
CMPDAT DATA0
CMPU
CMPDAT DATA1
PERIOD DATA0
PERIOD DATA1
PERIOD DATA2
CNT
CMPDAT DATA2
CMPD
Write
Load
Note:
CMPDAT
PERIOD
PERIOD DATA0
PERIOD DATA1
CMPDAT DATA1
PBUF
PERIOD DATA0
PERIOD DATA1
CMPBUF
CMPDAT DATA1
PERIOD DATA2
PERIOD DATA2
CMPDAT DATA0
CMPDAT DATA2
CMPDAT DATA2
point 1
point 2 point 3 point 4
point 5
point 6
point 7 point 8
Figure 6.9-15 Center Loading in Up-Down-Count Mode
PWM Counter Operation mode
6.9.5.12
The PWM counter supports two operation modes: One-shot mode and Auto-reload mode. PWM
counter will operate in One-shot mode if CNTMODEn (PWM_CTL1[21:16]) bit is set to 1, and
operate in Auto-reload mode if set to 0.
In One-shot mode, CMPDAT and PERIOD should be written first and then set CNTENn
(PWM_CNTEN[5:0]) channel n corresponding bit to 1 to enable PWM prescaler and counter start
running. After PWM counter counted a period, counter value will keep in zero.
Software needs to write new CMPDAT to re-start next one-shot. If one-shot counter still running,
write CMPDAT will cause next one-shot as continuous one-shot. Besides, if under continuous
one-shot write CMPDAT twice, one-shot period will use latest value as CMPDAT and only
generate one-shot pulse once. Figure 6.9-16 is an example and following is steps sequence.
1. Software writes PERIOD DATA1 and hardware immediately loading PERIOD DATA1 to
PBUF at point 1.
2. Software writes CMPDAT DATA1 which is equal to CMPDAT DATA0 at point 2 and
hardware immediately loading CMPDAT DATA1 to CMPBUF, this event also trigger one-
shot.
3. Software writes CMPDAT DATA2 and re-trigger next one-shot (continuous one-shot) at
point 3.
4. Software writes CMPDAT DATA3 to cover CMPDAT DATA2 and re-trigger next one-shot at
point 4.
5. Period loading CMPDAT DATA3 to CMPBUF at point 5.
6. There are no new CMPDAT write in the previous period, and the counter value is kept as
zero at point 6.