Author Topic: Flash or EEPROM: Which Should I Use?  (Read 4177 times)

0 Members and 1 Guest are viewing this topic.

Offline TheRuler8510Topic starter

  • Regular Contributor
  • *
  • Posts: 179
  • Country: us
  • RF Engineer
Flash or EEPROM: Which Should I Use?
« on: April 22, 2014, 03:26:35 am »
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
"There are no facts, only interpretations."
--Friederich Nietzsche
 

Offline Niklas

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: se
Re: Flash or EEPROM: Which Should I Use?
« Reply #1 on: April 22, 2014, 03:02:10 pm »
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.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Flash or EEPROM: Which Should I Use?
« Reply #2 on: April 22, 2014, 03:08:17 pm »
Quote
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?

None 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.
================================
https://dannyelectronics.wordpress.com/
 

Offline TheRuler8510Topic starter

  • Regular Contributor
  • *
  • Posts: 179
  • Country: us
  • RF Engineer
Re: Flash or EEPROM: Which Should I Use?
« Reply #3 on: April 22, 2014, 04:35:14 pm »

How much data are you willing to buffer between writes?


Answer: 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
"There are no facts, only interpretations."
--Friederich Nietzsche
 

Offline TheRuler8510Topic starter

  • Regular Contributor
  • *
  • Posts: 179
  • Country: us
  • RF Engineer
Re: Flash or EEPROM: Which Should I Use?
« Reply #4 on: April 22, 2014, 04:42:14 pm »
Quote

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.


1) Need short 2-4 second sound samples for easy playback. They won't ever change i.e. permanent, except for prototyping where it will change.
2) Writing can be slow, but playback needs to be 100-200 KHz, one bit at a time.

Maybe I need a permanant ROM? I'm an analog guy, so I am a newbie on simple digital stuff.

Thanks,

"There are no facts, only interpretations."
--Friederich Nietzsche
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Flash or EEPROM: Which Should I Use?
« Reply #5 on: April 22, 2014, 04:54:29 pm »
-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.
================================
https://dannyelectronics.wordpress.com/
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5059
  • Country: ro
  • .
Re: Flash or EEPROM: Which Should I Use?
« Reply #6 on: April 22, 2014, 05:46:42 pm »
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 etc

Flash, 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=fram

It'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.
 

Online amyk

  • Super Contributor
  • ***
  • Posts: 8288
Re: Flash or EEPROM: Which Should I Use?
« Reply #7 on: April 22, 2014, 08:40:58 pm »
Strictly speaking, Flash is a type of EEPROM.
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 825
  • Country: es
Re: Flash or EEPROM: Which Should I Use?
« Reply #8 on: April 22, 2014, 08:51:32 pm »
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.
« Last Edit: April 22, 2014, 09:07:06 pm by abyrvalg »
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13773
  • Country: gb
    • Mike's Electric Stuff
Re: Flash or EEPROM: Which Should I Use?
« Reply #9 on: April 22, 2014, 09:02:21 pm »
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.

Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13773
  • Country: gb
    • Mike's Electric Stuff
Re: Flash or EEPROM: Which Should I Use?
« Reply #10 on: April 22, 2014, 09:04:57 pm »
Flash or EEPROM of size 512K or 1 Meg in an 8-pin pkg are both cheap.
A quick look at Digikey shows flash about a tenth the price  of EEPROM in that sort of capacity range
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline calexanian

  • Super Contributor
  • ***
  • Posts: 1881
  • Country: us
    • Alex-Tronix
Re: Flash or EEPROM: Which Should I Use?
« Reply #11 on: April 23, 2014, 05:20:05 am »
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.
Charles Alexanian
Alex-Tronix Control Systems
 

Offline matkar

  • Regular Contributor
  • *
  • Posts: 153
  • Country: si
  • Sixty percent of the time it works EVERY time.
Re: Flash or EEPROM: Which Should I Use?
« Reply #12 on: April 23, 2014, 07:30:02 am »
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...
 

Offline TheRuler8510Topic starter

  • Regular Contributor
  • *
  • Posts: 179
  • Country: us
  • RF Engineer
Re: Flash or EEPROM: Which Should I Use?
« Reply #13 on: April 25, 2014, 12:07:48 am »
Thanks all for your inputs...

There's always excellent info on this forum. :-DMM

Tom
"There are no facts, only interpretations."
--Friederich Nietzsche
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf