User manual
MPLAB
®
REAL ICE
™
In-Circuit Emulator User’s Guide
DS51616B-page 76 © 2008 Microchip Technology Inc.
8.3.2 Setting Up and Using Trace
If a PIC32MX MCU device has trace capability, it will be PIC32 Instruction Trace.
8.3.2.1 HARDWARE SETUP
To use the PIC32 Instruction Trace feature do the following:
• Plug the PIM into an unpowered target board.
• Install communication cable(s) between the emulator and your target board. See
Section 2.4 “Target Communication Connections”.
• Connect the trace cable from the trace port on the PIM to the trace adapter board.
Orient the cable as show in Figure 8-1.
• Plug the trace adapter board into the MPLAB REAL ICE in-circuit emulator logic
probe port. The top of the adapter board contains the connectors and should be
oriented upwards when plugging the board into the logic probe port (Figure 8-1).
• Power the target.
FIGURE 8-1: TRACE CONNECTION
8.3.2.2 MPLAB IDE SETUP
Once the hardware is connected, you enable trace in MPLAB IDE through the
Debug
ger>Settings, Trace tab. Simply check/uncheck the “Enable Trace” checkbox to
turn trace on/off (Figure 8-2). If no other options are selected, trace will continue to fill
the trace buffer with data, rolling over when the buffer is full, until a program Halt.
To “stall” the target CPU when the trace buffer is full, check that option on the Trace
tab. You can set the size of the trace buffer in the “Trace Buffer Size” section of the
dialog. A maximum size is specified in the section text.
To start and/or stop trace on triggers/breaks, set and enable breakpoints in your code
and then select them on this tab to start and/or stop trace.
Note: When using trace, pins TRCLK and TRD3:0 are used. Therefore, you
cannot use the other functions multiplexed on these pins, namely RG14:12
and RA7:6.
PIC
32
Trace Cable
Trace Port
PIM
Trace
Adapter
Communication Cable(s)
ACTIVE
STATUS
RESETFUNCTION
Emulator Pod