

I set that to be disabled already with #pragma config WDT = OFF along with all the other pragma config stuff. TRISCbits.TRISC7 = 0 The only thing that I can think of this being is the watch dog timer (although thats basically a guess). TRISCbits.TRISC6 = 0 //define NSel as output TRISCbits.TRISC5 = 0 // define SDO pin as output TRISCbits.TRISC4 = 1 // define SDI pin as input SPI_CONNECTION_INDICATOR = 0 /*To indicate succesful SPI connection*/ĭETECTION_INDICATOR_LED = 0 /*To indicate Cricket detection*/ TRISCbits.TRISC3 = 0 // define clock pin as output After you click on the main.c file, this window will open.

The easiest way to add source will is through a project window option.

PROGRAM_LOAD_INDICATOR_LED = 0 /*To indicate succesful power on and program load*/ Before writing the first program with the MPLAB XC8 compiler, we need to add a source file or C file in the project. TRISBbits.RB5 = 0 /*Turn off Indicator LEDs */ TRISCbits.RC0 = 1 /*Set a pin as input for rising edge detection. Microchip in-circuit debugger that works with MPLAB IDE/MPLAB X IDE. TRISBbits.RB0 = 1 /*Set a pin as input for rising edge detection*/ PIC18 C Compiler An unnamed structure that is a member of a C union. The first (ie from the start if main) section of my code in which the debugger gets hijacked into ReadTimer1 and then stops there is: (in the actual code these lines are put in functions, but i de-abstracted them just so it can be seen exactly whats going on) OSCCON = 0x00 /*Use primary oscillator/clock input pin*/ TRISCbits.RC2 = 0 Hello, Whenever I debug my program (MPLAB X, XC8 compiler) in the mplab x simulator, and step through the code, it randomly gets thrown to the ReadTimer1 function, and often gets stuck in there. XC8 MPLAB x debugging getting hijacked by random function
