442
8331B–AVR–03/12
Atmel AVR XMEGA AU
1.
Load the Z-pointer with the byte address to read.
2.
Load the NVM CMD register with the read user signature row / calibration row
command
3.
Execute the LPM instruction.
The destination register will be loaded during the execution of the LPM instruction.
To ensure that LPM for reading flash will be executed correctly it is adviced to disable interrupt
while using either of these commands.
33.11.3
NVM Fuse and Lock Bit Commands
The NVM flash commands that can be used for accessing the fuses and lock bits are listed in
.
For self-programming of the fuses and lock bits, 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 executing the (E)LPM instruction (LPM). The write-triggered commands are trig-
gered by a executing the SPM instruction (SPM).
The Change Protected column indicates whether the trigger is protected by the configuration
change protection (CCP) during self-programming or not. The last two columns show the
address pointer used for addressing and the source/destination data register.
through
explain in detail the algo-
rithm for each NVM operation.
33.11.3.1
Write Lock Bits
The write lock bits command is used to program the boot lock bits to a more secure settings from
software.
1.
Load the NVM DATA0 register with the new lock bit value.
2.
Load the NVM CMD register with the write lock bit command.
3.
Set the CMDEX bit in the NVM CTRLA register. This requires the timed CCP sequence
during self-programming.
The BUSY flag in the NVM STATUS register will be set until the command is finished. The CPU
is halted during the complete execution of the command.
This command can be executed from both the boot loader section and the application section.
The EEPROM and flash page buffers are automatically erased when the lock bits are written.
33.11.3.2
Read Fuses
The read fuses command is used to read the fuses from software.
1.
Load the NVM ADDR register with the address of the fuse byte to read.
Table 33-3.
Fuse and lock bit commands.
CMD[6:0]
Group Configuration
Description
Trigger
CPU
Halted
Change
Protected
NVM
Busy
Address
Pointer
Data
Registe
r
0x00
NO_OPERATION
No operation
-
-
-
-
-
-
Fuses and Lock Bits
0x07
READ_FUSES
Read fuses
CMDEX
Y
N
Y
ADDR
DATA
0x08
WRITE_LOCK_BITS
Write lock bits
CMDEX
N
Y
Y
ADDR
-