
NUC126
Aug. 08, 2018
Page
427
of 943
Rev 1.03
NUC12
6 S
E
RI
E
S
T
E
CH
NI
CA
L R
E
F
E
RE
NCE
MA
NUA
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.13-15 Center Loading in Up-Down-Count Mode
6.13.5.12 PWM Counter Operation mode
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 registers should be written first and then set CNTENn
(PWM_CNTEN[5:0]) bit as 1 to enable PWM prescaler and counter start running. After PWM counter
counted a period, counter value will keep in zero. User can re-start next one-shot by writing new value
to CMP(PWM_CMPDATn[15:0]) bits. If one-shot counter still running, to update CMPDAT register will
cause next one-shot as continuous one-shot. Besides, to write CMPDAT register twice under
continuous one-shot operation, latest value in CMPDAT register is valid at next one-shot period and
only generate one-shot pulse once. Figure 6.13-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.