Difference between EEPROM and flash memory

Hey there,

I have a confusion here actually.

What's the difference between EEPROM and flash memory of a chip ?

Thank you

In the arduino flash memory is the place where the program is stored and EEPROM is just for non volatile data.
In general flash is quicker to read from, the both take a bit of time to write to.

so what for i have to expand the eeprom storage?

English a bit bad on that.

It is rare that you would want to expand EEPROM memory, but for example I have used external chips to store a look up wave table.
For most projects you would not even use the EEPROM.

Vincent19:
so what for i have to expand the eeprom storage?

Most people use SD cards when they need more storage.

So normally we expand the flash memory only?

Vincent19:
So normally we expand the flash memory only?

The internal memory on the Arduino can't be expanded. If you need more you have to use an Arduino Mega.

There is no way to expand any memory on an Arduino.
On the mega you can expand the SRAM with a card but that is all.

All other forms of memory expansion is what it known as paged memory. It does not appear in the memory map, you can't use it for program storage or variables, only for storing data through port bit manipulation.

What do you want to expand and why?

I may jump in here, if I may, as I was about to start a thread asking a question that has come about in the last few replies. I'm working on a project at the moment that will ultimately need multiple large look up tables. 4 or 5 tables of 15 x 10 values for example.

  1. Look up tables are stored in EEPROM yes? If so, I can expand the amount of EEPROM I have by adding an external EEPROM chip?

  2. Regarding SRAM, if I understand correctly - this type of memory is used up quickly when performing float calculations, doing serial strings etc - can one also expand SRAM with an external chip? Currently I'm using a 1284P, so have quite an abundance of SRAM - however, I/O requirements may see me needing to up to a 2560 chip.

Static Lookup tables are typically stored in PROGMEM. EEPROM is generally used when the sketch needs to make changes that need to be stored.

You can add external EEPROM & SRAM. FRAM is another option - writes fast like SRAM, has EEPROM non-volatility. All are available in little 8-pin packages with serial interface.

  1. Look up tables are stored in EEPROM yes? I

They can be if you want, although you have some EEPROM built in. They could also be stored in Flash if they are static, that is if they don't change.

I can expand the amount of EEPROM I have by adding an external EEPROM chip?

Yes, well you don't expand the internal stuff you just have an external I2C chip.

this type of memory is used up quickly when performing float calculations

No floating point makes little difference to the SDRM usage.

can one also expand SRAM with an external chip?

Extra memory shield for the Mega
http://www.ruggedcircuits.com/html/megaram.html

I/O requirements may see me needing to up to a 2560 chip.

Shame, there are many ways to increase I/O without going to a bigger processor, just use a port expander.

I see - thank you for input thus far. I will take a look at port expanding, it doesn't sound like it should be too much of an issue as I only need more general purpose I/O, for things like low rate sensor sampling.

The look up tables are static yes, if they need to be changed - then it's a reflash job, there are slight modifiers to these values, adders and multipliers and what not - but that's temporary stuff that is stored in RAM yes?

Now I know I can up my I/O this way - sticking with the 1284, with it's large amount of RAM - I need not worry about adding external. Maybe just external EEPROM to allow for a bit of future flexibility in the PCB.

but that's temporary stuff that is stored in RAM yes?

Yes.

Look at the MCP23S17 it is one I use a lot, it uses the SPI bus or the MCP23017 that uses the I2C bus.
They give you 16 I/O per chip and you can have 8 chips on each bus.

Wow - that's just opened a lot of doors for me, thanks so much for the recommendation. I'll check them out now. This is all a very steep learning curve for me, that is only getting more and more enjoyable :smiley:

EDIT: I'm just looking at things like data rates - but any preferences of I2C vs SPI? I've only used SPI for ICSP before, and I2C for a few temp sensors. I have chosen SPI as the bandwidth is FAR higher.

On another note, any recommendations for external serial EEPROM chips people have successfully used? Also, what's the bit value talking about here? For example, microchip offer them in 128bit, 1kbit, 2, 4, 8 etc...

So, how can I expand the IO pins in arduino UNO ?

jtw11, how much memory do you need, and how often will you use it?
I'd go with this.
http://www.mouser.com/ProductDetail/Ramtron/FM25640B-G/?qs=sGAEpiMZZMtsPi73Z94q0LVCZPBibhMGLoJvNRrGMO0%3D
64K, SPI, 5V operation. Doesn't have 3.3mS write times like EEPROM, you'll never wear it out.

Vincent19,
Connect up the Arduino ICSP header to the SPI port (lower left) on a board like this, and bring over the additional CS and INT pins from D2-3-4 or wherever.

Probably a library for this chip somewhere too.

Available in DIP package also
28-pin PDIP (300 mil)

Vincent19:
So, how can I expand the IO pins in arduino UNO ?

Lots of ways.
Look at this project of mine, if you down load the schematics there are versions both with and without port expansion.

http://www.thebox.myzen.co.uk/Hardware/Pendulum.html

jtw11:
I may jump in here, if I may, as I was about to start a thread asking a question that has come about in the last few replies. I'm working on a project at the moment that will ultimately need multiple large look up tables. 4 or 5 tables of 15 x 10 values for example.

That's hardly massive...should fit in progmem.

jtw11:

  1. Look up tables are stored in EEPROM yes? If so, I can expand the amount of EEPROM I have by adding an external EEPROM chip?

  2. Regarding SRAM, if I understand correctly - this type of memory is used up quickly when performing float calculations, doing serial strings etc - can one also expand SRAM with an external chip? Currently I'm using a 1284P, so have quite an abundance of SRAM - however, I/O requirements may see me needing to up to a 2560 chip.

It all depends on how fast/often you need to look things up...and if you need to write data as well as read it.

There's a lot of 8-pin flash memory chips out there with SPI interfaces of you're mostly reading data.

SRAM is only needed if you're writing/updating the data a lot.

EEPROM is somewhere between the two.

First though, you have to define your speed requirements.

It seems then extra RAM is the best option - as I'm reading static values from flash stored by PROGMEM, but than altering them as mentioned with terms such as adders and multipliers, and thus are stored in RAM. Right now, there's no way I've run out of RAM - but future code may do when processing many many more terms at once, so best add it to the hardware now.

These values in RAM are being updated on average, once each mS, sometimes twice as fast. Sounds like EEPROM is FAR too slow here.

jtw11:
It seems then extra RAM is the best option - as I'm reading static values from flash stored by PROGMEM, but than altering them as mentioned with terms such as adders and multipliers, and thus are stored in RAM. Right now, there's no way I've run out of RAM - but future code may do when processing many many more terms at once, so best add it to the hardware now.

These values in RAM are being updated on average, once each mS, sometimes twice as fast.

Sounds like you need an SRAM chip with SPI interface. You can get them in little 8-pin chips.

jtw11:
Sounds like EEPROM is FAR too slow here.

The onboard EEPROM take about 1ms to write a single byte. I can't imagine external EEPROMS will be any better.