Keil Logo


Information in this article applies to:

  • C51 All Versions


I am configuring the 8051 monitor for my target system. I have a strange memory layout that gives me the maximum amount of XDATA and CODE memory, but it is not exactly von Neumann.

I'm using a 128K RAM that may be configured to work in 1 of 2 modes.

  • In Mode 1, the lower 64K of the RAM is mapped into XDATA space. The upper 64K is not available.
  • In Mode 2, the lower 64K of the RAM is mapped into CODE space and the upper 64K is mapped into XDATA space.

I'm using a chip with 8K of on-chip FLASH memory. I've programmed the monitor to start at address 0000h in the on-chip FLASH. I've configured everything so that my target programs start at address 2000h.

I modified the monitor INSTALL.A51 file so that the monitor starts in Mode 2 or my hardware design. During code writes, the monitor switches to Mode 1, writes to the XDATA address, and switches back to Mode 2. This works fine for uploading code.

The problem is that things like breakpoints and single-stepping do not seem to work.

I narrowed this down to the monitor data area. After reading about this it seems that the monitor data area MUST be von Neumann memory. It cannot use the memory configuration that I have designed.

Is there a work-around for this?


This problem is caused by the MON51.LIB library provided with C51 Version 6.21 and earlier. In this revision of MON51, there were two problems.

  1. µVision wrote to the vonNeumann Code when it should have written to XDATA. Since this is the same in von Neumann wired memory, it was not detected for a long time. This problem is solved at least since version 2.20 of µVision.
  2. The monitor did not use the WR_CODE function for its own memory area (256 bytes). This is solved this in a 'special' version of the library (MON51X.LIB) which is attached to this article.


This problem is resolved in C51 Version 7.01 and later. You may download the latest updates from the Keil Website.



The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Saturday, July 9, 2005

Did this article provide the answer you needed?
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.