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.
IDR/OCDR Events
The IDR (In-out Data Register) is also known as the OCDR (On-Chip Debug Register), and is used extensively by the
debugger to read and write information to the MCU when in Stopped mode during a debug session. When the
application program in Run mode writes a byte of data to the OCDR register of the AVR device being debugged, the
Power Debugger reads this value out and displays it in the message window of the software front-end. The OCDR
register is polled every 50ms, so writing to it at a higher frequency will NOT yield reliable results. When the AVR
device loses power while it is being debugged, spurious OCDR events may be reported. This happens because the
Power Debugger may still poll the device as the target voltage drops below the AVR’s minimum operating voltage.
4.4.13
AVR XMEGA Special Considerations
OCD and Clocking
When the MCU enters Stopped mode, the OCD clock is used as MCU clock. The OCD clock is either the JTAG TCK
if the JTAG interface is being used, or the PDI_CLK if the PDI interface is being used.
I/O Modules in Stopped Mode
In contrast to earlier Microchip megaAVR devices, in XMEGA the I/O modules are stopped in Stop mode. This means
that USART transmissions will be interrupted, timers (and PWM) will be stopped.
Hardware Breakpoints
There are four hardware breakpoint comparators - two address comparators and two value comparators. They have
certain restrictions:
• All breakpoints must be of the same type (program or data)
• All data breakpoints must be in the same memory area (I/O, SRAM, or XRAM)
• There can only be one breakpoint if address range is used
Here are the different combinations that can be set:
• Two single data or program address breakpoints
• One data or program address range breakpoint
• Two single data address breakpoints with single value compare
• One data breakpoint with address range, value range, or both
MPLAB X IDE and Atmel Studio will tell you if the breakpoint cannot be set, and why. Data breakpoints have priority
over program breakpoints, if software breakpoints are available.
External Reset and PDI Physical
The PDI physical interface uses the Reset line as clock. While debugging, the Reset pull-up should be 10k or more or
be removed. Any Reset capacitors should be removed. Other external Reset sources should be disconnected.
JTAGEN Fuse
The JTAG interface is enabled using the JTAGEN fuse, which is programmed by default. This allows access to the
JTAG programming interface.
Power Debugger
On-chip Debugging
©
2020 Microchip Technology Inc.
User Guide
DS40002201A-page 72