Programming

The Flash programming is done by writing one byte or one word at a time. Writing from the CPU using store type instructions (ST*) will write one byte at a time, while a write with the Store Program Memory (SPM) instruction will write one word at a time.

The NVMCTRL command set supports multiple Flash erase operations. Up to 32 pages can be erased at the same time. The duration of the erase operation is independent of the number of pages being erased.

The EEPROM erasing has byte granularity with the possibility of erasing up to 32 bytes in one operation. The EEPROM is written one byte at a time, and it has an option to do the erase and write of one byte in the same operation.

The User Row is erased/written as a normal Flash. When the erasing operation is used, the entire User Row is erased at once. The User Row writing has byte granularity.

The Fuse programming is identical to the EEPROM programming, but it can be performed only via the UPDI interface.

Table 1. Programming Granularity
Memory Section Erase Granularity Write Granularity
Flash array Page Word(1)
EEPROM array Byte Byte
User Row Page(2) Byte(3)
Fuses Byte Byte
Notes:
  1. 1.Byte granularity when writing to the CPU data space memory mapped section.
  2. 2.One page is 32 bytes.
  3. 3.Page granularity when programming from UPDI on a locked device.