2.9.1 Timer Mode Descriptions
2.9.1.1 PWM Output (16-Bit, Mode 0)
Outputs a pulse width modulated rectangular wave output. Value passed should be 0-65535,
and determines what portion of the total time is spent low (out of 65536 total increments). That
means the duty cycle can be varied from 100% (0 out of 65536 are low) to 0.0015% (65535 out
of 65536 are low).
The overall frequency of the PWM output is the clock frequency specified by
TimerClockBase/TimerClockDivisor divided by 2
16
. The following table shows the range of
available PWM frequencies based on timer clock settings.
TimerBaseClock Divisor=1 Divisor=256
0 4 MHz 61.04 N/A
1 12 MHz 183.11 N/A
2 48 MHz (Default) 732.42 N/A
3 1 MHz /Divisor 15.26 0.060
4 4 MHz /Divisor 61.04 0.238
5 12 MHz /Divisor 183.11 0.715
6 48 MHz /Divisor 732.42 2.861
PWM16 Frequency Ranges
Note that the clocks above apply to the U3 hardware revision 1.21. With hardware revision 1.20
all clocks are half of those values.
The same clock applies to all timers, so all 16-bit PWM channels will have the same frequency
and will have their falling edges at the same time.
PWM output starts by setting the digital line to output-low for the specified amount of time. The
output does not necessarily start instantly, but rather waits for the internal clock to roll. For
example, if the PWM frequency is 100 Hz, that means the period is 10 milliseconds, and thus
after the command is received by the device it could be anywhere from 0 to 10 milliseconds
before the start of the PWM output.
2.9.1.2 PWM Output (8-Bit, Mode 1)
Outputs a pulse width modulated rectangular wave output. Value passed should be 0-65535,
and determines what portion of the total time is spent low (out of 65536 total increments). The
lower byte is actually ignored since this is 8-bit PWM. That means the duty cycle can be varied
from 100% (0 out of 65536 are low) to 0.4% (65280 out of 65536 are low).
The overall frequency of the PWM output is the clock frequency specified by
TimerClockBase/TimerClockDivisor divided by 2
8
. The following table shows the range of
available PWM frequencies based on timer clock settings.
32
TimerBaseClock Divisor=1 Divisor=256
0 4 MHz 15625.00 N/A
1 12 MHz 46875.00 N/A
2 48 MHz (Default) 187500.00 N/A
3 1 MHz /Divisor 3906.25 15.259
4 4 MHz /Divisor 15625.00 61.035
5 12 MHz /Divisor 46875.00 183.105
6 48 MHz /Divisor 187500.00 732.422
PWM8 Frequency Ranges