External EEPROMs are often used in automotive applications to store adaptative/evolutive data. On the other hand, the Microcontroller used in those systems, are more and more based
on embedded-Flash.
The trend to continuously reduce the number of components is forcing designers to look to use
Flash memory to emulate EEPROM.
This application note will explain the differences between external EEPROMs and embeddedFlash and will give advises on how to substitute external EEPROM to emulated-EEPROM using the on-chip Flash of ST10F2xx devices.
Although the concept is easy to explain and implement “as is”, there are some embedded aspects that have to be taken into account.
In this application note, the handling of embedded aspects to secure the content of an external
EEPROM are assumed to be known by the reader. So, this document is focusing on the differences between EEPROMs and embedded-Flash.
Substituting external EEPROM with emulated EEP ROM from the embedded-Flash of the Microcontroller is a complex development. This application note assumes that readers are already familiar with the techniques used to secure the content of evolutive information in
external EEPROM of embedded applications.
This application note is organized in 3 parts:
– description of the differences between external EEPROMs and embedded-Flash,
– general description of EEPROM emulation concept,
– introduction to embedded application aspects.
Although this application note is focused and applicable to ST10F269, ST10F280, ST10F276
(and its derivatives: ST10F275, ST10F273, ST10F272, ST10F271), ST10F252 and
ST10F296, most of its content is not dependent on the microcontroller.
3/15
AN2061
2EMBEDDED-FLASH AND EEPROM
Before describing the proposed concept for EEPROM emulation, it is important to remember
the main differences between the embedded-Flash memory of a microcontroller and serial external EEPROMs. Those differences are generic to any microcontroller (i.e.: not specific to
ST10F2xx variants). They are summarized in the table below.
Table 1. Differences between Embedded Flash and EEPROM
FeatureEEPROM
Write timesome ms
random byte : 5 to 10ms
page: equivalent to hundred us / word (5
to 10ms per page)
Erase timeN/Aseconds
Write methodonce started, is not CPU dependent;
needs only proper supply.
Write accessserial : hundred us
random word : 92us
page : 22.5us /byte
Emulated EEPROM from embedded-
Flash
some us
(ex : 16us per word)
(ex : 1.5s)
once started, is C PU dependent: a CPU
reset will stop the write process even if
supply stays inside specification.
parallel : hundred ns
very few CPU cycles per wo rd.
2.1 Difference in write access time
As Flash has shorter write access time, critical parameters can be stored faster in the emulated EEPROM than in a serial external EEPROM, thereby improving the robustness of the system if the same safety concept is kept.
2.2 Difference in writing method
One of the important differences between external EEPROM and emulated EEPROM for embedded applications is the writing method.
– Stand-alone external EEPROM: once started by the CPU, the writing of a word cannot
be interrupted by a CPU reset. Only supply failure will interrupt the writing process; so
properly sizing the decoupling capacitors can secure the complete writing process inside a stand-alone EEPROM.
– Emulated EEPROM from an embedded-Flash: once started by the CPU, the writing
can be interrupted by a power failure and by a CPU reset.
This difference should be analysed by system designers to understand the possible impact(s)
in their applications and to define the proper handling method.
2.3 Difference in erase time
The difference in erase time is the other important difference between stand-alone EEPROMs
and emulated EEPROM with embedded-Flash. Unlike Flash, EEPROM does not require a
block erase operation to free-up space before write. This means that some form of software
management is required to store data in Flash. Moreover, as the erase process of a block in
the Flash takes few seconds, power shut-down and other spurious events that may interrupt
4/15
AN2061
the erase process (ex: reset) should be considered when designing the Flash management
software. This means that to design a robust Flash management software it is necessary to
have a deep understanding of the Flash erase process.
The Flash erase process is split in 3 phases:
– phase1: write all bits to 0, starting from the initial content. Interrupt during this phase will re-
sult in more memory cells with a “0” logic level; the content after interrupt in phase1 depends
on the Flash initial content.
– phase2: write all bits to 1, starting from the all “0” configuration. The longer the time before
this phase is interrupted, the higher number of cells will return a “1” logic level. The content
after interrupt in this phase does not depend on the Flash initial content; the content after
phase2 interrupt, shall be regarded as a totally random content.
– phase3: equalization. This phase is necessary to recover over-erased cells. The Flash man-
agement software for EEPROM emulation should guarantee that this phase was successfully completed before programming in this bank.
The consequence of interrupt during phase2 is that a single bit approach should be a voided
to flag the completion of the erasing process (see more details in Section 3.5 ‘Data-set statusbits’ on page 7).
The consequence of interrupt during phase1 and/or phase2 is that it is recommended to have
fixed data inside the emulated EEPROM so that checksum can be run to tell which Flash bank
keeps the valid data.
The most important point is to ensure that the Flash has been completely erased (phase3 was
not interrupted) before programming data inside a bank.
Note: the design of Flash software management is easier if programming in a new bank is always made just after erasing of this bank (when erasing of one bank is necessary).
2.4 Additional information on Flash
Incremental programming: the Flash controller will accept to program a word that is already
programmed if the new word is adding more “0” bits.
Progra mming co mple tion: programming completion is important to guarantee data retention
time; the programming is complete when the Flash controller status indicates the end of programming without showing any error flag. If programming is interrupted (ex: supply fail, CP U
reset), the cells of the word being programmed will be partially programmed. This can result in
unstable “0”s when reading this word.
5/15
Loading...
+ 10 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.