You will not get 120KHz - the closest is 125KHz. Assuming a clock of 8MHz, this will give you 125KHz on CCP1 (RC2) with a PIC1F877A.
Code:TRISC = 0 'PORTC all outputs PR2 = 15 'Load Period Register CCPR1L = 8 'Set 50% duty cycle CCP1CON = %1100 'PWM mode T2CON.2 = 1 'Start TIMER2
Bookmarks