I have found that the HPWM function in PBP is fairly limiting - 32.767Khz is the maximum frequency.

It is quite easy to set up the PWM registers directly. I use the following.
With a 40Mhz oscillator. This gives 158Khz PWM frequency with 8 bits of
resolution. You can get up to 10 bits of resolution at lower PWM frequencies.
Although this is for channel 1, I have set up the other channels similarly.


CCPR1L = %00010000
CCPR1H = %00000000 ' Initialize to 0, PWM register

T2CON = %00000100 ' Timer 2, Prescale 1
CCP1CON= %00001100 ' Set up for PWM

PR2 = $3F ' 8 bits of resolution at 158Khz


CCPR1L = PWMVal >> 2 'Upper 6 bits (of the 8) go here
CCP1CON.5=PWMVal.1 'Lower 2 here
CCP1CON.4=PWMVal.0