29.3.7.1 Chip Erase
The following steps should be followed to issue a Chip Erase.
1.
Enter the CHIPERASE KEY by using the KEY instruction. See
signature.
2.
Optional: Read the Chip Erase bit in the AS Key Status register (CHIPERASE in
UPDI.ASI_KEY_STATUS) to see that the KEY is successfully activated.
3.
Write the Reset signature into the UPDI.ASI_RESET_REQ register. This will issue a System Reset.
4.
Write 0x00 to the ASI Reset Request register (UPDI.ASI_RESET_REQ) to clear the System Reset.
5.
Read the Lock Status bit in the ASI System Status register (LOCKSTATUS in
UPDI.ASI_SYS_STATUS).
6.
Chip Erase is done when LOCKSTATUS == 0 in UPDI.ASI_SYS_STATUS. If LOCKSTATUS == 1,
go to point 5 again.
After a successful Chip Erase, the Lockbits will be cleared, and the UPDI will have full access to the
system. Until Lockbits are cleared, the UPDI cannot access the system bus, and only CS-space
operations can be performed.
During Chip Erase, the BOD is forced ON (ACTIVE=0x1 in BOD.CTRLA) and uses the BOD
CAUTION
Level from the BOD Configuration fuse (LVL in BOD.CTRLB = LVL in FUSE.BODCFG). If the
supply voltage V
increased adequately.
29.3.7.2 NVM Programming
If the device is unlocked, it is possible to write directly to the NVM Controller using the UPDI. This will
lead to unpredictable code execution if the CPU is active during the NVM programming. To avoid this, the
following NVM Programming sequence should be executed.
1.
Follow the Chip erase procedure as described in
point can be skipped.
2.
Enter the NVMPROG KEY by using the KEY instruction. See
signature.
3.
Optional: Read the NVMPROG field in the KEY_STATUS register to see that the KEY has been
activated.
4.
Write the Reset signature into the ASI_RESET_REQ register. This will issue a System Reset.
5.
Write 0x00 to the Reset signature in the ASI_RESET_REQ register to clear the System Reset.
6.
Read NVMPROG in ASI_SYS_STATUS.
7.
NVM Programming can start when NVMPROG == 1 in the ASI_SYS_STATUS register. If
NVMPROG == 0, go to point 6 again.
8.
Write data to NVM through the UPDI.
9.
Write the Reset signature into the ASI_RESET_REQ register. This will issue a System Reset.
10. Write 0x00 to the Reset signature in ASI_RESET_REQ register to clear the System Reset.
11. Programming is complete.
29.3.7.3 User Row Programming
The User Row Programming feature allows the user to program new values to the User Row
(USERROW) on a locked device. To program with this functionality enabled, the following sequence
should be followed.
©
2018 Microchip Technology Inc.
Unified Program and Debug Interface (UPDI)
is below that threshold level, the device is unserviceable until V
DD
Datasheet Preliminary
megaAVR
Table 29-5
for the CHIPERASE
Chip
Erase. If the part is already unlocked, this
Table 29-5
for the NVMPROG
®
0-Series
is
DD
DS40002015A-page 458
Need help?
Do you have a question about the megaAVR 0 Series and is the answer not in the manual?