Important:
If the JTAGEN fuse is unintentionally disabled, it can only be re-enabled using the PDI
physical interface.
If the JTAGEN fuse is programmed, the JTAG interface can still be disabled in firmware by setting the JTAG disable
bit in the MCU Control Register. This will render code un-debuggable, and should not be done when attempting a
debug session. If such code is already executing on the Microchip AVR device when starting a debug session, the
Power Debugger will assert the RESET line while connecting. If this line is wired correctly, it will force the target AVR
device into Reset, thereby allowing a JTAG connection.
If the JTAG interface is enabled, the JTAG pins cannot be used for alternative pin functions. They will remain
dedicated JTAG pins until either the JTAG interface is disabled by setting the JTAG disable bit from the program
code, or by clearing the JTAGEN fuse through a programming interface.
Tip:
Be sure to check the “use external reset” checkbox in both the programming dialog and debug options
dialog in Atmel Studio in order to allow the Power Debugger to assert the RESET line and re-enable the
JTAG interface on devices which are running code which disables the JTAG interface by setting the JTAG
disable bit.
Debugging with Sleep for ATxmegaA1 rev H and Earlier
A bug existed on early versions of ATxmegaA1 devices that prevented the OCD from being enabled while the device
was in certain sleep modes. There are two work-arounds to re-enable OCD:
• Go into the Power Debugger. Options in the Tools menu and enable “Always activate external Reset when
reprogramming device”.
• Perform a chip erase
The sleep modes that trigger this bug are:
• Power-Down
• Power-Save
• Standby
• Extended Standby
4.4.14
debugWIRE Special Considerations
The debugWIRE communication pin (dW) is physically located on the same pin as the external Reset (RESET). An
external Reset source is therefore not supported when the debugWIRE interface is enabled.
The debugWIRE Enable fuse (DWEN) must be set on the target device in order for the debugWIRE interface to
function. This fuse is by default unprogrammed when the Microchip AVR device is shipped from the factory. The
debugWIRE interface itself cannot be used to set this fuse. In order to set the DWEN fuse, the SPI mode must be
used. The software front-end handles this automatically provided that the necessary SPI pins are connected. It can
also be set manually using SPI programming in the software front-end.
Either:
Attempt to start a debug session on the debugWIRE part. If the debugWIRE interface is not enabled, the
software front-end will offer to retry, or attempt to enable debugWIRE using SPI programming. If you have
the full SPI header connected, debugWIRE will be enabled, and you will be asked to toggle power on the
target. This is required for the fuse changes to be effective.
Or:
Open the programming dialog in Atmel Studio in SPI mode, and verify that the signature matches the
correct device. Check the DWEN fuse to enable debugWIRE.
Power Debugger
On-chip Debugging
©
2020 Microchip Technology Inc.
User Guide
DS40002201A-page 73