Hi All, I am using Winbond W77IE58 chip. When i am using xdata variable as global variable, i am getting some junk data. (i.e) I have declared a char array unsigned char xdata test[] = "TEST CHARACTERS" as global variable. Then when, i am trying to send the same data to the serial port, i am not getting the same data. It is giving different data. If i removed xdata, then im getting correct data. But if i declare some array as local xdata variable, the iam getting correct data on the serial port. Only if i declared as global varible it is giving some different data. I have enabled the DME0 bit also to enable on-chip XRAM. Thanks in advance.
Are you including the static initializer startup code (INIT.A51) in your project? Strings constants are often kept in code memory to avoid having to copy them from ROM to RAM. Can you read and write these xdata locations from your debugger? That is, are you sure the hardware works?
Debugger also confusing me. Because, if i enable DME0 bit, then all the values in that xdata varible becomes zero. Otherwise, i could get the correct data in SBUF register while i am sending to the serial port. But both the cases, if i put it to the hardware not getting correct data. I have not included INIT.a51 in my project. Is it neccessary to include? Thanks in advance.
hai, when iam using both on chip RAM and XRAM global variables which are stored in RAM are gettining reset to null value as soon as i move to another function from main. regads ratna.