I have seen the following sample code from microchip
I am bit confused about this.
The first instruction is
_FOSCSEL(FNOSC_FRC); which means from the header file Internal Fast RC (FRC).
the next instruction is
_FOSC(FCKSM_CSECMD & OSCIOFNC_OFF & POSCMD_XT); the POSCMD_XT in the header file refers to XT Oscillator Mode. Why should i switch from internal FRC to external Oscillator mode, directly can i go to External oscillator mode? Can I avoid the first statement? Please suggest.
Code:
_FOSCSEL(FNOSC_FRC);
_FOSC(FCKSM_CSECMD & OSCIOFNC_OFF & POSCMD_XT); // Clock Switching is enabled and Fail Safe Clock Monitor is disabled
// OSC2 Pin Function: OSC2 is Clock Output
// Primary Oscillator Mode: XT Crystal
_FWDT(FWDTEN_OFF); // Watchdog Timer Enabled/disabled by user software
I am bit confused about this.
The first instruction is
_FOSCSEL(FNOSC_FRC); which means from the header file Internal Fast RC (FRC).
the next instruction is
_FOSC(FCKSM_CSECMD & OSCIOFNC_OFF & POSCMD_XT); the POSCMD_XT in the header file refers to XT Oscillator Mode. Why should i switch from internal FRC to external Oscillator mode, directly can i go to External oscillator mode? Can I avoid the first statement? Please suggest.