Hi,
I have basic PIC18F25K20 circuit using 12 MHz oscillator and debug output like this:
while(1){
NOP();
LATBbits.LATB5 = 1;
NOP();
LATBbits.LATB5 = 0;
}
The chip is resetting every few ms. When I connect MCLR pin to Vdd (it's 5V) it stops resetting. MCLR is disabled using:
#pragma config MCLRE = OFF // disable reset from MCLR
To be sure I read the device and these are the config words (from config1 to config7):
0600
1410
0C00
0001
C00F
E00F
400F
config3 bit 15 is 0
Watch dog and Brown-out Reset are disabled.
I guess a software instruction could reset the chip, but it stops resetting when I pull up MCLR to Vdd. Also if I pull down MCLR it is held in reset - like if it was enabled. The program is pretty simple. Interrupts are disabled. I can't think of a reason why the chip should reset. I checked errata - nothing there about MCLR. Any ideas?