We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, Would anyone please advise me the steps as how to configure the settings [startup.a51]?? so that program can access or allocate XDATA varibales in 32K memory size?? Thanking you in advance. Cheers, Simon
I use that chip a lot. Your setting of AUXR is correct. If you have any PDATA or XDATA variables that are initialized at compile time (have values prior to executing Main), you need to set AUXR in STARTUP.A51. Do it immediately after the label "STARTUP1:". STARTUP calls C_Start to initialize variables after clearing RAM. Thus, it needs to have AUXR set correctly or internal RAM will be used for the first 256/768 (RC2/RD2) bytes of XDATA. Also, be careful with P2. If you use PDATA make sure it points to the correct page for your data. Just a final note. I always add the following:
sfr CKCON = 0x8F; // Clock control register
Hi Bob, I am so glad to receive your reply and thank you so much for your kind advice. It saved me a lot of time....and now I can go to enjoy a cup of coffee. Thanks again and have a nice day. Cheers, Simon