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

On-Chip XRAM Question

Dear Sir,

It may be a simple question.
I am using Atmel AT89C51ID2 for the development. The MCU having 256 Bytes Scratch Pad RAM and 1792 bytes on-chip XRAM, totally 2048 bytes of RAM. I am using uVsiion V2.40a with C51 V7.20. I can find the device and chose it in uVision. As our program will use more then 1792 bytes of RAM, after I compile the source code, it shows:
Program Size: data=9.5 xdata=1802 code=825
0 WARNING(S), 0 ERROR(S)

In the .lst file, it shows:

MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 719 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 1798 4
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = 5 ----
END OF MODULE INFORMATION.

It seems have not problem as no warning and no error. But it shows larger then 1792 bytes in the XDATA (XRAM). I would like to know :

1) Is it normal? Does the program can run without any known hiding problem?

2) Does C51 can automatically assign the usage of RAM so that I can fully use the 1792 bytes of XRAM and 256 bytes of Scratch Pad RAM at the same time? or just can use 1792 bytes of XRAM or 256 bytes of Scratch Pad RAM and cannot use them at the same time?

Thank you very much for your kindly help.

P.S. I select the Memory Model as "Large" and didn't click the "Use on-Chip XRAM (0x0-0x6FF)" box.

Parents
  • Looks like you are using the LARGE memory model. ... Now you should have a look at the C51 User Guide and find the chpater about the keywords 'idata' and 'data'. These allow to explicitly move variables into DATA and IDATA.

    Even better, switch to the small model and start using the keyword XDATA.

    With the LARGE model, reducing XDATA by using DATA and IDATA will usually result in random variables being moved to "fast memory".
    With the SMALL model, where you explicitly move data to "slow memory" you have a better chance of getting the vatiables in the right places such as
    very frequently used: DATA
    frequently used: IDATA
    rarely used: XDATA

    Erik

Reply
  • Looks like you are using the LARGE memory model. ... Now you should have a look at the C51 User Guide and find the chpater about the keywords 'idata' and 'data'. These allow to explicitly move variables into DATA and IDATA.

    Even better, switch to the small model and start using the keyword XDATA.

    With the LARGE model, reducing XDATA by using DATA and IDATA will usually result in random variables being moved to "fast memory".
    With the SMALL model, where you explicitly move data to "slow memory" you have a better chance of getting the vatiables in the right places such as
    very frequently used: DATA
    frequently used: IDATA
    rarely used: XDATA

    Erik

Children