I have the function below that is compiling without errors or warnings yet part of the code is not executing in the debugger.
I am using the XCB compiler V1.21 in MPLaBX V2.0
My chip is the PIC18F14K22.
If I set a breakpoint at the line "ones = val;" then I get a Broken Breakpoint in the IDE when the code starts to execute.
If I add a breakpoint on the line that calls display_setRefrigeratorValue and step into display_setRefrigeratorValue then it steps to the line ones = val within the while loop.
I also noticed that I cannot pause my code.
If I add the line int "m = 123;" after "ones = val;" then all works fine. The breakpoint works and I can pause the code.
At first I thought it might be a bad memory location (even though the chip verifies OK) so I changed out the chip with the same results. I also added a function with the same code but got similar results.
Any ideas what the heck is going on???
I am using the XCB compiler V1.21 in MPLaBX V2.0
My chip is the PIC18F14K22.
If I set a breakpoint at the line "ones = val;" then I get a Broken Breakpoint in the IDE when the code starts to execute.
If I add a breakpoint on the line that calls display_setRefrigeratorValue and step into display_setRefrigeratorValue then it steps to the line ones = val within the while loop.
I also noticed that I cannot pause my code.
If I add the line int "m = 123;" after "ones = val;" then all works fine. The breakpoint works and I can pause the code.
At first I thought it might be a bad memory location (even though the chip verifies OK) so I changed out the chip with the same results. I also added a function with the same code but got similar results.
Any ideas what the heck is going on???
Rich (BB code):
void display_setRefrigeratorValue(int val)
{
unsigned char tens;
unsigned char ones;
ones = val; // If breakpoint is set here, I get Broken Breakpoint, unless the line below is not commented.
// int m = 123; If this line is uncomented then code executes as expected.
while (val >= 10)
{
tens++;
val -= 10;
ones = val; //Code steps to here if breakpoint is set where display_setRefrigeratorValue is being called.
}
val = ones;
display_select(3);
unsigned char portVal = DISPLAY_VALUE & 0xf0;
DISPLAY_VALUE = portVal | (val);
val = tens;
display_select(2);
unsigned char portVal = DISPLAY_VALUE & 0xf0;
DISPLAY_VALUE = portVal | (val);
}
Last edited: