Home / Learn Embedded C / EEPROM and Non-Volatile Storage
EEPROM and Non-Volatile Storage
Where firmware keeps small settings that must survive a power cycle.
The idea, explained simply
In plain terms
EEPROM (and similar non-volatile storage) is memory that keeps its contents even with power off, used for small amounts of data that must survive resets — like a saved Wi-Fi password or calibration value.
Why we use it
RAM is wiped every time power is lost; flash is usually erased/written in large blocks, not single bytes — EEPROM (built into many chips, or external) fills the gap for small, frequently-updated persistent data.
Under the hood
EEPROM is typically read and written a byte (or a few bytes) at a time via simple read/write functions provided by the chip's standard library, and has a limited number of write cycles per cell (often ~100,000), which is why wear leveling matters (next lesson).
Real-world use
- Saved configuration
- Calibration data
- Device settings that must survive reboot
Try it
A real EEPROM driver calls chip-specific read/write functions instead of a plain array, but the byte-at-a-time model is the same.
| Storage | Survives power loss? | Typical write granularity | Typical use |
|---|---|---|---|
| RAM | No | Byte | Working variables |
| EEPROM | Yes | Byte (slow) | Small settings, calibration data |
| Flash (program memory) | Yes | Block/page (fast per block, but whole blocks) | Code, and sometimes larger saved data |
Try it: storing several settings bytes at once
Real EEPROM libraries use a fixed memory map like this, so each setting always lives at the same known address across power cycles.
Quick quiz
1. What is EEPROM typically used for in embedded systems?
EEPROM's byte-level read/write and non-volatility make it ideal for small persistent settings.