I am using digital pins 2 and 3 (the hardware interrupts 0 and 1) to capture a servo signal. I then need to write the translated PWM value to control 2 H-bridges for a tank drive rc vehicle. I need 4 PWM outputs for the setup I'm using to control the motors. Since 1 of the 6 PWM pins is being used as an Interrupt pin (digital pin 3), I obviously don't want to change the frequency for pwm pins 3 and 11. Also, that leaves me with enough pwm pins to control the h-bridge (5,6,9, & 10), but 5,6 and 9,10 operate at different and unmatched frequencies.
Though it works as is, the motors whine very loudly b/c 5 & 6 are default 1kHz and 9 & 10 are default 500Hz, this is too low!!
I need to change the PWM frequency on either pins 5,6 or 9,10 (or both) without affecting the external interrupts on pins 2 and 3.
I would like to change both the frequencies to as high as possible which according to this article is max 64kHz for pins 5&6 and 32kHz for pins 9&10. I understand there to be 3 timers on the Arduino. I hope I'm able to change them or I might have to get an Arduino Mega with more timers.
thanks in advance