11.3.2.2 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 11-3. Programming Granularity
Memory SectionErase GranularityWrite Granularity
Flash arrayPageWord(1)
EEPROM arrayByteByte
User RowPage(2)Byte(3)
FusesByteByte
Note:
  1. Byte granularity when writing to the CPU data space memory mapped section.
  2. One page is 32 bytes.
  3. Page granularity when programming from UPDI on a locked device.