User manual
Frequently Asked Questions (FAQ)
© 2008 Microchip Technology Inc. DS51616B-page 85
9.3 HOW DOES TRACE WORK – 8 AND 16 BIT DEVICES
• What's in the silicon that allows it to trace with the MPLAB REAL ICE in-circuit
emulator?
Tracing over the two-wire (ICSP) interface is supported with silicon that contains
the Version 2 PIC18F and dsPIC33F/PIC24X in-circuit debugger modules.
• When using trace, is this connection electrically isolated in any way, i.e., do the
triggers have any isolation?
They are buffered and DC adjusted to whatever V
DD level you are running. The
buffers tristate when off. This minimal isolation makes the system fast and opens
the door to adapt to new and faster technologies. However, you may implement
more RS-232 isolation (4-6 lines) if desired, but this may impact your speed.
• Can we do trace by using the 5 or 6 ICSP pins only?
Tracing is possible using the standard ICSP interface.
• When would SPI trace be used? What extra advantage does this have?
The SPI trace is intended to be used for devices that do not have the advanced
debug engine for tracing. These typically would be some PIC18F and all PIC16F
MCU devices.
• In order to use the SPI trace, what is the hardware connection?
For serial SPI port trace, the device SPI SDO (serial data output) and SCK (serial
clock) are required. These pins must be connected, respectively, to the DAT and
CLK pin interface on the Performance Pak receiver board. See
Section 2.5.2 “SPI Trace Connections (High-Speed Communication Only)”
for more information.
• For SPI trace, which two pins are used?
SDO (Serial Data Output) → DAT (pin 7)
SCK (Serial Clock Output) → CLK (pin 8)
• What are the correct port settings to use SPI trace, i.e., mode, sync/async, etc.?
The setup is taken care of by MPLAB IDE, so you will not need to be concerned
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.
• What is the correct connection for using I/O Port (parallel port) trace?
The connection varies depending on the PORT used. There are port assignments
in MPLAB IDE that are displayed when the PORT is selected in the property
sheet. See Section 2.5.3 “I/O Port Trace Connections” for more information.
• Can we use any port?
The port must be available on the device and not multiplexed with the currently
used PGC and PGM pins.
• Of the 7 data and one clock, which one is the clock?
There are 7 bits of data to set up to 128 trace points. The clock is the MSB of the
port.
• Are these I/O ports used for trace available as general I/O during debugging?
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 only write to the high side of the port.
#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.