This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

The internal expanded RAM(XDATA) on AT89C51RB2 cannot be used

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.

Parents Reply Children
  • 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.

    marc