If the debugWIRE interface on the target device is enabled, it will need to be disabled.
Tip:
If you are able to read the device signature using ISP after a power toggle, then debugWIRE is
successfully disabled and DWEN is cleared.
3.1.4
Disabling the debugWIRE Interface
Disabling debugWIRE can be done either by:
• Selecting “Disable DebugWIRE and close” from the Debug menu during a debug session, or
• Using Atmel Studio command line programming utility: atprogram.exe
atprogram.exe -t powerdebugger -i debugwire -d atmega328pb dwdisable
and then using ISP to clear DWEN, either in the Atmel Studio programming dialog, or using atprogram.exe:
• Read the high fuse (offset 1)
atprogram.exe -t powerdebugger -i isp -d atmega328pb read -fs -s 1 -o 1 --format hex
• OR the output value with 0x40 (DWEN is bit 6)
• Write the value back to the high fuse (offset 1)
atprogram.exe -t powerdebugger -i isp -d atmega328pb write -fs -o 1 --values
<new_fuse_value>
Power Debugger
Detailed Use Cases
©
2020 Microchip Technology Inc.
User Guide
DS40002201A-page 12