C51: USING THE ON-CHIP XDATA OF THE INFINEON C515C
Information in this article applies to:
- C51 Version 5.50a
- C51 Version 6.03
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
Copy the file STARTUP.A51 from the \keil\c51\lib
directory to your project directory.
Modify the memory initialization section of the startup code as
; 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.
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
ANL 0B1h, #01h ; CLEAR XMAP0 (enabling F800-FFFF XRAM)
IF IDATALEN <> 0
MOV R0,#IDATALEN - 1
The following Discussion Forum threads may
provide information related to this topic.
Last Reviewed: Saturday, July 09, 2005