External flash with Atmega2560

Hi all,

I'd like to have a chunk of onboard storage for datalogging in a board I'm working on for personal use - so, clearly I could use an SPI accessible flash chip.

I've had a play with external RAM with the circuit design by Rugged Circuits - their MegaRAM solution. http://ruggedcircuits.com/html/megaram.html

The question is, can I interface to external flash in the same way for data storage, using a parallel chip - the external memory interface in the datasheet says "well suited to operated as an interface to memory devices such as external SRAM and Flash..."

So, a couple of questions really;

  • External flash connected to the 2560s external memory interface does not need a memory controller per se? As the MCU is the memory controller in itself?
  • Why does parallel flash of the same storage capacity seem to be so much physically larger, of course the pincount is higher - but none of the chips seem to be available in LQFP packages for example, just packages with pins on two sides? I've heard NAND flash needs a file system such as FAT, to deal with bad sectors - does NOR too? [/list]

For datalogging you might want to look at using SD cards, too.

They're much cheaper and it's easy to transfer the data to other machines.

This is true, ultimately I wish to transfer the data over USB from my device - without phsyically removing the card, but in the meantime - whilst writing the software to do that, I suppose it would be nice to be able to remove the SD card.

I can't seem to find any reference to it - but is there a size restriction for example on the capacity of cards using the SD library? ...as certainly the newer 64Gb cards would be a dream to use, or at least support for them.

jtw11: This is true, ultimately I wish to transfer the data over USB from my device - without phsyically removing the card

You can do that just the same as with a memory expansion.

jtw11: I can't seem to find any reference to it - but is there a size restriction for example on the capacity of cards using the SD library? ...as certainly the newer 64Gb cards would be a dream to use, or at least support for them.

The library supports FAT32 so the limit is much more than 64Gb.

64GB cards are really expensive. 8GB can be had for $5, 32 & 64 are waaaay more $$.

I don't need 64gig, not by a long way - it's just nice to know the support is there if I want it. I've got a couple of 8gig cards laying around somewhere.

Whilst this isn't a commercial product, does anybody know of the restrictions surrounding SD just out of interest?

I'd check with fat16lib, his SD library is really up to snuff.

http://code.google.com/p/sdfatlib/

You can also have your 2560 hooked up to something inexpensive such as a Raspberry Pi to handle data storage.

To answer your original questions, the only real difference between NOR flash and RAM would be that you have to handle it a bit differently. First, there are commands it needs to do various things. Second is that it works in pages, typically. This means when you want to write something, you need to copy out an entire page, modify the bytes you want, and then write the whole page back in.

There are byte addressable flash chips, though. Those are usually much smaller capacity devices like the 2864.

As for packages, what are you looking for? There are SOIC, TSSOP, SSOP, etc.. for flash. I have not seen a QFP version though.

NAND flash of course will use less pins, is cheaper (by capacity) physically smaller, and comes in much larger capacities than NOR.

NOR will wear out, but doesn't require the same amount of maintenance that NAND flash does.

What you gain in NAND you make up for in more complex code.

Retroplayer, thanks for the info - as mentioned I'm going with an SD solution for the hardware and code simplicity - but good to know none the less.