Keil Logo

C51: USING THE ON-CHIP XDATA OF THE INFINEON C515C


Information in this article applies to:

  • C51 Version 5.50a
  • C51 Version 6.03

QUESTION

I'm using a C515C which has 2K of on-chip XDATA from 0xF800 to 0xFFFF. I have successfully mapped my variables to this address space, but they don't seem to work. Is there something else I must do to use this memory?

ANSWER

Yes. After reset, the on-chip XRAM of the C515C is disabled. You must enable it by clearing the XMAP0 bit. This is best done in the C startup code.

  1. Copy the file STARTUP.A51 from the \keil\c51\lib directory to your project directory.
  2. Modify the memory initialization section of the startup code as follows:
    ;  User-defined Power-On Initialization of Memory
    ;
    ;  With the following EQU statements the initialization of memory
    ;  at processor reset can be defined:
    ;
    ;               ; the absolute start-address of IDATA memory is always 0
    IDATALEN        EQU     100H    ; the length of IDATA memory in bytes.
    ;
    XDATASTART      EQU     0F800H  ; the absolute start-address of XDATA memory
    XDATALEN        EQU     0800H   ; the length of XDATA memory in bytes.
    ;
    PDATASTART      EQU     0H      ; the absolute start-address of PDATA memory
    PDATALEN        EQU     0H      ; the length of PDATA memory in bytes.
    ;
    
  3. Add the following instruction (ANL 0B1h, #01h) at the beginning of the startup code (BEFORE XDATA is cleared). If the XRAM is not enabled, it can't be cleared.
                    CSEG    AT      0
    ?C_STARTUP:     LJMP    STARTUP1
    
                    RSEG    ?C_C51STARTUP
    
    STARTUP1:
    
                    ANL     0B1h, #01h      ; CLEAR XMAP0 (enabling F800-FFFF XRAM)
    
    IF IDATALEN <> 0
                    MOV     R0,#IDATALEN - 1
                    CLR     A
    IDATALOOP:
                    MOV     @R0,A
                    DJNZ    R0,IDATALOOP
    ENDIF
    

FORUM THREADS

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?
 
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.