For the Oscillator problem , you need to configure OSCCON register ...
The default upon reset osc freq. is 500 khz for that PIC mcu .. (That's what datasheet refers on Page 71) . To operate @ 4MHZ you must add the command line below
OSCCON=%01101000
Have a nice day




Bookmarks