438
8331B–AVR–03/12
Atmel AVR XMEGA AU
Notes:
1. The flash range CRC command used byte addressing of the flash.
2. Will depend on the flash section (application or boot loader) that is actually addressed.
3. This command is qualified with the lock bits, and requires that the boot lock bits are unprogrammed.
4. When using a command that changes the normal behavior of the LPM command; READ_USER_SIG_ROW and
READ_CALIB_ROW; it is recommended to disable interrupts to ensure correct execution of the LPM instruction.
33.11.2.1
Read Flash
The (E)LPM instruction is used to read one byte from the flash memory.
1.
Load the Z-pointer with the byte address to read.
2.
Load the NVM command register (NVM CMD) with the no operation command.
3.
Execute the LPM instruction.
The destination register will be loaded during the execution of the LPM instruction.
33.11.2.2
Erase Flash Page Buffer
The erase flash page buffer command is used to erase the flash page buffer.
1.
Load the NVM CMD with the erase flash page buffer command.
2.
Set the command execute bit (NVMEX) in the NVM control register A (NVM CTRLA).
This requires the timed CCP sequence during self-programming.
The NVM busy (BUSY) flag in the NVM status register (NVM STATUS) will be set until the page
buffer is erased.
0x02E
WRITE_FLASH_PAGE
Write flash page
SPM
N/Y
Y
Y
Z-pointer
-
0x2F
ERASE_WRITE_FLASH_PAGE
Erase and write flash page
SPM
N/Y
Y
Y
Z-pointer
-
0x3A
FLASH_RANGE_CRC
Flash range CRC
CMDEX
Y
Y
Y
DATA/ADDR
DATA
Application Section
0x20
ERASE_APP
Erase application section
SPM
Y
Y
Y
Z-pointer
-
0x22
ERASE_APP_PAGE
Erase application section page
SPM
N
Y
Y
Z-pointer
-
0x24
WRITE_APP_PAGE
Write application section page
SPM
N
Y
Y
Z-pointer
-
0x25
ERASE_WRITE_APP_PAGE
Erase and write application section page
SPM
N
Y
Y
Z-pointer
-
0x38
APP_CRC
Application section CRC
CMDEX
Y
Y
Y
-
DATA
Boot Loader Section
0x2A
ERASE_BOOT_PAGE
Erase boot loader section page
SPM
Y
Y
Y
Z-pointer
-
0x2C
WRITE_BOOT_PAGE
Write boot loader section page
SPM
Y
Y
Y
Z-pointer
-
0x2D
ERASE_WRITE_BOOT_PAGE
Erase and write boot loader section page
SPM
Y
Y
Y
Z-pointer
-
0x39
BOOT_CRC
Boot loader section CRC
CMDEX
Y
Y
Y
-
DATA
User Signature Row
0x01
READ_USER_SIG_ROW
Read user signature row
LPM
N
N
N
Z-pointer
Rd
0x18
ERASE_USER_SIG_ROW
Erase user signature row
SPM
Y
Y
Y
-
-
0x1A
WRITE_USER_SIG_ROW
Write user signature row
SPM
Y
Y
Y
-
-
Calibration Row
0x02
READ_CALIB_ROW
Read calibration row
LPM
N
N
N
Z-pointer
Rd
Table 33-2.
Flash self-programming commands (Continued).
CMD[6:0]
Group Configuration
Description
Trigger
CPU
Halted
NVM
Busy
Change
Protected
Address
Pointer
Data
Registe
r