17.01.2015 Views

QDK PIC24/dsPIC-XC16 - Quantum Leaps

QDK PIC24/dsPIC-XC16 - Quantum Leaps

QDK PIC24/dsPIC-XC16 - Quantum Leaps

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>QDK</strong><br />

<strong>PIC24</strong>/<strong>dsPIC</strong>-<strong>XC16</strong><br />

www.state-machine.com/pic<br />

2.2.3 Collecting the QS software trace<br />

QS (QP-Spy) is a software tracing facility built into all QP components and also available to the<br />

Application code. QS allows you to gain unprecedented visibility into your application by selectively<br />

logging almost all interesting events occurring within state machines, the framework, the kernel, and your<br />

application code. QS software tracing is minimally intrusive, offers precise time-stamping, sophisticated<br />

runtime filtering of events, and good data compression (see Chapter 11 in [PSiCC2]).<br />

The Spy configuration enables the QS software tracing and links with the Spy-versions of the QP libraries<br />

(see Listing 1). In the MPLABX IDE you select the Spy configuration by means of the combo box located<br />

near the “hammer” button (see Figure 5).<br />

For the QS (Q-SPY) software tracing output, you need to connect a TTL to RS-232 transceiver to the<br />

Microstick II board, as shown in Figure 6. The figure shows the RS232 to TTL converter board 3.3V to 5V<br />

from NKC Electronics (http://www.nkcelectronics.com/rs232-to-ttl-converter-board-33v232335.html), but<br />

you can use any other equivalent board.<br />

NOTE: To connect the transceiver, you might need to solder the pins into the connectors of the<br />

Microstick II board, as shown in Figure 6.<br />

Figure 6: Connecting RS232-TTL board to the Microstick II board.<br />

J6<br />

J6[5]<br />

GND<br />

VDD<br />

Q-SPY trace<br />

data to host<br />

TTL-RS-232<br />

transceiver<br />

board<br />

You launch the QSPY utility on a Windows PC as follows. Change the directory to the QSPY host utility<br />

\tools\qspy\win32\mingw\rel and execute:<br />

qspy –cCOM1 –b38400 –O2 –F2 –S2 –E1 –Q1 –P1 –B1<br />

The meaning of the parameters is as follows:<br />

-cCOM1 specifies COM port (change to actual COM port number you’re using)<br />

Copyright © <strong>Quantum</strong> <strong>Leaps</strong>, LLC. All Rights Reserved.<br />

10 of 35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!