Quote Originally Posted by rmteo View Post
Yes, he can get 120KHz with a standard 12MHz crystal and setting PR2 = 24.
I don't remember the PR2 value, but I got the same thing using a 9.6Mhz crystal.
Your solution is better though...standard crystal and supported by PBP.

I think his problem is that he does not seem to be able to get more than 50KHz with HPWM. It may be a PBP thing, I don't know
PBP itself won't allow over 32Khz unless using LONG variables (PBPL 2.50), then you can (in theory) get 2Ghz out it...obviously won't happen...or will it? (see below or above whichever)
He's trying to do a square wave manually (bit high, wait, bit low, wait, repeat), bit bang the pins.

that is why I suggested setting up the HPWM manually. With a 8Mhz clock, you can get up to 500MHz PWM, albeit with little to no resolution on the duty cycle.
WOW! 500MHZ from 8MHZ! I want your chip!