![](http://datasheet.mmic.net.cn/100000/IF180C52TXXX-20R_datasheet_3493957/IF180C52TXXX-20R_522.png)
522
32099I–01/2012
AT32UC3L016/32/64
zero). When the timebase counter reaches its effective top value, it restarts counting from zero.
The period of the PWMA output waveform is then:
The timebase counter can be reset by writing a one to the Timebase Clear bit in CR (CR.TCLR).
Note that this can cause a glitch to the output PWM waveforms in use.
23.6.3
Spread Spectrum Counter
The spread spectrum counter allows the generation of constantly varying duty cycles on the out-
put PWM waveforms. This is achieved by varying the effective top value of the timebase counter
in a range defined by the spread spectrum counter value.
When CR.SPREAD is not zero, the spread spectrum counter is enabled. Its range is defined by
CR.SPREAD. It starts to count from - CR.SPREAD when the PWMA is enabled or after reset
and counts upwards. When it reaches CR.SPREAD, it restarts to count from -CR.SPREAD
again. The spread spectrum counter will cause the effective top value (ETV) to vary from TOP-
varying duty cycle on the PWM output waveforms though the duty cycle values stored are
unchanged.
Figure 23-2. PWMA Adjusting Top Value for Timebase Counter
23.6.3.1
Special considerations
The maximum value of the timebase counter is 255. If SPREAD is written to a value that will
cause the ETV to exceed this value, the spread spectrum counter’s range will be limited to pre-
vent the timebase counter to exceed its maximum value.
If SPREAD is written to a value causing (TOP-SPREAD) to be below zero, the spread specturm
counter’s range will be limited to prevent the timebase counter to count below zero.
In both cases, the SPREAD value read from the Control Register will be the same value as writ-
ten to the SPREAD field.
TPWMA
ETV 1
+
() TGCLK
=
0x0
0xFF
Duty Cycle
-SPREAD
SPREAD
TOP
Adjusting top value range
for the timerbase counter