The OSCCON register allows you to select between different clock sources, depending on the lower two bits SCS1:SCS0...
00 = primary osc (the one set by CONFIG1H)
01 = secondary osc (TIMER1)
1x = internal osc
The code in #304 sets
OSCCON = %01110000 (0x70), so the lower two bits tell it to use the primary CONFIG1H osc setting, which in this case is
Define CONFIG1H = 0x06 '8mHz XTL x4 =32MHz. The comment is correct for that...
0110= HS oscillator, PLL enabled (clock frequency = 4 x FOSC1)
As long as you have an 8MHz xtal you should already be running at 32MHz with those settings.
All of the existing TMR/CCP settings in that code seem to match with that.
The only thing that doesn't is the UART setting, which is shown as:
Code:
'setup USART for 9600 baud receive
RCSTA = %10010000
TXSTA.BRGH = 1
BAUDCON.BRG16 = 1
SPBRG = 207
At 32MHz those register settings will get you a baud rate of 38400, not 9600 as the comment claims.
If you want 9600 baud then change the line to
TXSTA.BRGH = 0
If you comment out the 'OSCCON = %01110000
' in the above code nothing should change.
You shouldn't need to change anything.