AN2302 Freescale Semiconductor / Motorola, AN2302 Datasheet - Page 3

no-image

AN2302

Manufacturer Part Number
AN2302
Description
EEPROM Emulation for the MC9S12C32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Program/Erase
Cycles
MOTOROLA
The Flash implementation on the MC9S12C32 is programmed one word (two
bytes) at a time and erased in 512 byte sectors. Refer to the Flash 32K Block
Guide (S12FTS32KV1/D) for further details.
The Flash implementation on the MC9S12C32 includes an on-chip charge
pump which generates the required voltages for programming and erasure, so
no additional external supply is required.
A Flash block cannot be read at the same time that it is being programmed or
erased. Thus the code which is controlling the program or erase operation
cannot be executed from the Flash block that is being programmed or erased.
The MC9S12C32 has a single Flash block, so some critical portions of the
Flash programming code cannot be executed from Flash and must be
executed from RAM. This code is written in assembly code in order to minimise
the RAM requirement.
One concern when emulating EEPROM using Flash is the issue of
program/erase cycles. When EEPROM is used, each individual byte can
typically be programmed and erased a finite number of times with guaranteed
data integrity. Program/erase cycles of 10,000 or 100,000 are typically
specified. With Flash however, the minimum erase size is a sector and the
number of program/erase cycles applies to a sector. The Flash implementation
on the MC9S12C32 has an erase sector size of 512 bytes and a minimum
program size of one word (2 bytes). Each individual word in a sector can be
programmed only once before the sector must be erased. The MC9S12C32
electrical characteristics at the time of writing guarantee a minimum of 10,000
program/erase cycles per sector. Consult the latest Data Sheet for the current
electrical characteristics.
This means that, if for example the non-volatile data variables fill an entire
sector (512 bytes) and 2 complete sectors are allocated to non-volatile data
storage, then the total number of permitted data updates is 2 x 10,000 =
20,000. Note that this figure does not apply to each individual data variable, it
is the sum of all updates for all data variables. An average number of updates
per variable can be obtained by dividing the total number of permitted updates
by the number of non-volatile data variables.
In a typical application, the majority of non-volatile data variables will be
updated infrequently and a few will be updated more frequently. Consider an
example of 256 non-volatile data variables each 2 bytes long and the minimum
2 Flash sectors allocated to non-volatile data storage. A minimum specification
of 10,000 program/erase cycles per sector is assumed. If 200 of these variables
are each updated 10 times in the lifetime of the microcontroller, then 200 x 10
= 2000 program/erase cycles will be used. If 50 of the remaining variables are
each updated 100 times, then 50 x 100 + 2000 = 7000 program/erase cycles
will be used. This would leave 20,000 - 7000 = 13,000 program/erase cycles
for the remaining 6 variables, or an average of 2166 updates each.
Freescale Semiconductor, Inc.
For More Information On This Product,
EEPROM Emulation for the MC9S12C32
Go to: www.freescale.com
Implementation
AN2302/D
3

Related parts for AN2302