I am using AT89C51. Due to memory overflow I decided to use XDATA variables. Compilation shows no errors, but when I put the HEX files to the controller it will not work. At the stage where the XDATA variables are used, the system collapses and the giving unexpected results. I am using DS1644 time keeping Ram for external storage and for XDATA. What is the problem with my system. Is it need any internal settings or my controller is not suited for this pupose? Please give me a clue. My code is given below:
char xdata sum[12]; char xdata rtc[21];
when sum or rtc are used the system will give unexpected reults. Please help me.
I would like to know about nature of XDATA. When I declared variable as XDATA , it onlt resets when power is off. Otherwise it holds the previous value.Is it possible to use XDATA variables as nomal variables after declaration? If it is not possible by simply declaring, how can I use them as normal variables? Is it need any other settings? What will happen if I use large model? When I did so, compilation found to be OK but not working in the hardware. Is this a usual thing?
Ram can not hold nothing. If you can the same function from the same place the RAM location assigned to a variable will be the same address. If nothing over wrote since the last call it will be the same. You can not count on this behavior. Uninitialized variables can contain any number, the are undefined.