Datasheet

Specific Debug Functions: 8- and 16-Bit Devices
2013 Microchip Technology Inc. DS52085A-page 61
EXAMPLE 6-4: dsPIC33F DEVICE RUNNING AT 16 MIPS WITH C PROJECT
EXAMPLE 6-5: dsPIC33F DEVICE RUNNING AT 34 MIPS WITH C PROJECT
6.3.9 More on Trace/Log ID Numbers
MPLAB IDE will automatically generate the ID numbers required for a trace or log
macro. However, to understand the method behind the numbering, read further.
You can have 64 trace points and 128 log points. These limits are determined by port
trace (8 bits). Bit 7 is used as a clock, thus leaving 7 bits for data (128). Bit 6 is a flag
which indicates a trace record instead of a log record.
For a trace record (bit 6 is 1), the low order bits represent the trace number (nnnnnn).
You could say 0-63 are the legal trace numbers and require the trace flag be set, but it
was just easier to combine the flag with the number and say the valid numbers are
64-127.
For a log record (bit 6 is 0), the low order bits identify the data type (t) and the log
number is sent in the next byte (nnnnnnn), thus freeing up a full 128 values.
6.3.10 Quick Trace Reference
If you are new to using the MPLAB REAL ICE in-circuit emulator trace feature, it is
recommended that you read through the entire trace section for a full understanding.
Use this section as a quick reference for trace.
1. Select File>Project Properties dialog, Categories: REAL ICE, Options catego-
ries: Trace. Enable trace, choose the type of trace and set other trace options.
2. Select Window>Debugging>Trace to open the trace window in which to view
trace data.
3. Right click in your code to enter trace macros (__TRACE, __LOG) as desired.
4. Debug Run your project.
Native SPI I/O Port
__TRACE(id) instruction cycles 88 53 32
__LOG(id, INT) instruction cycles 227 138 106
Native SPI I/O Port
__TRACE(id) instruction cycles 100 53 32
__LOG(id, INT) instruction cycles 251 152 106
clock 1
bit 7 bit 0
n nnn nn
clock 0
bit 7 bit 0
t ttt tt
clock n
bit 7 bit 0
n nnn nn