Change analogWrite() frequency

On the analogWrite() reference page (analogWrite() - Arduino Reference), it is stated that pins 3 and 11 on the leonardo run at 980Hz PWM, instead of the usual 490Hz. Is there some way to change the frequency of these pins to 490Hz?

Check - http://playground.arduino.cc/Code/PwmFrequency -

Note: not all frequencies are possible this way

Thanks.

After reading that and looking around a bit more i found out that pins 3 and 11 on the leonardo/ATmega32u4 have to do with timer0. Its base frequency is 62500, and the prescaler is normally set to 64. That gives us:

62500 / 64 = 976.5625Hz -> 980Hz

which is what we expected. The next available prescaler is 256, which gives us around 245Hz.
That doesn't exactly work for me. But, that's life.
Note that messing with timer0 will affect time keeping functions like millis()

I could be wrong somewhere, if that is the case, feel free to correct.

ilias_:
Thanks.

After reading that and looking around a bit more i found out that pins 3 and 11 on the leonardo/ATmega32u4 have to do with timer0. Its base frequency is 62500, and the prescaler is normally set to 64. That gives us:

62500 / 64 = 976.5625Hz -> 980Hz

which is what we expected. The next available prescaler is 256, which gives us around 245Hz.
That doesn't exactly work for me. But, that's life.
Note that messing with timer0 will affect time keeping functions like millis()

I could be wrong somewhere, if that is the case, feel free to correct.

On the Uno its definitely the case that timer0 is used for millis(), micros() and delay()
(but not for delayMicroseconds()), so changing it will break that functionality. timer0
controls pin 5 PWM (via OCR0A) and pin 6 PWM (via OCR0B)

You have to check with datasheets for other processors pin outs.

What about the software PWM?
e.g. - http://forum.arduino.cc/index.php/topic,19451.0.html -

What about the software PWM?
e.g. - http://forum.arduino.cc/index.php/topic,19451.0.html -

The SoftPWM library has a frequency of 60Hz, i was looking for something in the 400Hz range (i need to drive electronic speed controllers). I would have sticked with the Servo library otherwise (it's 50Hz). Moreover, it seems to be very CPU hungry, especially if i attempt to make the frequency higher.

The other pwm pins on the Leonardo are the usual 490 HZ

The other pwm pins on the Leonardo are the usual 490 HZ

I'm aware of that. I cant use pins 9 and 10 for some complicated reason, that leaves me with 3 pins, which is not enough for 4 motors.

I decided to move the project to the uno, mainly because of the frustration of a lot of libraries that would easily do the job not supporting the leonardo/atmega32u4.