AVR Memory Spaces

The AVR is a Harvard architecture with separate instruction and data memory spaces.

Program memory is grouped into 16-bit words. Each address refers to a 16-bit word.

Atmega64 has 64k bytes (32k words) of flash program memory. Flash is non-volatile but can only written a limited number of times (10000+).

Program instructions and constants are downloaded to flash memory via USB. Not changed during program execution.

Data memory is grouped into 8-bit words. Each address refers to a 8-bit byte.

Atmega64 has 4k bytes of SRAM data memory. SRAM is volatile. Data memory is grouped into bytes.

SRAM may be used by a program to store values during program execution.

Small programs may be able to fit all variables in registers. Large programs will need to store some variables in SRAM. Arrays and function call information has to be stored in SRAM.

Index