I am writing an application for the Arduino Mega and I need any 2 of the PWM outputs to ouput a frequency above 20kHz. I have found
TCCR2B = TCCR2B & 0b11111000 | 0x01;
from http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235060559/12 which sets the frequency of pins 3 and 11 to 31250Hz but this is not for the Mega and I'm assuming the timers and outputs are mapped differently. Please let me know how I can change the PWM frequencies for the Arduino Mega.