Hi all,
The mystery deepens.....
I have always taken the statements that you have to erase (a page) before programming flash more as an "idiot proofing" of the instructions than of a technical reason to avoid damage or degradation of the flash.
But the document referenced by Alban (AN2156) suggests otherwise:
In the FLASH section they make the statement (although a little stronger than usual here)
NOTE: To avoid program disturbs, the row must be erased before any byte on
that row is programmed.
Then they devote a section to what they call "Selective bit programming" of the EEPROM with the following statements:
On each programming cycle, one to eight bits of the EEPROM memory
may be programmed. It is possible to program multiple bits at the same
time. However, the same bit may not be programmed twice unless the
entire byte has been erased first. This means that the same byte location
may be programmed eight times as long as an individual bit is not written
to more than once. This is referred to as selective bit programming. The
acceptable sequence in Table 6 shows how the same byte may be used
for eight program cycles without an erase.
EEPROM memory lifetime is guaranteed for 10-K read/write cycles.
However, using selective bit programming extends the life cycle of the
memory 8-fold since each bit is only programmed 10-K times. This
allows the user to program a single byte up to 80-K times.
This is basically what I was suggesting you could do in flash.
So after reading this document you are left feeling like it is a bad idea to prog, prog, prog, erase in flash.
This covers both different bits of a byte and different bytes in a page.
Then along comes Mac quoting AN2346....
In here it says the following:
Although some data sheets discourage writing to a particular row more than once without
erasing it in between, there is no technical reason why this should not be done.
It is also allowable to write to only part of a row at a time, there being in practice
no minimum number of bytes which must be programmed each time a row is
written to.
The only restriction is that the total write time between erases should not
exceed tHV (4ms) per row.
So is this different flash technology or what is the real answer?
Regards
David