I try to obtain 120 KHz carrier signal with using pwm module of pic 16f877 . PWM uses timer2 and maximum frequency value is 250 Hz because pr2 maximum value is 255 and postscale maximum value is 16. And the formula is :
Tpwm=Tcommand*(pr2 + 1)*(tmr2 division ratio)
And here is the code below. How can i obtain 120KHz signal with pwm. By the way i work with ccs-c
this program should help you a lot: **broken link removed**
warning: there seems to be a bug there you should set the date of your computer to 2009. dont want to start for me if it is 2010 ...