Hi! I'm using Philips P89v51RD2FBC microcontroller. I build my project using Keil version 2.0. After compilation, total memory utillization is: Data: 155.2, Xdata: 327, Const: 2062, Code: 23176
Eventhough there is a free memory space in Data as well as in Xdata(MCU XRAM) memory, still I'm facing problems in accessing variables declared as "far" in MCU XRAM. i.e. the value of these variables get corrupted.
So, kindly help me in solving this problem.
Regards, Kshama.
Look up your chip in the Keil Database:
http://www.keil.com/dd
it will recommend a startup file.
Thank you. I visited the link. But it doesn't give any information about which startup file has to be added.
Also as you have mentioned earlier XRAM has to be enabled through SFR, I have already enabled the MCU XRAM by making AUXR SFR 0x00.
Could you please help me further as I have stuck just due to declaration problem.
"Also as you have mentioned earlier XRAM has to be enabled through SFR [...]"
It is time for you to start look closer at details. Andy did not say that XRAM _has_ to be enabled. He did write "if your chip requires [...]". Notice the conditional "if".
Not all chips needs any configuration to enable XRAM. And _if_ your specific chip needs it, then I would recommend you to read the datasheet for your specific chip. That document will contain the relevant information on how to turn on the XRAM. Maybe Keil already has a startup file with such initialization (IF it is needed), but you really should read up on your chip, so you know what happens.
I'm sorry - you're right!
http://www.keil.com/dd/chip/3711.htm
It tells you which header file to use - not which startup file!
D'oh!
However, when you create a new Project in uVision, and choose your CPU, that will automatically select the appropriate standard startup file.
The list of standard startup files, and instructions on how to customise them, is here: http://www.keil.com/support/man/docs/c51/c51_ap_startup.htm