User manual

MPLAB
®
REAL ICE
In-Circuit Emulator User’s Guide
DS51616B-page 70 © 2008 Microchip Technology Inc.
7.3.3.1 NATIVE TRACE
Native trace can be used with either standard or high-speed communications, with no
additional connections - the information is conveyed via the PGD/PGC/EMUC/EMUD
pins. This two-wire interface uses the trace macro format (see Section 7.3.5 “Setting
Up Trace in MPLAB IDE”).
If Native trace is used, then real-time data capture triggers cannot be used because of
hardware constraints. However, breakpoints are still available. To use data capture
triggers, you must disable Native trace (see Section 7.3.8 “Disabling Trace”).
7.3.3.2 I/O PORT TRACE
I/O Port trace can be used with either standard or high-speed communications. Trace
clock and data are provided from a device 8-pin I/O port through the MPLAB REAL ICE
in-circuit emulator logic probe connector.
The I/O port must have all 8 pins available for trace. The port must not be multiplexed
with the currently-used PGC and PGM pins. Therefore, review the data sheet of the
selected device to determine the uninitialized/default port pin states and change them
as necessary.
For hardware connections, see Section 2.5.3 “I/O Port Trace Connections”.
The port interface uses the trace macro format (see Section 7.3.5 “Setting Up Trace
in MPLAB IDE”).
7.3.3.3 SPI TRACE
SPI trace can be used only with high-speed communications. Trace clock and data are
provided through pins 7 (DAT) and 8 (CLK) of the high-speed connection.
For hardware connections, see Section 2.5.2 “SPI Trace Connections (High-Speed
Communication Only)”.
The SPI interface uses the trace macro format (see Section 7.3.5 “Setting Up Trace
in MPLAB IDE”).
7.3.4 Setting Up the Project for Trace
Refer to Chapter 5. “General Setup for a discussion of how to set up MPLAB IDE
and an MPLAB IDE project to use the MPLAB REAL ICE in-circuit emulator.
To enable trace:
•Select Project>Build Options>Project
, Trace tab. (See Section 11.3.12 “Build
Options Dialog, Trace Tab (Device Dependent)”.)
If it is not already selected, click to check “Enable Trace”. For full trace capability,
“Disable Trace Macros” should be unchecked.
Select the type of trace you want (Section 7.3.3 “Types of Trace”).
•Click OK.
7.3.5 Setting Up Trace in MPLAB IDE
To set up MPLAB IDE to use trace for the MPLAB REAL ICE in-circuit emulator, first
set up options on the Settings dialog (Debugger>Settings
.)
Click the Clock tab. For data capture and trace, the emulator needs to know the
instruction cycle speed. (See Section 11.5.6 “Settings Dialog, Clock Tab” for
more information.)
Click the Trace tab. The trace buffer can be set to a maximum value specified on
the tab. The trace buffer is circular, so data will wrap if the maximum is exceeded.
Next, enter trace macros in your application code.