AN2302 Freescale Semiconductor / Motorola, AN2302 Datasheet - Page 10

no-image

AN2302

Manufacturer Part Number
AN2302
Description
EEPROM Emulation for the MC9S12C32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2302/D
EE_Emulation.h
IRQ_DURING_PROG
EEPROM_SIZE_
BYTES
EEPROM_BANKS
10
NOTE:
The file EE_Emulation contains function prototypes and the configuration
parameters for Eeprom emulation of non-volatile data variables. This file
should be included in all files which call any function in EE_Emulation.c. The
following values must be correctly defined by the user:
This value can optionally be defined either in this file, or on the compiler
command line. If this value is defined, it enables interrupts to be serviced during
programming and erasure. The interrupt service routines for the interrupts
which remain enabled during programming and erasure must be located in the
file EE_RAMfuncs.c, the RAM must be re-mapped to the top of the memory
map, and the vector table must be copied into the re-mapped RAM.
If IRQ_DURING_PROG is NOT defined, then it is not possible to service
interrupts during programming and erasure. In this case the WriteEeprom
routine takes care of masking the maskable interrupts when required.
If the non-maskable interrupt is enabled (X-bit cleared), then it cannot
subsequently be disabled by software. If the non-maskable interrupt will be
enabled (X-bit cleared), IRQ_DURING_PROG must be defined.
This value defines the number of bytes of emulated EEPROM variables. Valid
values are: 2, 6, 14, 30, 62, 126, 254 and (m x 512) - 2, where m = 1, 2, 3...
The selected value must be equal to or greater than the total number of bytes
of all non-volatile data variables.
This value defines the number of banks (or copies) of non-volatile data
variables that there are. EEPROM_BANKS x (EEPROM_SIZE_BYTES + 2)
equals the total amount of Flash allocated to EEPROM emulation.
If EEPROM_SIZE_BYTES < 510, the total amount of Flash allocated must be
2 or more complete Flash sectors, i.e. EEPROM_BANKS x
(EEPROM_SIZE_BYTES + 2) = n x 512, where permitted values of n = 2, 3,
4…
If EEPROM_SIZE_BYTES >= 510, the total amount of Flash allocated must be
2 or more banks, i.e. EEPROM_BANKS = n, where permitted values of n = 2,
3, 4…
Larger values for EEPROM_BANKS permit a larger number of updates of the
non-volatile data variables, at the expense of requiring a larger amount of Flash
for EEPROM emulation.
Freescale Semiconductor, Inc.
For More Information On This Product,
EEPROM Emulation for the MC9S12C32
Go to: www.freescale.com
MOTOROLA

Related parts for AN2302