User manual
MPLAB
®
REAL ICE
™
In-Circuit Emulator User’s Guide
DS51616B-page 68 © 2008 Microchip Technology Inc.
• Resource Usage Examples
• More on Trace/Log ID Numbers
• Quick Trace Reference
7.3.1 Requirements for Trace
The following is required to use trace:
• For 16-bit devices (dsPIC30F/33F, PIC24F/H): MPLAB IDE v7.43 and above,
MPLAB C30 v2.04 and above. For these devices, only C code can be traced, not
assembly.
• For 8-bit devices (PIC18): MPLAB IDE v7.52 and above, MPASM toolsuite v5.10
and above, MPLAB C18 v3.10 and above.
• In-line assembly code (assembly code within C code) cannot be traced.
7.3.2 How Trace Works
Trace for the MPLAB REAL ICE in-circuit emulator (Instrumented Trace) is a solution
for providing basic trace information. Through the use of TRACE() and LOG() macros,
you can report program locations or variable values to MPLAB IDE while the applica-
tion is running. You may type these macro names in manually or right click in the editor
and select the macro to be inserted from the context menu. To log a variable value, the
variable should be highlighted before selecting from the context menu.
FIGURE 7-1: EXAMPLE OF INSERTED LOG MACRO
There are three trace methods available at this time (see Section 7.3.3 “Types of
Trace”.) The mediums can be found on the Project>Build Options>Project
, Trace tab.
The choices include Native Trace (utilizes PGC/PGD communication lines), SPI Trace,
and I/O Port Trace. Not every method is available on every part, i.e., the options are
device specific. The Instrumented Trace library supports C and assembly projects on
PIC18F MCU devices, and C projects only on 16-bit devices.