TC1796
System Units (Vol. 1 of 2)
Program Memory Unit
User’s Manual
7-26
V2.0, 2007-07
PMU, V2.0
7.2.6
Data Flash and EEPROM Emulation
The 128 Kbyte Data Flash is able to support an emulation of an EEPROM. This
EEPROM emulation is fully based on a software administration by a user program. The
only hardware feature that supports EEPROM emulation is the ability to program a page
in one DFLASH bank while the other DFLASH bank is erased, and to read data from one
bank while the other bank is busy with programming or erasing operation.
The main difference between a Flash memory and an EEPROM is its endurance. For
EEPROMs, the endurance is typically 120.000 write/erase cycles. The typical endurance
of a Flash memory is in the range of 1.000 to 10.000 write/erase cycles. The following
example discusses the basic principles of the EEPROM emulation as supported in the
TC1796.
Example:
16 Kbyte EEPROM emulation, using the complete 128 Kbyte DFLASH
The DFLASH is logically divided into eight 16 Kbyte regions that operate as a circular
buffer memory. Each of these regions has 128 pages, the smallest DFLASH entity that
can be programmed by one programming/write command. At a time, one of the eight
16 Kbyte regions is always regarded as active EEPROM region. The other regions are
within a loop in which all regions within one DFLASH bank can be erased together and
programmed (page-wise) consecutively in a fixed order.
The active EEPROM region is held as a mirror memory in an on-chip RAM area. After a
reset operation, the active EEPROM region is copied into the RAM and the related
16 Kbyte region may be marked (e.g. with all-one programming of a page) to be invalid.
Now the next consecutive 16 Kbyte region within the DFLASH circular buffer becomes
the active EEPROM region.
After the copy event, the user program is able to read/write data from/to the mirrored
RAM area very fast. The user program also has the task of tracking the changes in the
RAM and to decide when and which part of the mirrored EEPROM region must be written
back (programmed) to the actual active (and erased) EEPROM region of the DFLASH.
This decision can be, for example, an upcoming system switch-off event for which the
EEPROM data must be saved.
As a result of the continuously changing assignment of the active EEPROM region in a
circular buffer, the DFLASH memory cells of one EEPROM region can be
erased/programmed 8-times as often as one physical 16 Kbyte region, resulting in an
8-fold endurance for one EEPROM region. Additionally, a reduced retention is assumed
for EEPROM data. Thus, for the above described example with 16 Kbyte regions and
with a retention of 5 years, the endurance for an emulated EEPROM region is increased
to 120.000 write/erase cycles. As a result, the endurance of an emulated EEPROM
region can be increased by raising the software overhead and DFLASH memory area.
For marking of invalid word-lines (two consecutive pages) it is allowed to over-program
with all-one data. This is the only kind of twofold programming of a page which is allowed
and can only be performed in DFLASH.