I have a project using a PIC18F26K20, and I am trying to use the internal Oscillator at 16 MHz. But no matter what I do it always runs at 32 kHz. My configuration is:
#pragma config FOSC = INTIO67 // Internal Oscilaor RA6 RA7 ports
#pragma config WDTEN = OFF // Watchdog Timeer disabled
#pragma config HFOFST = ON // HFINTOSC Fast Start-up:
#pragma config PWRT = OFF // Power-up Timer Enable bit: OFF
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable bit:
#pragma config IESO = ON // Internal/External Oscillator Switchover bit ON
in code:
OSCCON=0xf7; // Internal Oscillator Hi
OSCTUNE=0x00;
Can anyone tell me what I am missing to set internal oscillator to 16 MHz?