7.3 In-System Reprogrammable Flash Program Memory

The AVR32/16DU32/28/20/14 contains up to 32 KB on-chip in-system reprogrammable Flash memory for program storage. Since all AVR instructions are 16 or 32 bits wide, the Flash is organized with a 16-bit data width. For write protection, the Flash program memory space can be divided into the following three sections: The Boot Code section, the Application Code section, and the Application Data section. The code in one section may be restricted from writing to addresses in the other sections. The Program Counter can address the whole program memory.

For further details, refer to the Code Size (CODESIZE) and Boot Size (BOOTSIZE) descriptions and the NVMCTRL - Nonvolatile Memory Controller section.

The Program Counter can address the whole program memory. The procedure for writing Flash memory is described in detail in the documentation of the Nonvolatile Memory Controller (NVMCTRL) peripheral.

Each 32 KB section from the Flash memory is mapped into the data memory space and is accessible with LD/ST instructions. For LD/ST instructions, the Flash is mapped from address 0x8000 to 0xFFFF. The entire Flash memory space can be accessed with the LPM/SPM instruction. For the LPM/SPM instruction, the Flash start address is 0x0000.

Table 7-1. Physical Properties of Flash Memory
Property

AVR16DU14

AVR16DU20

AVR16DU28

AVR16DU32

AVR32DU14

AVR32DU20

AVR32DU28

AVR32DU32

Size16 KB32 KB
Page size512B512B
Number of pages3264
NRWW section size (bottom of overall Flash) / RWW section size4 KB/12 KB4 KB/28 KB
Start address in data space0x80000x8000
Start address in code space0x00x0