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

Large XRAM paging

Hi

I would like to know, is there in C51 any support for XRAM paging, I have 512KB SRAM connected as 8 x 64 KB pages (I'm using standart 8051 MCU), and now I have a problem - when I'm accessing not 0 page, I must all times switching to page 1..7 and must beware of using XRAM variables (they are in page 0 by default), how can I solve this problem ?

  • Check the manuals for the description of "far" memory.

    You'll need to modify the example XBANKING.A51 file to suit your extended addressing hardware. You then declare anything beyond the lowest 64KB of xdata as far. The toochain takes care of the rest.

    Note that far addresses will not have the value you probably think they do. Thanks to the many address spaces on the 8051, Keil's extended pointer format uses a tag and a value. For whatever historical reasons, the tag value for xdata is 1, and far memory goes up from there. So, a pointer cast to an integer will seem to be 10000H higher than you probably expect. See the header file absacc.h for FVAR and FARRAY macros.