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.
Hello everybody, I am testing a program for AT89S54(AT89C51RB2) with uVision2.As you konwn,this chip has 768 bytes expanded RAM(XRAM).I want to use the XRAM for my program,but the XRAM space cannot be accessed. The site of AT89C51RB2:") REGFILE=AT89C51RB2.H("Atmel") SFILE="STARTUP.A51" ("Standard 8051 Startup Code") SIM=S8051.DLL DP51.DLL("-pATRB2") ____________________________________________________
And in the option of my project,I have defined as below. Selected__________________________________ _______Memory Model:[Large:varialble in XDATA] Checked BOX______________________ _______Use On-chip XRAM(0x0-0x3FF)
What should I do for setting uVision2?
Thanks in advance.
Hi erik, thanks for your replying.
ipdata is a dummy buffer only,it has no any effect.I have tested the case of no ipdata.I defined this array to let the data size of my program as 256 just.
The array number :100 is decimal,not hex.
marc
The array number :100 is decimal,not hex. my point exactly. how does an array nof 100d result in xdata=256. OH you are using the large model, I just can't visualize anyone doing that. That may explain the above.
anyhow, to use a chips "internal external data" :) you usually have to set some bit in some SFR in the beginning of startup (check your chips datasheet). It is a common misconception that that is done automatically by the assembler/compiler/linker.
Erik
Most people on this forum are very good with hexadecimal numbers.
What Erik wants to know is why an example program that allocates 100d bytes consumes 256d bytes (0x100) - what has consumed the remaining 156d bytes of XDATA space?
Hi, Most people on this forum are very good with hexadecimal numbers. OK.I'll do it so.
OH you are using the large model, I just can't visualize anyone doing that. That may explain the above.
And in my program,
#include <AT89C51RB2.h> extern void DispByteData(unsigned char arii); unsigned char ipdata[142]; #define XNUM 100 unsigned char xdata xbuf[XNUM];
The memory is used apparaently as below. ______1d + 142d + 100d = 243d (bytes) About the rest of part ______256d-243d=13d (bytes) I will recompile my program in another mode,and report the result.