| ARM Technical Support Knowledge Articles | |
Applies to: C51 C Compiler
Information in this article applies to:
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?
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.
; 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. ;
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
Did you find this article helpful? Yes No
How can we improve this article?