page 89
Calculating the RELOAD value
The reload value of the internal PWM counter is calculated as
follows based on the input DIV64:
DIV64 = 0: f
PWM
= 10.00 MHz / Reload
DIV64 = 1: f
PWM
= 156.25 kHz / Reload
The input DIV64 has to be set to 0 or 1 depending on whether a
high or a low PWM frequency is required. For PWM frequencies
< 152 Hz DIV64 has to be set to 1 so that the reload value does
not get bigger than FFFF Hex.
Example
The PWM frequency should be 200 Hz.
10 MHz
Reload value
⇒
----------- = 50000
⇒
C350 Hex
200 Hz
The permissible range for the PWM value is
from 0000 Hex to C350 Hex
The comparative value at which the output switches has to be
between 0000 Hex and C350 Hex.
This results in the following pulse / break ratios:
minimum pulse / break ratio (0 % on): C350 Hex
maximum pulse / break ratio (100 % on): 0000 Hex
50000 intermediate values (PWM values) are possible between
maximum and minimum.
PWM channels 4 ... 7
These four PWM channels can only be set to a common PWM
frequency. The functions PWM and PWM100 must not be
mixed during programming.