flash memory

what atmega 328 has higher 32KB Flash memory than less 1kb of eeprom.eeprom is actually for permentatnt storage of program.but what actually flash memory is for?.thank you in advance

Flash memory is for storing programs in.
EEPROM is for storing things like settings for an individual machine without requiring recompilation.

@awol
i am not still clear could you explain me some more detially.please

bhuvaneshnick: eeprom is actually for permentatnt storage of program.

No. The program is permanently stored in Flash.

EEPROM is permanent storage that the running program can use.

@james

EEPROM is permanent storage that the running program can use.

actually SRAM Used for run-time needs like variables .am i right

Yes SRAM is for run-time variable but is not permanent. EEPROM is permanent storage for variables.

Yes, SRAM is used for variables, stack and heap.

EEPROM will hold data thru a reset, or loss of power. SRAM will not. EEPROM data can be changed by your sketch. Flash cannot - it is only be changed by loading a new sketch.

@crossroads

"your sketch"and "new sketch"

what you pointing here..

A running sketch can load data into EEPROM.

Downloading via the USB interface (File:Upload) puts the new sketch into Flash.

thank you for all

Lets do it with an analogy

a microprocessor is in a tiny scale the same like a PC,

  • the SRAM is the RAM in the computer, the place where the program loads and handle the data .
  • FLASH memory may be the programs files folder
  • EEPROM may be the DOCUMENT and SETTINGS USER folder

oh... In PC's also exist an other KIND of memory the CACHE or the pagination file, is used to storage some pieces of the ram which are not used often, in order to save RAM, in micros is when we use PROGMEM to storage some big variables in order to save SRAM well it is my analogy.

I'm more like a new guy in micros but this is what I have been learned, hope I don't confuse, and put it more clear to you.

however in a microcontroller the memory is infinitely more tiny (I just run out of memory(flash) with an attiny 2313 =( )

regards to all. happy new year.

the CACHE or the pagination file, is used to storage some pieces of the ram which are not used often,

No, page file and cache are distinct entities with different purposes. Cache is very fast memory close to the CPU (often in multiple tiers), used to decouple the CPU from the relatively slow main memory. Page file is used in virtual memory systems to back out to ordinary disk storage less frequently used main memory.

The sort of micro controller we're talking about here has neither.

is just an analogy but is true the cache in computers is the memory inside the processor.

I can see the cache may bee similar to the general purpose registers near to the ALU.

regards.

he cache in computers is the memory inside the processor.

"Inside the processor" is a relatively recent development. Desktop computers based on the Intel 486 CPU still relied on external cache memory, and most 386 CPUs had no internal cache at all.

"cache" is also a sort of generic term for "any quicker but smaller memory placed transparently (at some level) in a data path." So the disk drive in your computer has some RAM memory that is a cache for the disk, and your web browser has a cache for internet data that is ON the disk...

On an AVR, the flash memory holds the programs, and EEPROM holds data that does not disappear at powerdown. The other major difference is that flash memory is usually erased and written in "pages", while EEPROM can be written one byte at a time.