User manual

Debug for 8- and 16-Bit Devices
© 2008 Microchip Technology Inc. DS51616B-page 69
FIGURE 7-2: BUILD OPTIONS TRACE TAB – NATIVE TRACE SELECTION
The trace and log information transmitted is identical regardless of the trace method
used. For TRACE(), a single value in the range of 64-127 is sent. A label generated
using this number is automatically inserted into the code so MPLAB IDE can identify in
the trace buffer the location which sent the value. For LOG(), a two-byte header is sent
followed by the value of the variable being logged. The first byte indicates the variable
type and is a value between 0 and 63. The second byte indicates the location which
sent the variable. Here, the location is represented by a value between 0 and 127. (See
Section 7.3.10 “More on Trace/Log ID Numbers”.)
Interrupts are disabled during every TRACE() and LOG() call. This is to ensure that
trace or log statements at an interrupt level do not interfere with a trace or log statement
that may already be in progress at the application level. A similar argument holds for
protecting statements within a low priority interrupt from being corrupted by ones from
a high priority interrupt.
7.3.3 Types of Trace
Currently there are three types of trace. All types are language tool version dependent
and stream data real-time to MPLAB IDE.
The pluses and minuses of using each trace type, as well as the type of communication
available (standard and/or high-speed), are summarized below.
Type of Trace
Trace Usage Communication
Advantage Disadvantage Std HS
Native Trace No dedicated pins
needed.
Device must have built-in
debug circuitry.
15 MIPS
or less
Greater than
15 MIPS
I/O Port Trace Fastest trace
method.
An 8-bit port must be
dedicated to trace.
Yes
(1)
Yes
(1)
SPI Trace Faster than Native
Trace.
SPI pins must be dedicated
to trace.
No Yes
Note 1: Also requires connection from device port to emulator logic probe port.