ARM Technical Support Knowledge Articles

USING THE ON-CHIP XDATA OF THE INFINEON C515C

Applies to: C51 C Compiler

Answer


Information in this article applies to:


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 keilc51lib 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
    

Article last edited on: 2005-07-09 12:27:37

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential