This piece of code made it work
DEFINE OSC 4 'Define the Osc to 8 MHz
asm
bsf OSCCON, SCS1 ; 1x = Internal Block
bcf OSCCON, SCS0 ; 00 = Primary Oscillator (20Mhz?)
bsf OSCCON, IRCF2 ; 111=8000 110=4000 101=2000
bsf OSCCON, IRCF1 ; 100=1000 011=0500 010=0250
bcf OSCCON, IRCF0 ; 001=0125 000=0032
MSTABLE010 btfss OSCCON, IOFS
bra MSTABLE010 ; wait until Oscillator is stable
endasm
Bookmarks