DolphinV4 API  1.6.1.0
Memory architecture

The Dolphin platform has four general types of memory. The memory architecture is the same as for the genuine Intel 8051 (except for RAM0). Therefore make sure to read the 8051 Similar Core chapter. To effectively program the chip it is necessary to have a basic understanding of the memory types:

  • 64kB Flash - CODE
    Purpose: program execution, data storage
    Content lost: flash erase

    Flash memory where the program and non volatile variables are stored. To store a variable to this memory area use the CODE keyword in Keil. For more information please read Flash architecture
  • 4kB External Memory - XDATA
    Purpose: data storage, (program execution)
    Content lost: DeepSleepMode, FlywheelSleepMode, PowerOnReset, PinReset

    External memory which is found "off-chip" i.e. not integrated to the microcontroller core but integrated in the Dolphin chip. Since the memory is "off-chip" it requires a dedicated addressing mode and access is slower as to internal memory.
    To store a variable in Keil to this memory area use the XDATA keyword. The DolphinV4 API uses different parts of the XRAM depending on the modules linked to the program. For example when using the mem_writeFlash function the DolphinV4 API reserves the first 256 bytes of XDATA for FLASH operations.
    Although the main purpose of the XRAM is to store data it can be also used for program execution. To download a program to XRAM use the EOPX2 -xram command. For more information see DolphinStudio.chm manual in References. The program to the XRAM can be downloaded only if the FLASH code protection bit is not set.
  • 256byte Internal Memory - DATA and IDATA
    Purpose: data storage
    Contents lost: DeepSleepMode, FlywheelSleepMode, PowerOnReset, PinReset

    Internal memory integrated on the DolphinV4 core. This memory area is a shared space between stack and variables. To place a variable to this memory area use the DATA or IDATA keyword. Variables in DATA variable is faster than the access to the IDATA. variables are accessed directly, IDATA are accessed indirectly, therefore variables in DATA are accessed faster. The Dolphin API uses different parts of the DATA and IDATA depending on the module linked to the program. For example when using the radio module the DolphinV4 API reserves #RADIO_RXBUFF_NUM bytes for (#ug8RxFlags) for radio flags.
  • 32byte Ultra Low Power Memory - RAM0
    Purpose: data storage
    Content Lost: PowerOnReset, PinReset

    Special external memory used to store variables in sleep modes. To store your variables to this memory area use mem_writeRAM0 function. There is no keyword in Keil for defining variables to be stored in this memory area. The DolphinV4 API does not uses this memory, it is available for the application.
mem_architecture.png
EO3100I Memory architecture

Memory Type Variable Specifier
Following an example how to place data to specific memory location. For more information about how to use the memory specifiers read the chapter about memory areas in Keil C51 help or here http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm

uint8 code string[20] = "This is a test"; //constant string stored in Flash Memory
uint8 xdata var; //8bit variable stored in External Memory
uint8 idata var; //8bit variable stored in Internal Memory - indirect accessed part
uint8 data var; //8bit variable stored in Internal Memory - directly accessed part
Note:
You can see how much space in which memory is used after the compilation if you open the *.m51 / *.map file. For more information read Keil Manual section BL51 / LX51 Linker User's Guide.
Be sure to leave enough space for the STACK in the internal memory, for more information read Stack Analysis