Datasheet

Emulator User’s Guide for MPLAB X IDE
DS52085A-page 86 2013 Microchip Technology Inc.
Q: For SPI trace, which two pins are used?
A: The pins are:
SDO (Serial Data Output) DAT (pin 7)
SCK (Serial Clock Output) CLK (pin 8)
Q: What are the correct port settings to use SPI trace, i.e., mode, sync/async, etc.?
A: The setup is taken care of by MPLAB IDE, so you will not need to be con-
cerned about the code required for setting this. Trace will support 64 trace points
and 128 log points.
SPI – Comm Protocol MODE1, clock high, sampled falling edge.
Q: What is the correct connection for using I/O Port (parallel port) trace?
A: The connection varies depending on the PORT used. There are port assign-
ments in MPLAB IDE that are displayed when the PORT is selected in the prop-
erty sheet. See Section 3.6.3 “I/O Port Trace Connections” for more
information.
Q: Can we use any port?
A: The port must be available on the device and not multiplexed with the currently
used PGC and PGM pins.
Q: Of the 7 data and one clock, which one is the clock?
A: There are 7 bits of data to set up to 128 trace points. The clock is the MSB of
the port.
Q: Are these I/O ports used for trace available as general I/O during debugging?
A: For dsPIC30F/33F and PIC24F/H devices, you may write to the opposing 8-bit
part of the port provided byte write operations are used. The following example
will write to the high side of the port only.
#define high(num) (((BYTE *)&num)[1])
#define low(num) (((BYTE *)&num)[0])
high(PORTA) = 0x12;
For PIC18 devices, once the ports are defined to be used for trace, you should
not access them in your code.