Flash or EEPROM: Which Should I Use? - Page 1
Forum section: electronics / projects

author: TheRuler8510
author_rank: Regular Contributor
timestamp: April 22, 2014, 03:26:35 am
content: Flash or EEPROM: Which Should I Use?I want to store short 1-bit sound samples, and play them with an ATMEGA. Main goal is ease of use and programming and cheap parts.It is too much memory for a MCU, so Flash or EEPROM of size 512K or 1 Meg in an 8-pin pkg are both cheap.So the question is which should I choose and why, or is there a better way to do it that I have not thought of?Thanks,Tom

author: Niklas
author_rank: Frequent Contributor
timestamp: April 22, 2014, 03:02:10 pm
content: How much data are you willing to buffer between writes? EEPROM is read/write/erase on byte or word level. FLASH is usually erased as blocks, written as rows and read as byte/word. With FLASH you will need to store a lot of data in the microcontroller and then copy that buffer to the memory.

author: dannyf
author_rank: Super Contributor
timestamp: April 22, 2014, 03:08:17 pm
content: QuoteNone of those questions are actually important at this point. If I were you, I would ask myself 1) why do I need to do this? 2) how much and how fast I need to store the data; and go from there.Flash / EEPROM can be a great solution, or non-workable, depending on your answers to the above questions.

author: TheRuler8510
author_rank: Regular Contributor
timestamp: April 22, 2014, 04:35:14 pm
content: Quote from: Niklas on April 22, 2014, 03:02:10 pmAnswer: Any amount. Writing is infrequent, and ideally only happening at the beginning of product life. However during the prototyping phase, memory may be written dozens of times.Thanks,Tom

author: TheRuler8510
author_rank: Regular Contributor
timestamp: April 22, 2014, 04:42:14 pm
content: Quote from: dannyf on April 22, 2014, 03:08:17 pm

author: dannyf
author_rank: Super Contributor
timestamp: April 22, 2014, 04:54:29 pm
content: -Answer: Any amount.-a memory device that can literally hold "any amount" of data doesn't exit and will never exist.Having more specificity to your project will improve its chance of success.

author: mariush
author_rank: Super Contributor
timestamp: April 22, 2014, 05:46:42 pm
content: No matter what you choose, you will read one byte at a time, so as long as you'll have to shift bits and read 1 bit at a time it will make sense to read at minimum 8,16,32 bytes etcFlash, Eeprom, each has its pros and cons ... you'll have to think about how often you'll write to it, how often you'll read, the lifetime of the device (data may have to be refreshed at some points if your device is only used rarely).Besides these, there's also FRAM :http://www.digikey.com/product-search/en/integrated-circuits-ics/memory/2556980?k=framIt's more expensive but it's fast for both reads and writes and is more resilient than flash or eeprom, if you need to constantly write to it.. and if i remember correctly it also uses less energy to do it. If you need to make some battery operated device with long life, it may be worth considering it.

author: amyk
author_rank: Super Contributor
timestamp: April 22, 2014, 08:40:58 pm
content: Strictly speaking, Flashisa type of EEPROM.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: April 22, 2014, 08:51:32 pm
content: There is no difference for your application (in theory you don't need to know about memory write at all - just use an external prommer during development/manufacturing), so choose by price/availability.Edit: definitely you DON'T need to read in wider units like mariush advices. Just choose a device that autoincrements address on each byte read, so you'll just command "start read at X", arm the bus for reading, then do in a loop: { get single byte, "rearm" the bus to start receiving next byte while you are shifting/playing current one }. Or even go for "bitbanged" bus and play every bit immediately upon receive.Also try searching for "ISD chipcorder" - there were some specialized chips for storing/playing simple audio.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: April 22, 2014, 09:02:21 pm
content: Their use for PC BIOSes means SPI flash has become insanely cheap - Spansion have 4mbit parts for GBP0.11 and 32mbits for GBP0.27 in 100x qtys at Digikey.For a read-mostly application, there's little to choose between flash & eeprom in terms of performance. SPI flash is 3.3v (or lower) only, and can read much, much faster than eeprom if that's what you need - tens of megabytes per second are possible using fast clocks, QSPI and DDR modes.Where you're writing, things get more complex, and you need to look at your requirement in detail. EEprom has a moderate write time (mS to low 10s of mS) to write up to typically 64-256 bytes.Flash has faster writes (a few hundred uS to write up to 256 bytes) to already-erased pages, BUT very long erase times (many tens of seconds to fully erase a big device) , and large erase page sizes (typically 64K, sometimes as low as 4K), which can mean very big "dead" times which preclude things like continuous streaming unless you have plenty of buffer RAM to cover the erase time. One possible way round this, as they are now so cheap, is to simply use two devices, so one can be writing while the other is erasing.These days the only reason to use EEPROM would be if you need small write granularity, 5V operation, or a small SOT23-6 type package for small capacities, or want to have an I2C interface. Otherwise SPI flash is likely to be cheaper for any significant (>64kbit) capacity.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: April 22, 2014, 09:04:57 pm
content: Quote from: TheRuler8510 on April 22, 2014, 03:26:35 amA quick look at Digikey shows flash about a tenth the price of EEPROM in that sort of capacity range

author: calexanian
author_rank: Super Contributor
timestamp: April 23, 2014, 05:20:05 am
content: Flash is way faster and easier to manage. EEPROM is usually much higher size/cost. Use a micro with a usb host and use a thumb drive! Nice and cheap.

author: matkar
author_rank: Regular Contributor
timestamp: April 23, 2014, 07:30:02 am
content: For the last two years I prefer using SPI FLASH. I use AT45DB series since it has 5V tolerant pins. The drawback is their rewrite endurance in comparison to EEPROM (10 times lesser) but usually it's hard to reach the number anyway. I can't think of any other drawback...

author: TheRuler8510
author_rank: Regular Contributor
timestamp: April 25, 2014, 12:07:48 am
content: Thanks all for your inputs...There's always excellent info on this forum.Tom