write flash memory without erase

Thread Starter


Joined Feb 19, 2010

I asked Atmel if it was reliable to just write a page of AVR microcontroller program flash memory (NOR flash, I guess) to all 0 instead of first erasing it to 0xFF and then writing it to 0.

They said, it is not recommended and recommended the erase/write cycle mentioned in the datasheet.

Can someone explain that? I fail to see how setting a page to all 0 could fail without first erasing it to all 0xFF. Or might several subsequent writes accumulate too much charge on the floating gates (FG) such that a following erase might not fully discharge a FG?

Is there any reason not to set any number of bits from 1 to 0 by writing to the page without erasing it first? That would save the other bits an erase/write cycle, I would guess, although I had a different reason for setting a page to all 0.

Last edited:

Thread Starter


Joined Feb 19, 2010
Can anyone recommend a forum for advanced electronics where I can ask this question?


Joined Feb 24, 2006
Would you understand hot electron injection and quantum tunneling if we were to discuss them?


Joined Oct 2, 2009
There is a detailed explanation in one of my books and I will try to dig it up for you.


Joined Jun 15, 2011
It's not the Atmel chip, but some interesting details on multiple writes to a flash word can be found in TI CC253x/4x User Guide section 6.2.2 (p. 73). YMMV when you don't abide by the manufacturer's specs, so take care.

Thread Starter


Joined Feb 19, 2010
Here is the Reference Manual for Freescale HC11 MCU.
Chapter 4 has a detailed explanation of failures when the EEPROM is not fully erased.

Very interesting. They favor different methods:

allows limited 'selective writing' including "A 0 must not be written more than two times to a single bit."

"preliminary data supports the suggestion that the extra programming time on some bits has no detrimental effects."

"The program-more-zeros method appears to have no risks, and some experimental evidence shows that data retention and program integrity are not compromised. The selective-write method appears to have some theoretical problems, but experimental data has not confirmed any practical problem. Due to the theoretical risks of the selective-write method, that method should probably not be used without a complete understanding of the risks."

There are some confusing aspects in the Freescale document, but I will have to address them later.

Thanks for picking up the discussion.