Keil Logo

MON51: Using Large XDATA and CODE Areas


Information in this article applies to:

  • C51 Version 7 and later

QUESTION

I'm using Monitor-51 with the following configuration:

  • 0000h-2000h: Flash Memory for Monitor-51 code.
  • 2000h-FFFFh: von Neumann wired code/xdata.

This configuration works but I will need more space for code and my application requires lots of xdata memory. Is it possible to expand the memory space as follows?

  • 0000h-2000h: Flash Memory for Monitor-51 code.
  • 2000h-FFFFh: RAM for code only.
  • 0000h-FFFFh: RAM for xdata only.

As you can see, I will have about 128K of RAM in my design. 56K for program von Neumann space and 64K for xdata space. I can easily add mapping logic to my hardware. So, from the hardware point of view, this is easy for me to do. Is there a way to implement this in the monitor?

ANSWER

Yes, the Monitor-51 that is part of PK51/DK51 Version 7 and later provides the function WR_CODE in the INSTALL.A51 file. You may modify this function to swap-in the von Neumann memory, write to it, and swap it back out.

The Monitor-51 that comes with PK51/DK51 Version 7 and later has been modified to call only this function to modify code memory and the monitor data area (which must also be located in the von Neumann area). Making the required changes to the WR_CODE function is all that is required.

For example, if your hardware enables writing into the code memory when I/O port P3.7 is low, you can adapt this function like as follows:

WR_CODE:
        CLR     P3.7      ; Enable von Neumann code memory
        MOVX    @DPTR,A   ; Write the byte
        SETB    P3.7      ; Disable von Neumann code memory
        RET               ; Save/Restore all registers you change

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.