Variable frequency PWM is limited
Answers
-
The reasons we limit PWM variable range from ¼ to 4 times are as follows:
- Set a bigger multiplier may affect PWM period accuracy (especially for higher frequency).
- When PWM period changes to a small interval, PWM interrupt may become too busy.
For example, the base PWM frequency is 10KHz, the interrupt routine execution time is 20us.
When PWM frequency is changed to 40KHz, the PWM period becomes 25us. The 20us interrupt routine
is a big burden for the system(only 5us for other tasks).
- When allowing low frequency in variable frequency, the generated code needs to change multiple registers
that increases the overhead of frequency change.
1 -
Albert Dunford_20896 said:
The reasons we limit PWM variable range from ¼ to 4 times are as follows:
- Set a bigger multiplier may affect PWM period accuracy (especially for higher frequency).
- When PWM period changes to a small interval, PWM interrupt may become too busy.
For example, the base PWM frequency is 10KHz, the interrupt routine execution time is 20us.
When PWM frequency is changed to 40KHz, the PWM period becomes 25us. The 20us interrupt routine
is a big burden for the system(only 5us for other tasks).
- When allowing low frequency in variable frequency, the generated code needs to change multiple registers
that increases the overhead of frequency change.
Thank you for the good suggestion.
0