AN2302 Freescale Semiconductor / Motorola, AN2302 Datasheet - Page 34

no-image

AN2302

Manufacturer Part Number
AN2302
Description
EEPROM Emulation for the MC9S12C32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor, Inc.
AN2302/D
The application code is placed in section FLASH_CODE.
The section FLASH_EEPROM is reserved for EEPROM emulation data and
contains all the variables in segment EEPROM_VARS. This section must be
large enough for EEPROM_BANKS x EEPROM_SIZE_BYTES.
The structure containing the Flash control registers is placed in the section
FLASH_REGS that is located at the default address. If the registers are
remapped after reset then this address will have to be changed. This section
must have the attribute NO_INIT.
This example uses the timer module, so the structure containing the timer
control registers is placed in the section TIMER_REGS at the default address.
The section FLASH_COPY is reserved as a space for the RAM functions in
Flash. The RAM functions are placed at this address using the linker HEXFILE
command to load in the previously generated ROM library
EE_RAMfuncsIRQ.sx, with an OFFSET added to each record. The OFFSET
value of 0xFFFF4100 is calculated by subtracting the RAM_FUNCS start
address from the FLASH_COPY start address.
The section RAM_FUNCS is reserved as a space in RAM for the RAM
functions to be copied to for execution. The addresses allocated for the RAM
functions may need to be expanded, depending on the size of the interrupt
service routines and if EECALLBACK is defined. The RAM functions are copied
here from the FLASH_COPY section by the InitRAMFuncs function.
Finally, the EE_RAMFuncsIRQ ROM library file must be included using the
linker HEXFILE command. An OFFSET must be added to the addresses in this
file so that it is loaded into Flash. The offset is chosen so that when added to
the original addresses the desired Flash address is obtained. This address is
equivalent to FLASH_COPY_START in EE_Emulation.h. No other code must
be located in this address space.
34
EEPROM Emulation for the MC9S12C32
MOTOROLA
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2302