16
8025I–AVR–02/09
ATmega48P/88P/168P/328P
5.
AVR Memories
5.1
Overview
This section describes the different memories in the ATmega48P/88P/168P/328P. The AVR
architecture has two main memory spaces, the Data Memory and the Program Memory space.
In addition, the ATmega48P/88P/168P/328P features an EEPROM Memory for data storage. All
three memory spaces are linear and regular.
5.2
In-System Reprogrammable Flash Program Memory
The ATmega48P/88P/168P/328P contains 4/8/16/32K bytes On-chip In-System Reprogramma-
ble Flash memory for program storage. Since all AVR instructions are 16 or 32 bits wide, the
Flash is organized as 2/4/8/16K x 16. For software security, the Flash Program memory space is
divided into two sections, Boot Loader Section and Application Program Section in ATmega88P
and ATmega168P. ATmega48P does not have separate Boot Loader and Application Program
sections, and the SPM instruction can be executed from the entire Flash. See SELFPRGEN
description in section
”SPMCSR – Store Program Memory Control and Status Register” on page
and
for more details.
T h e F la s h m e m o r y h a s a n e n d u r a n c e o f a t l e a s t 1 0 ,0 0 0 w r i t e / e r a s e c y c l e s . T h e
ATmega48P/88P/168P/328P Program Counter (PC) is 11/12/13/14 bits wide, thus addressing
the 2/4/8/16K program memory locations. The operation of Boot Program section and associ-
ated Boot Lock bits for software protection are described in detail in
”Boot Loader Support – Read-While-Write Self-Program-
ming, ATmega88P, ATmega168P and ATmega328P” on page 277
contains a detailed description on Flash Programming in SPI- or Parallel Programming
mode.
Constant tables can be allocated within the entire program memory address space (see the LPM
– Load Program Memory instruction description).
Timing diagrams for instruction fetch and execution are presented in