AN2302 Freescale Semiconductor / Motorola, AN2302 Datasheet - Page 9

no-image

AN2302

Manufacturer Part Number
AN2302
Description
EEPROM Emulation for the MC9S12C32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Software Description
User's Application
Files
Non-Volatile Data
Variables
MOTOROLA
The purpose of each source file is described in this section. The code was
written mainly in 'C' with some assembly code using the MetroWerks
CodeWarrior for HCS12 tools. If a different tool suite is to be used, changes will
be required to the method for identifying and linking code and data segments,
the in-line assembly code would also have to be changed.
Non-volatile data variables, i.e. variables which are to be located in emulated
EEPROM, are declared in the user's application files as and when required.
The variables must be located in the segment called EEPROM_VARS using a
#pragma statement as in the following example:
#pragma DATA_SEG EEPROM_VARS
unsigned char EepromVar1;
unsigned int EepromVar2;
#pragma DATA_SEG DEFAULT
A count should be kept of the total size of all variables allocated to
EEPROM_VARS, this number will be required to determine the Eeprom bank
size. The total size can also be obtained in the map file output from the linker.
In the user's application, all non-volatile data variables are accessed using the
functions ReadEeprom and WriteEeprom. The user's application files which
access non-volatile data variables should therefore include the file
EE_Emulation.h.
Freescale Semiconductor, Inc.
For More Information On This Product,
EEPROM Emulation for the MC9S12C32
Go to: www.freescale.com
Software Description
AN2302/D
9

Related parts for AN2302