Connect with us

General flash memory question

Discussion in 'Electronic Basics' started by [email protected], Jan 12, 2005.

  1. Guest

    I'm interested in using a flash chip for some datalogging applications,
    however am not sure if it's practical to integrate. EEPROMs are nice
    (and easy), but I would like to get something with more than just 32kB
    of memory.

    Can flash memory only be written one sector at a time? Is it possible
    to do single-byte-only writes?

    If not, are there any other memory storage options (in a single chip
    solution) that can store at least, say, 64kB? What about 256kB?
    Thanks,
    Dave
     
  2. Yes, as long as the sector has previously been erased.
    For datalogging, this is often not a problem as the flash can be fully erased after emptying the
    log. For continuous-wrap type logs it just means you need to erase a new sector before you use it.
     
  3. Rob Gaddi

    Rob Gaddi Guest

    I'm currently using Atmel's 64kB serial EEPROM on a project, and I know
    they have a 128kB one as well.
     
  4. Guest

    fully erased after emptying the
    new sector before you use it.

    Great, thanks for the insight. This means once a sector is erased, I
    can write a single byte at a time without affecting neighboring bytes
    on the same sector? One of the chips I was looking at was one from
    Amtel:

    http://www.atmel.com/dyn/resources/prod_documents/doc0291.pdf

    I was planning on connecting the address and data pins through
    serial-to-parallel converters to free up pins on my microcontroller.
    Would this chip and this concept work?

    Thanks,
    Dave
     
  5. For some reason my browsers can't get to the web today, so I can't look
    at that particular DS. But, look at the programming cycle. What you
    propose will likely be somewhere between "incredibly clumsy" and
    "virtually impossible".
     
  6. Guest

    Why do you say that? This isn't for high speed data logging, and I'll
    probably be writing only 20 bytes/sec.

    I don't think it'd be too clusmy... output the address and data to the
    s-p converters, and write.

    Dave
     
  7. Again, my browsers are highly trashed (tried to install PDFReader 7.0
    and it didn't go so well), so I can't see the DS. The Atmel stuff may
    be different than the others I've used. If so, "never mind".
    The write cycle of the flash devices I used was far more complicated.
    One had to do a silly dance[*] for each byte written. Again, look at
    the data sheet at the write cycle. I think you'll find its not as
    simple as writing an SRAM. Again, Atmel may be different.

    --
    Keith

    [*] some examples of Flash commands for the AMD 29F040B I used moons
    ago.

    Write byte command:

    cycle Addr Data
    1 555 AA
    2 2AA 55
    3 555 A0
    4 Addr Data

    Erasing sector command:

    Cycle Addr Data
    1 555 AA
    2 2AA 55
    3 555 80
    4 555 AA
    5 2AA 55
    6 Sector 30
     
  8. Aaron Hughes

    Aaron Hughes Guest

    Typically when you write to a flash chip, you MUST write to the entire
    sector (128 bytes usually) within a specified window. These bytes are
    written into a buffer on the chip, and only if you are within the window
    time, does the chip *itself* write the bytes. Hence, if you only write ONE
    byte, the other 127 in that sector are reset to FFh. Thus if you expect ot
    write one byte, wait a while, then another byte etc, only 1 of your valid
    data bytes will ever be present in the sector, all other bytes will be FFh.

    That being said, there may be some Flash chips that do not do this. Atmel
    however is not one of them.

    The other "dance" mentioned is called a Software Data Protection (SDP)
    routine. It is meant to prevent invalid writes from happenning (i.e. hard
    for noise to mimic), and it is typicall a 3 byte sequence that must be
    written at the start of every page, EVEN if this feature is disabled, most
    Flash chips make you use it anyway.
     
  9. I'm familiar with Atmel flash, and it doesn't all work this way. You can
    write a single byte with 'large sector' flash. It's only the small
    sector flash that requires one to write an entire sector.

    http://www.atmel.com/dyn/resources/prod_documents/doc1026.pdf

    see the description. This is a 64kb flash. There are larger ones (I've
    used the 4Mb version before) that are the same as this one.

    --
    Regards,
    Robert Monsen

    "Your Highness, I have no need of this hypothesis."
    - Pierre Laplace (1749-1827), to Napoleon,
    on why his works on celestial mechanics make no mention of God.
     
  10. Rich Grise

    Rich Grise Guest

    I beg to differ. According to the data sheet, "ERASURE: Before a byte
    can be reprogrammed, the 64K bytes memory array must be erased."

    So I can't really see using it for nonvolatile data storage, unless you
    just keep writing until it's full, then download it all and erase the
    thing.

    Are there chips that act like a nonvolatile RAM?

    Thanks,
    Rich
     
  11. The statement I was objecting to was that one needs to write an entire
    sector at once. This is false for 'large sector' flash, as in the
    datasheet. However, there ARE some flashes, the 'small sector' flashes,
    that require one to write an entire small sector of 128 bytes at once.

    A flash write (for large sector flash) works by setting bits to 0. They
    all start out at 1, and you set them to zero using the write sequence.
    Once they are set to 0, you can't set them back to 1 without erasing the
    entire sector.
    That's what we do. For example, I've used flash for log files before.
    One uses two or more sectors. That way, you only have to erase part of
    your log when circling back to the start.

    --
    Regards,
    Robert Monsen

    "Your Highness, I have no need of this hypothesis."
    - Pierre Laplace (1749-1827), to Napoleon,
    on why his works on celestial mechanics make no mention of God.
     
  12. Rich Grise

    Rich Grise Guest

    OK. I see the difference now. :)

    Thanks!
    Rich
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-