write flash memory without erase

Discussion in 'General Electronics Chat' started by darsie, Oct 6, 2011.

  1. darsie

    Thread Starter New Member

    Feb 19, 2010
    15
    0
    Hi!

    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.

    Thanks
     
    Last edited: Oct 6, 2011
  2. darsie

    Thread Starter New Member

    Feb 19, 2010
    15
    0
    Can anyone recommend a forum for advanced electronics where I can ask this question?
     
  3. Papabravo

    Expert

    Feb 24, 2006
    10,177
    1,799
    Would you understand hot electron injection and quantum tunneling if we were to discuss them?
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,451
    3,370
    There is a detailed explanation in one of my books and I will try to dig it up for you.
     
  5. Papabravo

    Expert

    Feb 24, 2006
    10,177
    1,799
    There is also the Wikipedia article for the mildly curious.
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,177
    1,799
    Who lives in a keyboard under the desk? Sponge Bob loosewire!
     
  7. colinb

    Active Member

    Jun 15, 2011
    351
    35
    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.
     
  8. MrChips

    Moderator

    Oct 2, 2009
    12,451
    3,370
    Last edited: Oct 17, 2011
  9. darsie

    Thread Starter New Member

    Feb 19, 2010
    15
    0
    I think I understand the concepts, but they can certainly be taken to a level beyond my understanding.
     
  10. darsie

    Thread Starter New Member

    Feb 19, 2010
    15
    0
    Very interesting. They favor different methods:

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

    Freescale:
    "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.
     
Loading...