![Atmel SAM4S Series Preliminary Data Sheet Download Page 928](http://html1.mh-extra.com/html/atmel/sam4s-series/sam4s-series_preliminary-data-sheet_3003408928.webp)
928
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
Figure 37-16. Event Line Block Diagram
37.6.5
PWM Controller Operations
37.6.5.1
Initialization
Before enabling the channels, they must have been configured by the software application:
• Unlock User Interface by writing the WPCMD field in the PWM_WPCR Register.
• Configuration of the clock generator (DIVA, PREA, DIVB, PREB in the PWM_CLK register if
required).
• Selection of the clock for each channel (CPRE field in the PWM_CMRx register)
• Configuration of the waveform alignment for each channel (CALG field in the PWM_CMRx
register)
• Selection of the counter event selection (if CALG = 1) for each channel (CES field in the
PWM_CMRx register)
• Configuration of the output waveform polarity for each channel (CPOL in the PWM_CMRx
register)
• Configuration of the period for each channel (CPRD in the PWM_CPRDx register). Writing in
PWM_CPRDx register is possible while the channel is disabled. After validation of the
channel, the user must use PWM_CPRDUPDx register to update PWM_CPRDx as
explained below.
• Configuration of the duty-cycle for each channel (CDTY in the PWM_CDTYx register).
Writing in PWM_CDTYx register is possible while the channel is disabled. After validation of
the channel, the user must use PWM_CDTYUPDx register to update PWM_CDTYx as
explained below.
• Configuration of the dead-time generator for each channel (DTH and DTL in PWM_DTx) if
enabled (DTE bit in the PWM_CMRx register). Writing in the PWM_DTx register is possible
while the channel is disabled. After validation of the channel, the user must use
PWM_DTUPDx register to update PWM_DTx
• Selection of the synchronous channels (SYNCx in the PWM_SCM register)
• Selection of the moment when the WRDY flag and the corresponding PDC transfer request
are set (PTRM and PTRCS in the PWM_SCM register)
• Configuration of the update mode (UPDM in the PWM_SCM register)
• Configuration of the update period (UPR in the PWM_SCUP register) if needed.
• Configuration of the comparisons (PWM_CMPVx and PWM_CMPMx).
PULSE
GENERATOR
Event Line x
CSEL0 (PWM_ELMRx)
CMPM0 (PWM_ISR2)
CSEL1 (PWM_ELMRx)
CMPM1 (PWM_ISR2)
CSEL2 (PWM_ELMRx)
CMPM2 (PWM_ISR2)
CSEL7 (PWM_ELMRx)
CMPM7 (PWM_ISR2)
Summary of Contents for SAM4S Series
Page 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Page 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...