user56992: Is it possible to set all 6 PWM frequencies to a value between 2 and 5 kHz?
I've read that the base frequency for pins pins 5 and 6 is 62500 Hz.
And the divisors for the pins 5 and 6 are only this ones: 1, 8, 64, 256, and 1024.
The closest I can get is 7.812,5 Hz with the 8 divisor. Are there any other possibilities to achieve this?

user7508: Judging from your mentioning 62.5 kHz as the base frequency for
pins 5 and 6, I assume you are talking about an Arduino Uno or
something similar.
If you set the timer 0 to phase correct PWM mode (which is how the
Arduino core configures the other timers), then its base frequency is
about 31.373 kHz (F_CPU/510). With the prescaler set
to 8, you get a PWM frequency of about 3.922 kHz on pins
5 and 6.
Note that you can set all three timers in this mode and have 6 PWM
channels at this frequency. But note also that by reconfiguring
Timer 0 you loose all the standard Arduino timing functions.

56992: <p>Is it possible to set all 6 PWM frequencies to a value between 2 and 5 kHz?</p>

<p>I've read that the base frequency for pins pins 5 and 6 is 62500 Hz.
And the divisors for the pins 5 and 6 are only this ones: 1, 8, 64, 256, and 1024.</p>

<p>The closest I can get is 7.812,5 Hz with the 8 divisor. Are there any other possibilities to achieve this?</p>
 7508: <p>Judging from your mentioning 62.5&nbsp;kHz as the base frequency for
pins 5&nbsp;and&nbsp;6, I assume you are talking about an Arduino Uno or
something similar.</p>

<p>If you set the timer&nbsp;0 to phase correct PWM mode (which is how the
Arduino core configures the other timers), then its base frequency is
about&nbsp;31.373&nbsp;kHz (<code>F_CPU</code>/510). With the prescaler set
to&nbsp;8, you get a PWM frequency of about&nbsp;3.922&nbsp;kHz on pins
5&nbsp;and&nbsp;6.</p>

<p>Note that you can set all three timers in this mode and have 6&nbsp;PWM
channels at this frequency. But note also that by reconfiguring
Timer&nbsp;0 you loose all the standard Arduino timing functions.</p>
