![Infineon Technologies XC2200 User Manual Download Page 108](http://html1.mh-extra.com/html/infineon-technologies/xc2200/xc2200_user-manual_2055439108.webp)
XC2200 Derivatives
System Units (Vol. 1 of 2)
Memory Organization
User’s Manual
3-47
V2.1, 2008-08
MemoryX2K, V1.3
3.9.8
EEPROM Emulation
The flash memory of the XC2200 is used for three purposes:
1. Storage of program code. Updates happen usually very seldom. The main criteria to
be fulfilled is a retention of the life-time of the product.
2. Storage of constant data: this data is stored together with program code. So this data
is very seldom updated. Endurance is of no issue here but retention identical to the
code memory is required.
3. Data updated during run-time: this might be data with a very high frequency of
updates like a mileage counter or access keys for key-less entry. Other data might
be changed only in case of failures and other data might only be transferred from
RAM to non-volatile memory before the system is powered down.
Especially for the third type of data the non-volatile memory needs EEPROM like
characteristics:
•
Fine program/erase granularity which is in EEPROMs typically 1 byte.
•
Higher endurance than the intrinsic endurance of flash cells.
•
Short program and erase duration per byte. Especially for storing data in an
emergency (e.g. power failure) short latencies might be required.
A basic requirement for changing data during run-time is that code execution can still
resume, especially interrupt requests must still be serviced. This requirement is fulfilled
in the XC2200 because all three flash modules work independently. If one is busy with
program or erase then code can still be executed from the other two.
The other requirements are more difficult to fulfill because the XC2200 does not have an
EEPROM available but only the flash memory with the already frequently mentioned
limitations: big program/erase granularity, moderately long program/erase duration,
limited cell endurance with reduced retention at high number of program/erase cycles,
pages not isolated but affected by drain disturbs.
In order to alleviate these effects on run-time storage of data software is used to emulate
EEPROM. There is quite a number of algorithms for efficiently using flash memory as
EEPROM. The following section describes one (the most simple) of these algorithms.
It should be noted that the XC2200 does not offer the customer any hardware means for
EEPROM emulation. All of the following must be realized by software.
3.9.8.1
The Traditional EEPROM Emulation
The key point is to solve the limited endurance by storing data in N different physical
places. In XC2200 the algorithm could use N sequential pages or groups of pages. If
data is currently stored in the page “x” then the next program happens to the page “(x+1)
mod N”.
After boot up the last correct page group must be found. This could be done by either
evaluating a counter (from 0 to 2*N-1) or the old entries are invalidated by erasing the