11.3.2.4 Command Modes

Reading the memory arrays is handled using the LD*/LPM(1) instructions.

The EEPROM Erase (EECHER) command is started by writing a command to the NVMCTRL.CTRLA register. The other write/erase operations are just enabled by writing commands to the NVMCTRL.CTRLA register and must be followed by writes using ST*/SPM(1) instructions to the memory arrays.

Note:
  1. LPM/SPM cannot be used for EEPROM.
To write a command in the NVMCTRL.CTRLA register, the following sequence needs to be executed:
  1. Confirm that any previous operations are completed by reading the Busy (EEBUSY and FLBUSY) flags in the NVMCTRL.STATUS register.
  2. Write the appropriate key to the Configuration Change Protection (CPU.CCP) register to unlock the NVM Control A (NVMCTRL.CTRLA) register.
  3. Write the desired command value to the CMD bit field in the Control A (NVMCTRL.CTRLA) register within the following four instructions.