I assume you have a proper copy of PBP and with it came a manual? Look up the HPWM command. It comes complete with examples in the manual. Your PIC16F877 has TWO PWM channels (look at the Datasheet), HPWM will be able to activate either one or both. Once you invoke HPWM, it keeps running in background regardless what else is happening until you change or stop it. This allows you to take new ADC reading and refresh your LED Displays without the PWM interfering.