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?
Maybe some more details: I use the default(small)memory model,but i declare some variables and arrays as idata or xdata. ->Can this cause any problems? Some weeks ago there was a similar problem: I have an array of 20 bytes.When returning the adress of it from a function i had to realize that some bytes were overwritten by ghosthand. Don't say: buy the full version as i read sometimes as proposals! I will surely not buy a program that makes such mistakes(if these are bugs).So i would like to hear some ideas especially of the developers of keill in order to convince me to buy the C51 compiler.
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
View all questions in Keil forum