Step by Step...

Firstly Defines come first... by default PBP assumes 4MHz clock, so you don't need to have a DEFINE OSC statement unless your clock is other than 4MHz.

Secondly, let's set the PIC up for internal oscillator and no MCLR (MCLR pin can be used as an Input)...

@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT
' System Clock Options
@ DEVICE pic16F628, WDT_ON
' Watchdog Timer
@ DEVICE pic16F628, PWRT_ON
' Power-On Timer
@ DEVICE pic16F628, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic16F628, BOD_ON
' Brown-Out Detect

Now we have our PIC configured, we need to configure the pins... let's say we want a Blinky LED on PortB.0 and of course our HPWM will fall out of PortB.3...

LED var PortB.0
' Put a LED on this Port Pin
CMCON=7
' This assigns all pins Digital but it only affects PortA, so if
' you're not bothered with PortA this is irrelevant
TRISB=%00000000
' I've assigned ALL of PortB as Output,
' I only need to have done that for B.0 and B.3
Pause 200
' A large Pause at startup is only needed to wake-up sluggish
' external devices like LCD's...
HPWM 1,127,1000
' Yup, this will give 1kHz at 50% Duty
Loop:
Toggle LED
Pause 500
Goto Loop

End

This blinks an LED (somebody else wanted to know how to set up a 16F628 to do that so it answers that query as well), while at the same time it will permanently output your PWM train in background.

Melanie