background image

 

AVR1612

 

 

11

8282A-AVR-11/10 

3.4.2.4 Erase & Write Page 

The Erase & Write Application Section Page, Erase & Write Boot Loader Section 
Page, and Erase & Write EEPROM Page is used to erase one page and then write a 
loaded Flash/EEPROM page buffer into that page in the selected memory space, in 
one atomic operation. 

1.  Load the NVM CMD register with Erase & Write Application Section/Boot Loader 

Section/User Signature Row/EEPROM Page command. 

2.  Write the selected page by doing a PDI Write. The page is written by addressing 

any byte location within the page. 

The BUSY flag in the NVM STATUS register will be set until the operation is finished. 

3.4.3 Read NVM 

The Read NVM command is used to read the Flash, EEPROM, Fuses, and Signature 
and Calibration row sections. 

1.  Load the NVM CMD register with the Read NVM command. 
2.  Read the selected memory address by performing a PDI Read operation. 

NOTE 

The address is PDI memory space address which described in each device data 
sheet. 

3.4.4 Write Fuse/Lock Bit 

The Write Fuse and Write Lock Bit command is used to write the fuses and the lock 
bits to a more secure setting. 

1.  Load the NVM CMD register with the Write Fuse/ Lock Bit command. 
2.  Write the selected fuse or Lock Bits by doing a PDI Write operation. 

The BUSY flag in the NVM STATUS register will be set until the command is finished. 
For lock bit write the LOCK BIT write command can also be used. 

3.5 Exit the PDI programming 

If there is no activity on the PDI_CLK line for approximately 100µs, the PDI 
automatically disabled. Then set the PDI_CLK to High and set the PDI_DATA to Low. 

4 Example of programming sequence 

After enabling the PDI module and entering external programming mode, the device 
is ready for programming and reading the memory. For more information about the 
PDI initialization, please refer to Section 

2

  Read the memory (include Flash, EEPROM, User Signature, Fuse bits) 

1.  Use STS instruction to write the “Read NVM command (0x43)” to the NVM 

controller’ CMD register. The CMD register’s address is 0x01CA (The NVM 
Controller’s base address is 0x01C0 and the CMD register’s offset address is 
0x0A). Please refer to “4.21 Register Summary - NVM Controller” section and 
“31. Peripheral Module Address Map” section of the 

 for 

more information. 

2.  Set the memory address with “ST ptr” command which is described in Section 

3.4

. The address is mapped into the PDI memory space. 

3.  Set the data length into the repeat counter with “REPEAT” command. 
4.  Send the “LD *(ptr++)” command to the PDI controller. 
5.  Poll to read the PDIBUS until the data delivery completion. 

Summary of Contents for AVR1612

Page 1: ...NVM Controller trough the PDI interface and executing NVM Controller commands The PDI is a 2 pin interface using the Reset pin for the clock input PDI_CLK and the dedicated pin for data input and out...

Page 2: ...scribes the PDI serial frame format Figure 2 1 PDI serial frame format 2 2 Serial transmission and reception The PDI physical layer is either in Transmit TX or Receive RX mode of operation By default...

Page 3: ...1287 ATXmega128A1 XCK RXD TXD 220R 220R PDI CLK PDI DATA 2 4 PDI instruction set The PDI has a small instruction set that is used for all access to the PDI itself and to the internal interfaces All in...

Page 4: ...D 0x20 Load data from PDIBUS Data Space using indirect addressing ST 0x60 Store data to PDIBUS Data Space using indirect addressing LDCS 0x80 Load data from PDI Control and Status Register Space STCS...

Page 5: ...refer to 29 5 7 Instruction Set Summary section of the XMEGA A MANUAL for more information 2 5 NVM Commands The NVM commands that can be used for accessing the NVM memories from external programming a...

Page 6: ...rite Boot Loader Section Page PDI Write 0x39 Boot Loader Section CRC NVMAA Calibration and User Signature sections 0x03 Read User Signature Row PDI Read 0x18 Erase User Signature Row PDI Write 0x1A Wr...

Page 7: ...hould be removed if PDI programming and debugging is used Other external reset sources driving this line should be disconnected Any load on the clock line may give a delay on the clock edge that cause...

Page 8: ...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 ins...

Page 9: ...Bus Doing this all data and program memory spaces are mapped into the linear PDI memory space Figure 3 3 shows the PDI memory space and the base address for each memory space in the Atmel ATxmega128A...

Page 10: ...e data in the Flash or EEPROM page buffer the Flash or EEPROM page must be erased Programming an un erased Flash or EEPROM Page will corrupt the content in the Flash or EEPROM Page 1 Erase Flash or EE...

Page 11: ...the selected fuse or Lock Bits by doing a PDI Write operation The BUSY flag in the NVM STATUS register will be set until the command is finished For lock bit write the LOCK BIT write command can also...

Page 12: ...until it has been cleared Erase and program the EEPROM memory 1 Erase the flash page buffer i Use the ST ptr command to set the address 0x00000000 ii Write Erase EEPROM Page Buffer 0x36 command to th...

Page 13: ...this layer 2 The high level target XMEGA NVM driver which interface the low level PDI driver 3 The low level PDI driver uses the reduced instructions set for the PDI interface to communicate with the...

Page 14: ...tion can be used here used C xplain_pdi_prog 4 Open either the GCC project file or the IAR project file and compile the source code 5 Connect the USB cable of Atmel Xplain to provide power to the Xpla...

Page 15: ...AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODU...

Reviews: