We need a good bit more info.
Exactly which 18F PIC? Link to the data sheet.
Code? How are you doing this?
In some PICs there are options to put the Oscillator on a pin which is what I think you are doing.
You probably need to use one of the Hardware timer modules or the CCP module in PWM mode.
Have you read the PICmicro 18C MCU Family Reference Manual along with the data sheet?