i try to generate a 120khz signal using pin 17(rc2/ccp1) of pic16f877a.i use 8Mhz osc.the code as shown below(search from internet):

void main()
{
TRISC = 0 ;

/*
* PWM registers configuration
* Fosc = 8000000 Hz
* Fpwm = 117647.06 Hz (Requested : 120000 Hz)
* Resolution is 6 bits
* Prescaler is 1
* Ensure that your PWM pin is configured as digital output
* see more details on http://www.micro-examples.com/
* this source code is provided 'as is',
* use it at your own risks
*/
PR2 = 0b00010000 ;
T2CON = 0b00000100 ;
CCPR1L = 0b00001000 ;
CCP1CON = 0b00011100 ;
}

are those coding will work.can someone help me briefly translate it into basic pro language cause i use microcode studio basic pro to compile.hope mr skimask would help me once again.