Atmel Xplained Pro Evaluation Kit ATSAM4E-XPRO ATSAM4E-XPRO Data Sheet
Product codes
ATSAM4E-XPRO
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
1032
40.6.2.7 Spread Spectrum Counter
The PWM macrocell includes a spread spectrum counter allowing the generation of a constantly varying duty cycle
on the output PWM waveform (only for the channel 0). This feature may be useful to minimize electromagnetic
interference or to reduce the acoustic noise of a PWM driven motor.
on the output PWM waveform (only for the channel 0). This feature may be useful to minimize electromagnetic
interference or to reduce the acoustic noise of a PWM driven motor.
This is achieved by varying the effective period in a range defined by a spread spectrum value which is
programmed by the field SPRD in the
programmed by the field SPRD in the
(PWM_SSPR). The effective period of the
output waveform is the value of the spread spectrum counter added to the programmed waveform period CPRD in
the
the
(PWM_CPR0).
It will cause the effective period to vary from CPRD-SPRD to CPRD+SPRD. This leads to a constantly varying duty
cycle on the PWM output waveform because the duty cycle value programmed is unchanged.
cycle on the PWM output waveform because the duty cycle value programmed is unchanged.
The value of the spread spectrum counter can change in two ways depending on the bit SPRDM in the
PWM_SSPR.
PWM_SSPR.
If SPRDM = 0, the mode TRIANGULAR is selected:
The spread spectrum counter starts to count from -SPRD when the channel 0 is enabled or after reset and counts
upwards at each period of the channel counter. When it reaches SPRD, it restarts to count from -SPRD again.
upwards at each period of the channel counter. When it reaches SPRD, it restarts to count from -SPRD again.
If SPRDM = 1, the mode RANDOM is selected:
A new random value is assigned to the spread spectrum counter at each period of the channel counter. This
random value is between -SPRD and +SPRD and is uniformly distributed.
random value is between -SPRD and +SPRD and is uniformly distributed.
Figure 40-10. Spread Spectrum Counter
40.6.2.8 Additional Edges
The PWM macrocell is able to generate additional edges of the channel output waveform by inverting the
waveform polarity CPOL, in top of these generated by the duty cycle value.
waveform polarity CPOL, in top of these generated by the duty cycle value.
There are several complementary ways in order to invert the polarity:
By inverting the polarity at any time:
Write a new value for CPOL in the
Write a new value for CPOL in the
PWM Channel Mode Register
. The polarity of the output waveform
changes immediately.
By inverting the polarity at the next PWM period border:
Write the field CPOLUP in
Write the field CPOLUP in
the PWM Channel Mode Update Register
. The polarity will be updated
synchronously with the PWM period. If you want to invert the polarity whatever the current polarity is, write a
Period Value: CPRD
CPRD-SPRD
CPRD+SPRD
Duty Cycle Value: CDTY
0x0
Max value of the channel counter
Variation of the
effective period
effective period