User manual

MPLAB
®
REAL ICE
In-Circuit Emulator User’s Guide
DS51616B-page 72 © 2008 Microchip Technology Inc.
If(var > 5)
{
__LOG(ID, var)
}
Leave __TRACE and __LOG macros in your code for future debugging, if this is
allowable. (For Project>Build Options>Project
, Trace tab, select “Disable Trace
Macros“.)
7.3.8 Disabling Trace
To temporarily turn off trace data collection:
1. Select Project>Build Options>Project
, Trace tab. Check “Disable Trace Macros”.
Click OK.
2. Rebuild the project (Project>Build All
).
3. Reprogram the device (Debugger>Program
).
To disable the full trace capability:
1. Remove all trace and log macros from code.
2. Select Project>Build Options>Project
, Trace tab. Uncheck “Enable Trace”. Click
OK.
3. Rebuild the project (Project>Build All
).
4. Reprogram the device (Debugger>Program
).
7.3.9 Resource Usage Examples
The following examples are for illustration only. Your results may vary based upon
compiler/assembler version, command line options, MPLAB IDE version, size of data
variable being logged, interrupt state, and device in use. All examples include argu-
ment setup, function call, and return time in their cycle counts.
The PIC18FXXJ MCU examples are compiled/assembled for non-priority interrupt
usage (30 instructions.) For priority interrupt usage, the value is 57, and for no interrupt
usage, the value is 15.
The dsPIC33F DSC examples show 9 instructions specified in the 16-bit library size for
memcpy().
EXAMPLE 7-1: PIC18FXXJ DEVICE RUNNING AT 4MHZ (1 MIPS) WITH
ASSEMBLY PROJECT
EXAMPLE 7-2: PIC18FXXJ DEVICE RUNNING AT 40MHZ (10 MIPS) WITH C
PROJECT
Native SPI I/O Port
Library Size (in instructions) 23 + 30 37 + 30 25 + 30
GPRs Used (in bytes) 8 6 6
__TRACE(id) instruction cycles 80 54 42
__LOG(id, BYTE) instruction cycles 168 90 57
Native SPI I/O Port
Library Size (in instructions) 75 + 30 87 + 30 112 + 30
GPRs Used (in bytes) 10 8 8
__TRACE(id) instruction cycles 79 71 55
__LOG(id, INT) instruction cycles 225 169 162