General flash memory question

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

Reply to
dave.harper
Loading thread data ...

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

Reply to
Rob Gaddi

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.

Reply to
Mike Harrison

applications,

nice

32kB

possible

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:

formatting link

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

Reply to
dave.harper

just

erase a

I

bytes

microcontroller.

look

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

Reply to
dave.harper

Sure.

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".

--
  Keith
Reply to
Keith Williams

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
Reply to
Keith Williams

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.

formatting link

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.
Reply to
Robert Monsen

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.

--
Aaron Hughes
urpNOSPAM@canerdian.ca
http://www.canerdian.ca
 wrote in message
news:1105555846.250850.320170@c13g2000cwb.googlegroups.com...
> 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
>
Reply to
Aaron Hughes

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.
Reply to
Robert Monsen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.