Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
I assume, that you understand, that changing the PWM frequency mainly involves timer programming and also scaling of output values. You can basically make the PWM frequency (respectively period) depend on a variable value in your application. If you manage it, then it's easy to use e.g. an analog input to control it, and connect a variable resistor or potentiometer as a control.
The said additional calculations needed in set-point scaling may however reduce the performance of your PWM. A very basic method to tune the PWM frequency would be in using an external RC oscillator for the processor and tune it by a resistor. The processor will be rather slow in this case, and all processor frequency based timing and baud rates will be varied as well.