Datasheet
Emulator User’s Guide for MPLAB X IDE
DS52085A-page 70 2013 Microchip Technology Inc.
7.3 PIC32 INSTRUCTION TRACE
This section will discuss trace for 32-bit devices and how to use it. Not all PIC32
devices have instruction trace so refer to your device data sheet.
• Requirements for Trace
• How Instruction Trace Works
• Setting Up and Using Trace
• Trace Hardware Specifications
7.3.1 Requirements for Trace
The following is required to use trace for 32-bit (PIC32) devices:
• MPLAB X IDE and a compatible 32-bit toolchain
• PIC32MX Plug-In Module (PIM) containing a device that supports trace and a
trace port
• MPLAB REAL ICE Trace Interface Kit containing a 12-inch trace cable and a trace
adapter board
7.3.2 How Instruction Trace Works
PIC32 instruction trace uses a MIPS32 M4K iFlowtrace™ mechanism, which is a
non-intrusive hardware instruction trace You can use this trace to capture every
instruction executed by the device. The trace data is sent from the device using the pins
TRCLK and TRD3:0 to the emulator. The emulator streams this data to a trace buffer
on the PC that acts like a rolling FIFO.
The amount of trace data is limited only by the size of the trace buffer. This buffer can
fill quickly even when set to the maximum size, so it is wise to determine exactly what
you need to capture.
Enable and set trace options in the Project Properties dialog, Categories: REAL ICE,
Option categories: Trace and Profiling. Here you may set:
• Data selection - enable/disable trace and select the type of trace.
• Data file path and name - location of trace file
• Data file maximum size - size of trace file
• Data Buffer maximum size - size of the trace buffer
The maximum off-chip (PC) trace buffer size is 22MB. Execution will not halt when this
external buffer is full.
See also Section 11.3.1 “Trace and Profiling”.