Chapter 1
Introduction
1.1 What is the EEPROM memory and why would I use
it?
Most of the AVRs in Atmel’s product line contain at least some internal EEPROM memory.
EEPROM, short for Electronically Erasable Read-Only Memory, is a form of non-volatile memory
with a reasonably long lifespan. Because it is non-volatile, it will retain its information during
periods of no power and thus is a great place for storing sparingly changing data such as device
parameters.
The AVR internal EEPROM memory has a limited lifespan of 100,000 writes per EEPROM page
— reads are unlimited.
1.2 How is is accessed?
The AVR’s internal EEPROM is accessed via special registers inside the AVR, which control the
address to be written to (EEPROM uses byte addressing), the data to be written (or the data
which has been read) as well as the flags to instruct the EEPROM controller to perform a write
or a read.
The C language does not have any standards mandating how memory other than a single flat model
(SRAM in AVRs) is accessed or addressed. Because of this, just like storing data into program
memory via your program, every compiler has a unique implementation based on what the author
believed was the most logical system.
This tutorial will focus on the GCC compiler.
3