
M0A21/M0A23 Series
May 06, 2022
Page
349
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
other loading mode for channel n will become invalid. Figure 6.10-14 shows an example and its steps
sequence is described below.
1. Software writes CMPDAT DATA1 and hardware immediately loading CMPDAT DATA1 to
CMPBUF at point 1.
2. Software writes PERIOD DATA1 which is greater than current counter value at point 2;
counter will continue counting until equal to PERIOD DATA1 to finish a period loading.
3. Software writes PERIOD DATA2 which is less than the current counter value at point 3;
counter will continue counting to its maximum value 0xFFFF and count wraparound from 0 to
PERIOD DATA2 to finish this period loading.
CMPDAT DATA0
CMPU
CMPDAT DATA1
PERIOD DATA1
PERIOD DATA2
PERIOD DATA0
CNT
CNT wraparound
0xFFFF
Write
Load
Note:
CMPDAT
PERIOD
PERIOD DATA0
PERIOD DATA1
CMPDAT DATA1
PBUF
PERIOD DATA0
PERIOD DATA1
CMPBUF
CMPDAT DATA1
PERIOD DATA2
PERIOD DATA2
point 1
point 2
point 3
Figure 6.10-14 Immediately Loading in Up-Count Mode
6.10.5.10 Center Loading Mode
When the CTRLDn (PWM_CTL0[5:0]) bit is set to 1 and PWM counter is set to up-down count type,
CNTTYPEn (PWM_CTL1[2n+1:2n], n = 0,1..5) is 0x2, PWM operates at center loading mode. In center
loading mode, CMP(PWM_CMPDATn[15:0]) will load to active CMPBUF register in center of each
period, that is, counter counts to PERIOD. PERIOD(PWM_PERIODn[15:0]) will all load to their active
PBUF registers while each period is completed. Figure 6.10-15 shows an example and its steps
sequence is described below.
1.
Software writes CMPDAT DATA1 at point 1.
2.
Hardware loads CMPDAT DATA1 to CMPBUF at center of PWM period at point 2.
3.
Software writes PERIOD DATA1 at point 3.
4.
Hardware loads PERIOD DATA1 to PBUF at the end of PWM period at point 4.
5.
Software writes CMPDAT DATA2 at point 5.
6.
Hardware loads CMPDAT DATA2 to CMPBUF at center of PWM period at point 6.
7.
Software writes PERIOD DATA2 at point 7.
8.
Hardware loads PERIOD DATA2 to PBUF at the end of PWM period at point 8.