This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Strange problem with variable

HI all.
I am developing a programm with the demo version of the keill compiler.The µ-Controller is a cygnal 8051(c8051f124).
I have faced a very strange behavior:

int Pack_Counter=0;
...
if(Pack_Counter>0){
...//I set a breakpoint here
}
when i run the program it sometimes(strange again)stops at the breakpoint.When i watch the value of the variable it is 0 as it should->The Comparison is false->The program should not interrupt.

BTW:I have some ISRs but there is none that changes the value of the variable.

Does anyone have an idea?

0