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?
Post the smallest complete program you have that demonstrates the problem. It is very unlikely to be a bug in the compiler but there are many possible mistakes you could have made in your code. Stefan
BTW:I have some ISRs but there is none that changes the value of the variable. Every indication is that they do: 1) do you switch the bank on every ISR? 2) do you have ISRs with different priority using same bank? Erik