3.3.1 How to Configure the System Clock
To use the HFINTOSC at 1 MHz, two settings must be made in the registers. First, select HFINTOSC as the oscillator source in the OSCCON1 register by writing to the NOSC bit field:
/* Set HFINTOSC as new oscillator source. */
OSCCON1bits.NOSC = 0b110;
Then, select the nominal frequency of 1 MHz in the OSCFRQ register:
/* Set HFFRQ to 1 MHz. */
OSCFRQbits.HFFRQ = 0;