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

how to access on chip and off-chip XRAM of p89c51rd2 in c

how to access on chip and off-chip XRAM of p89c51rd2 in c

  • ... on chip and off-chip XRAM is the same just XDATA.

    Erik

  • First this is C51 not C251 (different processor although downward compatible) try to be in less of a hurry when you ask a question.

    Second there are a number of articles on this.

    Do you have a memory mapped device?

    XRAM is a misnomer (read the data sheets) it's XDATA. If you are just accessing RAM you should try using the settings in your project options

    Project->Options For Target
    Click the target tab
    Look at the right group box labeled "Off-Chip Xdata memory"
    Use that group box to add the locations of the external RAM there.

    Any variable(s) with the xdata extension will then be allocated to whatever available xdata space there is at the locations you specified.

    Example

    unsigned short xdata big_array[8192];
    


    The compiler will locate in whatever xdata space is large enough for that array.

    Stephen