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?

Parents
  • 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.

Reply
  • 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.

Children