Skip to main content
AVR Memory Architecture

AVR Memory Architecture

The AVR family of microcontrollers use a modified Harvard Architecture which uses 3 types of memory, most of which are on chip.

  • Flash
  • RAM
  • EEPROM

Flash

Flash is non volatile memory, which means it perisists when power is removed. Its purpose is to hold intructions that the microcontroller executes. The amount of flash can range from 512 bytes on an ATTiny to 384K on an ATxmega384A1. AVR microcontrollers can be thought of having 2 modes, a flash programming and a flash executing mode.

By modifying fuse settings (BOOTSZ0 & BOOTSZ1 on the ATmega168) some AVR microcontrollers allow you to reserve sections of flash for a bootloader and reserved application flash section. The bootloader allows the flash programming process to be controlled by a flash resident program. Some bootloader applications might include.

  • Decrypt encrypted flash files to prevent reverse engineering
  • Implement a self destruct sequence triggered by a tamper sensor
  • Allow the device to be programmed from a TFTP server

RAM

RAM is volatile memory that stores the runtime state of the program being executed. The amount of RAM can range from 32 byes on an ATTiny28L to 32KB on an ATxmega384A1. In many AVR microcontrollers RAM is split into 4 subsections:

  • General purpose registers
  • I/O registers
  • Extended I/O registers
  • Internal RAM

AVR microcontrollers have RAM on-chip but some AVRs (e.g. ATMega128) can use external RAM modules to extent what is built into the microcontroller.

EEPROM

EEPROM is non volatile memory which is used to store data. The most common use is to store configurable parameters. The amount of EEPROM can range from 32 bytes on an ATTiny to 4KB on an XMega.

Related News

Introduction to 74HC595 shift register – Controlling 16 LEDs

This tutorial shows you how to control 16 LEDs with just 3 control lines. We...

Board Stacking 101

Board Stacking – 101

Board stacking is simply the process of taking 2 or more prototyping boards and fixing...

Severed hand in a jar Halloween display

For this post I thought I'd try something a little different. I've created 3 videos...

Leave a reply

Shopping Cart