Important: When manipulating DWEN manually, it is important that the SPIEN fuse remains
set to avoid having to use High-Voltage programming.
Figure 4-14. Understanding debugWIRE and the DWEN Fuse
Atmel Studio
start debug session
Power toggle
(latches debugWIRE state)
Studio "Disable debugWIRE and close"
(disables debugWIRE module temporarily
and then clears DWEN fuse using SPI)
atprogram dwdisable
(atprogram disables
debugWIRE module temporarily)
Clear DWEN fuse
using SPI
Set DWEN fuse
using SPI
Intermediate state 1:
Fuse DWEN set
Fuse SPIEN set* (NB!)
Module debugWIRE disabled until power toggle
You can: Toggle power
DWEN
SPIEN
Default state:
Fuse DWEN cleared
Fuse SPIEN set
Module debugWIRE disabled
You can: Access flash and fuses using SPI
DWEN
SPIEN
Debug state:
Fuse DWEN set
Fuse SPIEN set
Module debugWIRE enabled
You can: use debugWIRE
You cannot: Access fuses or flash using SPI
DWEN
SPIEN
Intermediate state 2:
Fuse DWEN set
Fuse SPIEN set
Module debugWIRE disabled
You can: Access fuses and flash using SPI
DWEN
SPIEN
Debug state (not recommended):
Fuse DWEN set
Fuse SPIEN cleared
Module debugWIRE enabled
You can: use debugWIRE
To access flash and fuses it is now necessary to
use the High-Voltage Programming interface
DWEN
SPIEN
4.4.17. TinyX-OCD (UPDI) Special Considerations
The UPDI data pin (UPDI_DATA) can be a dedicated pin or a shared pin, depending on the target AVR
device. A shared UPDI pin is 12V tolerant, and can be configured to be used as /RESET or GPIO. For
further details on how to use the pin in these configurations, see UPDI Physical Interface.
On devices which include the CRCSCAN module (Cyclic Redundancy Check Memory Scan) this module
should not be used in continuous background mode while debugging. The OCD module has limited
hardware breakpoint comparator resources, so BREAK instructions may be inserted into flash (software
breakpoints) when more breakpoints are required, or even during source-level code stepping. The CRC
module could incorrectly detect this breakpoint as a corruption of flash memory contents.
The CRCSCAN module can also be configured to perform a CRC scan before boot. In the case of a CRC
mismatch, the device will not boot, and appear to be in a locked state. The only way to recover the device
from this state is to perform a full chip erase and either program a valid flash image or disable the pre-
boot CRCSCAN. (A simple chip erase will result in a blank flash with invalid CRC, and the part will thus
still not boot.) Atmel Studio will automatically disable the CRCSCAN fuses when chip erasing a device in
this state.
Atmel Atmel-ICE [USER GUIDE]
Atmel-42330C-Atmel-ICE_User Guide-10/2016
48