I am using a PIC18F45K20 to take in an external oscillation from a 25Mhz crystal instead of using the internal clock. However, what do I include in the code to set this external oscillator as an input (I presume OSC1 on PIC device)? Below are the typical config pragmas I have in a .h file.
// CONFIG1H
#pragma config FOSC = HSPLL
#pragma config FCMEN = OFF
#pragma config IESO = OFF
// CONFIG2L
#pragma config PWRT = OFF
#pragma config BOREN = SBORDIS
#pragma config BORV = 18
// CONFIG2H
#pragma config WDTEN = OFF
#pragma config WDTPS = 32768
// CONFIG3H
#pragma config CCP2MX = PORTC
#pragma config PBADEN = ON
#pragma config LPT1OSC = OFF
#pragma config HFOFST = ON
#pragma config MCLRE = ON
// CONFIG4L
#pragma config STVREN = ON
#pragma config LVP = OFF
#pragma config XINST = OFF
// CONFIG5L
#pragma config CP0 = OFF
#pragma config CP1 = OFF
#pragma config CP2 = OFF
#pragma config CP3 = OFF
// CONFIG5H
#pragma config CPB = OFF
#pragma config CPD = OFF
// CONFIG6L
#pragma config WRT0 = OFF
#pragma config WRT1 = OFF
#pragma config WRT2 = OFF
#pragma config WRT3 = OFF
// CONFIG6H
#pragma config WRTC = OFF
#pragma config WRTB = OFF
#pragma config WRTD = OFF
// CONFIG7L
#pragma config EBTR0 = OFF
#pragma config EBTR1 = OFF
#pragma config EBTR2 = OFF
#pragma config EBTR3 = OFF
// CONFIG7H
#pragma config EBTRB = OFF
#define _XTAL_FREQ 25000000
#ifndef MCC_H
#define MCC_H
#include <xc.h>
#include "pin_manager.h"
#include <stdint.h>
#include <stdbool.h>
#include "eusart.h"
However, when I try to build this, I get errors:
mcc_generated_files/mcc.h:46: error: (1389) attempt to reprogram configuration setting "FOSC" with HSPLL (is HSPLL)
mcc_generated_files/mcc.h:68: error: (1389) attempt to reprogram configuration setting "LVP" with OFF (is OFF)
Am I doing something wrong? What do these errors even mean? All I want to do is change from using the internal clock to using an external 25Mhz crystal.