448
8331B–AVR–03/12
Atmel AVR XMEGA AU
data registers, but the NVM controller must be loaded with the correct command (i.e., to read
from any NVM, the controller must be loaded with the NVM read command before loading data
from the PDIBUS address space). For the reminder of this section, all references to reading and
writing data or program memory addresses from the PDI refer to the memory map shown in Fig-
ure 33-3 on page 447.
The PDI uses byte addressing, and hence all memory addresses must be byte addresses.
When filling the flash or EEPROM page buffers, only the least-significant bits of the address are
used to determine locations within the page buffer. Still, the complete memory mapped address
for the flash or EEPROM page is required to ensure correct address mapping.
During programming (page erase and page write) when the NVM is busy, the NVM is blocked for
reading.
33.12.3 NVM Commands
The NVM commands that can be used for accessing the NVM memories from external program-
ming are listed in Table 33-5 on page 448. This is a superset of the commands available for self-
programming.
For external programming, the trigger for action-triggered commands is to set the CMDEX bit in
the NVM CTRLA register (CMDEX). The read-triggered commands are triggered by a direct or
indirect load instruction (LDS or LD) from the PDI (PDI read). The write-triggered commands are
triggered by a direct or indirect store instruction (STS or ST) from the PDI (PDI write).
”Chip Erase” on page 449 through ”Write Fuse/ Lock Bit” on page 451 explain in detail the algo-
rithm for each NVM operation. The commands are protected by the lock bits, and if read and
write lock is set, only the chip erase and flash CRC commands are available.
Table 33-5. NVM commands available for external programming.
CMD[6:0] Commands / Operation Trigger
Change
Protected NVM Busy
0x00 No operation ---
0x40 Chip erase
(1)
CMDEX Y Y
0x43 Read NVM PDI Read N N
Flash Page Buffer
0x23 Load flash page buffer
PDI Write N N
0x26 Erase flash page buffer
CMDEX Y Y
Flash
0x2B Erase flash page PDI write N Y
0x2E Write flash page PDI write N Y
0x2F Erase and write flash page PDI write N Y
0x78 Flash CRC CMDEX Y Y
Application Section
0x20 Erase application section
PDI write N Y
0x22 Erase application section page
PDI write N Y
0x24 Write application section page
PDI write N Y
0x25 Erase and write application section page
PDI write N Y