My configuration bits are as follows:
#include <P16F1503.inc>
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _BOREN_OFF & _CLKOUTEN_OFF
__CONFIG _CONFIG2, _WRT_OFF & _STVREN_OFF & _LVP_OFF
The relevant part of code I am using for changing the frequency is this:
banksel OSCCON
movlw b'01101000' ; Int. osc. 4 MHz
movwf OSCCON
btfss OSCSTAT, HFIOFR ; Is internal oscillator running?
goto $-1 ; No, loop one line back...
btfss OSCSTAT, HFIOFS ; Is internal oscillator stable?
goto $-1 ; No, loop one line back...
My debug tool is unfortunately just simulator. The problem is, that execution never reachreaches the breakpoint on line 192:
So this means, that internal oscillator never gets stable?
I am using:
- IDE: MPLAB X IDE v1.20
- Compiler: MPASM v5.45
What am I doing wrong?