If you need to run at 4Mhz on the internal OSC, put this in your code.



Code:
ASM
       movlw 0x62                              ; %0110 0010  = 4 Mhz, internal osc block
       movwf OSCCON
       movlw 0x80                              ; %1000 0000  = PLL disabled
       movwf OSCTUNE
ENDASM
I have a development board that runs at 40Mhz on a 10Mhz XTAL + PLL, but sometimes I need to slow things down to 4Mhz and run on the internal oscillator to see how they will run on "little" parts. This code does the trick.