Table 4-15. Power Debugger TPI Pin Mapping
Power Debugger AVR PORT Pins
Target Pins
Mini-Squid Pin
TPI Pinout
Pin 1 (TCK)
CLOCK
1
3
Pin 2 (GND)
GND
2
6
Pin 3 (TDO)
DATA
3
1
Pin 4 (VTG)
VTG
4
2
Pin 5 (TMS)
5
Pin 6 (nSRST)
/RESET
6
5
Pin 7 (not connected)
7
Pin 8 (nTRST)
8
Pin 9 (TDI)
9
Pin 10 (GND)
0
4.4.11
Advanced Debugging (AVR JTAG/debugWIRE devices)
I/O Peripherals
Most I/O peripherals will continue to run even though the program execution is stopped by a breakpoint. Example: If a
breakpoint is reached during a UART transmission, the transmission will be completed and corresponding bits set.
The TXC (transmit complete) flag will be set and be available on the next single step of the code even though it
normally would happen later in an actual device.
All I/O modules will continue to run in Stopped mode with the following two exceptions:
• Timer/Counters (configurable using the software front-end)
• Watchdog Timer (always stopped to prevent Resets during debugging)
Single Stepping I/O Access
Since the I/O continues to run in Stopped mode, care should be taken to avoid certain timing issues. For example,
the code:
OUT
PORTB, 0xAA
IN
TEMP, PINB
When running this code normally, the TEMP register would not read back 0xAA because the data would not yet have
been latched physically to the pin by the time it is sampled by the IN operation. A
NOP
instruction must be placed
between the
OUT
and the
IN
instruction to ensure that the correct value is present in the PIN register.
However, when single-stepping this function through the OCD, this code will always give 0xAA in the PIN register
since the I/O is running at full speed even when the core is stopped during the single-stepping.
Single Stepping and Timing
Certain registers need to be read or written within a given number of cycles after enabling a control signal. Since the
I/O clock and peripherals continue to run at full speed in Stopped mode, single stepping through such code will not
meet the timing requirements. Between two single steps, the I/O clock may have run millions of cycles. To
successfully read or write registers with such timing requirements, the whole read or write sequence should be
performed as an atomic operation running the device at full speed. This can be done by using a macro or a function
call to execute the code, or use the run-to-cursor function in the debugging environment.
Power Debugger
On-chip Debugging
©
2020 Microchip Technology Inc.
User Guide
DS40002201A-page 70