Keil Logo

C51: Using 1K SRAM on Dallas DS89C420


Information in this article applies to:

  • C51, any version

SYMPTOMS

Some users have reported problems using the on-chip SRAM of the Dallas DS89C420, DS89C430, or DS89C450 devices. The memory appears to be disabled.

CAUSE

The on-chip SRAM is disabled after CPU reset and needs to be enabled. By default, the devices accesses only external XDATA memory.

RESOLUTION

The on-chip XDATA SRAM of the Dallas devices behaves like off-chip XDATA. So, in your program, variables that are located in XDATA will be stored in the on-chip SRAM.

There are several steps you must follow to use the on-chip XRAM.

  • µVision must know to place variables in the on-chip SRAM (XRAM) memory. To do that, in µVision you must:
    • Select the correct device for your project (from the device database)
    • Enable Use on-chip ROM and Use on-chip XRAM from the Project-Options for Target-Target dialog.
  • The on-chip SRAM must be enabled before you use it. You must do this in the startup code (so that the XRAM is on when global variables are initialized).

Add STARTUP.A51 to your project. To do this, copy the file \C51\LIB\STARTUP.A51 to your project folder and add it to the project. Then, in the STARTUP.A51 file, enable the on-chip SRAM by setting bit 0 (DME0) in the PMR SFR. The following lines in STARTUP.A51 will do this:

RSEG ?C_C51STARTUP

PMR DATA  0C4H                 ; add SFR definition

STARTUP1:
                               ; enable on-chip xdata RAM
          ORL PMR,#1           ; PMR.DME0 = 1 (set to 1 to enable SRAM)

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.