//PWM output of 32kHz 50% duty cycle at PORTC2
//Developed by: Tahmid
//1st February, 2010
//System clock: 4MHz
//Clock source: XT Crystal
void main(void){
TRISC = 0; //PORTC OUTPUT
PORTC = 0;
PR2 = 30; //~32kHz
CCPR1L = 15; //Duty cycle 50%
CCP1CON = 0x0C; //CCP1CON = 00001100, Single output, Active High
T2CON = 4; //TMR2 on, prescale = 0
while (1);
}