AN2400 Freescale Semiconductor / Motorola, AN2400 Datasheet - Page 34

no-image

AN2400

Manufacturer Part Number
AN2400
Description
HCS12 NVM Guidelines
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2400/D
Storage of Variables
in EEPROM
Infrequently Updated
Data Variables
Frequently Updated
Variables
34
The PVIOL flag will be set during the command write sequence after the word
write to the EEPROM address space and the command sequence will be
aborted if any of the following illegal operations are performed.
When the PVIOL flag is set in the ESTAT register the Command State Machine
is locked. It is not possible to launch another command until the PVIOL flag is
cleared.
Traditionally, EEPROM is characterised by the ability to program and erase
individual bytes. This means that variables can be allocated to EEPROM
without regard to their size or order and the permitted number of write/erase
cycles for each variable was equal to the specified number of write/erase cycles
for a byte EEPROM.
However, the implementation of EEPROM of the HCS12 family of
microcontrollers means that this is no longer the case. The smallest unit that
can be programmed is an aligned word (2 bytes), and the smallest unit that can
be erased is a sector of 4 bytes. This has implications for the way that variables
are allocated to EEPROM if the maximum number of write/erase cycles is to be
realised.
For example, if a sector of EEPROM contains 4 different variables each 1 byte
long, then each time a variable is updated requires that the whole sector is
erased and reprogrammed. This means that the specified maximum
write/erase cycles for the sector is shared between all 4 variables.
Various methods of data storage are examined in the following sections,
grouped according to frequency of update.
Data variables that are updated infrequently may be allocated into EEPROM or
Flash, so long as the total number of updates (over the product lifetime) for all
variables in each sector does not exceed the specified maximum for the sector.
These variables can be packed into EEPROM or Flash without ‘gaps’ to ensure
maximum utilisation. It may be advantageous to store certain variables, such
as end-of-line configuration data or end-of-life diagnostic data, in Flash due to
the faster programming time that may be achieved using burst programming.
Data variables which are updated frequently may need to be allocated a whole
EEPROM sector each. This ensures that the total number of permitted updates
1. Writing a EEPROM address to program in a protected area of the
2. Writing a EEPROM address to erase in a protected area of the
3. Writing the mass erase command to ECMD while any protection is
Freescale Semiconductor, Inc.
For More Information On This Product,
EEPROM.
EEPROM.
enabled.
Go to: www.freescale.com
HCS12 NVM Guidelines
MOTOROLA

Related parts for AN2400