SAM D21 Memory Architecture

Last modified by Microchip on 2023/11/10 11:09

The memory on a SAM D21 MCU is mapped into four sections:

  1. Flash Memory
  2. Flash Memory with Read-While-Write (RWW) capability
  3. Internal RAM
  4. Peripherals and I/O ports

Memory Map

Flash Memory

Flash memory is non-volatile memory used to store executable instructions as well as some calibration data and default configuration settings. SAMD21 compilers will use most of the Flash memory addresses to store instructions.

A predetermined range of the Flash memory addresses is designated as auxiliary memory. Auxiliary memory contains factory-set calibration data as well as the NVM user Row. The NVM user Row establishes the default setting for the Watch Dog Timer, Brownout detector, and the Flash RWW memory.

Calibration

Some experienced PIC® MCU developers will see the similarities between an Arm® Cortex®-M0+ NWM user row and PIC configuration words.

Flash Memory with Read-While-Writing (RWW) capability:

The RWW is only available on some D21 MCUs. RWW is the portion of the Flash array that can be set to emulate EEPROM. The amount of Flash available for EEPROM emulation is established by the non-volatile memory controller NVMCTRL.

Internal High-Speed RAM

The internal high-speed RAM allows the CPU to read or write application data in a single instruction cycle. Please refer to the datasheet for the amount of memory on the device you are using.

Peripheral Bridges and I/O Ports

The peripheral's registers and the registers controlling the I/O pins are mapped to memory locations. The CPU accesses the peripherals and I/O pin registers by reading or writing to specific mapped memory addresses. Peripherals are accessed through one of three peripheral bridges. Direct access to the I/O pins is accomplished by accessing the IOBUS mapped addresses.