8
AVR1612
8282A-AVR-11/10
3.2 Enable the PDI module
The PDI Physical must be enabled before it can be used. This is done by first forcing
the PDI_DATA line high for a period longer than the equivalent external reset
minimum pulse width (refer to device data sheet for reset characteristics).
The first PDI_CLK cycle must start no later than 100µS after the RESET functionality
of the Reset pin was disabled. If this does not occur in time the RESET functionality
of the Reset pin is automatically enabled again and the enabling procedure must start
over again.
After this sequence, the PDI is enabled and ready to receive instructions. The enable
sequence is shown in
Figure 3-2.
Sequence for enabling the PDI.
3.3 Enter external programming mode
Even after an external programmer has established communication with the PDI
module, the internal interfaces are not accessible by default. To get access to the
NVM Controller and the NVM memories for programming, a unique key must be
signalized by using the KEY instruction. The internal interface is accessed as one
linear address space using a dedicated bus (PDIBUS) between the PDI and the
internal interfaces.
PDI Control and Status Register Space can be accessed with STCS (Store) and
LDCS (Load) instruction. Please refer to “29.7 Register Description - PDI Control and
Status Register” section and “29.5.7 Instruction Set Summary” section of th for more information.
The key that must be sent using the KEY instruction is 64 bits long. The key that will
enable NVM Programming is:
0x1289AB45CDD888FF
The sequence of entering external programming is as following:
1. Load the PDI RESET register with the Reset Signature (0x59).
2. Load the correct NVM key in the PDI.
3. Poll NVMEN in the PDI Status Register (PDI STATUS) until NVMEN is set.
When the NVMEN bit in the PDI STATUS register is set the NVM interface is active
from the PDI.
3.4 Memory Programming
This section describes how to program the Non Volatile Memory (NVM) in XMEGA
®
with external programming. The NVM consist of the Flash Program Memory, User
Signature and Calibration rows, Fuses and Lock Bits, and EEPROM data memory.
For external programming the device is accessed through the PDI and PDI Controller,
using PDI physical connection. Through the PDI, the external programmer access all