Notifications
Clear all

Difference between EEPROM and Flash?

3 Posts
4 Users
1 Reactions
2,817 Views
0
Topic starter

Hey,

I’m confused about the difference between EEPROM and Flash memory. 


3 Answers
1

Both are very different from each other. Here's how:

Flash Memory

  • Purpose: Primarily used to store the program (firmware) that runs on the microcontroller.
  • Access Method: Works at the block level, meaning you write or erase data in chunks, not byte by byte.
  • Endurance: Lower than EEPROM, typically around 10,000 to 100,000 write/erase cycles per block.
  • Speed: Faster read speeds compared to EEPROM.
  • Capacity: Much larger than EEPROM (e.g., Arduino Uno has 32 KB of Flash memory).

 

EEPROM (Electrically Erasable Programmable Read-Only Memory)

  • Purpose: Designed to store small amounts of data that need to be saved even when the power is off (e.g., device settings or user preferences).
  • Access Method: Data is accessed and written byte by byte, making it perfect for small, frequently changing data.
  • Endurance: It has a high write endurance, typically allowing 100,000 to 1,000,000 write/erase cycles.
  • Speed: Slower compared to Flash.
  • Capacity: Usually much smaller (e.g., Arduino Uno has only 1 KB of EEPROM).

 

What is their purpose in Arduino boards?

Flash Memory: This is where your Arduino sketch is stored when you upload it via the IDE. If you need to store constant data like lookup tables, you can use Flash with the PROGMEM directive.

EEPROM: You can use it to store user-defined values like calibration data or device settings using the EEPROM library to store it permanently.

 


0

Here’s how it is used practically:

  • EEPROM: To store device-specific configurations, like sensor offsets or mode settings. These values are written during setup and rarely change after that.
  • Flash: For storing firmware or read-only data like lookup tables. For example, in an IoT project, I store calibration data in EEPROM and preloaded HTML pages in Flash for the web server.

If your data changes frequently, EEPROM is the better choice due to its higher write endurance. Just don’t forget to minimize unnecessary writes to prolong its lifespan


0

EEPROM and Flash are both non-volatile memories built from floating‑gate transistors, but they differ mainly in write/erase granularity.

EEPROM lets you update individual bytes (it internally erases just that byte), giving higher endurance and making it ideal for small, frequently changed settings.

Flash must erase larger blocks/sectors and program in pages (you typically erase a whole sector before changing any byte), which makes it cheaper per bit and faster for bulk storage like firmware and large data.


Share: