QDK PIC24/dsPIC-C30 - Quantum Leaps
QDK PIC24/dsPIC-C30 - Quantum Leaps
QDK PIC24/dsPIC-C30 - Quantum Leaps
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>C30</strong><br />
www.state-machine.com/pic<br />
MPLAB IDE, you need to de-select the ICD 2 as the Debugger and select ICD 2 as the Programmer (you<br />
cannot configure ICD 2 as a programmer and debugger simultaneously). To program the code into the<br />
<strong>PIC24</strong>/<strong>dsPIC</strong> device, you click the “Program Target Device” icon. After the programming is done, you can<br />
release the device out of reset by clicking the appropriate icon. You can also disconnect the ICD 2<br />
completely and power-cycle the board. The programmed DPP application should start running<br />
standalone.<br />
2.3.4 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 dpp-spy.mcp project contains the Spy configuration that enables the QS software tracing and links<br />
with the Spy-versions of the QP libraries (see Listing 1). You select the Spy configuration by activating the<br />
dpp-spy.mcp project in the MPLAB IDE (see Figure 4).<br />
Before you download and start the DPP-Spy configuration to the Explorer 16 board, you should connect<br />
the board’s build-in DB9 connector to your workstation via a straight serial cable. Figure 5 shows the<br />
QSPY output received from the DPP-Spy configuration.<br />
NOTE: Please note that only a small subset of the QSPY records are allowed through the QS filters.<br />
Please refer to the source code (bsp.c) and the “QSPY Reference Manual” [QSPY 08] for more<br />
information about using the QS filters.<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 />
-b38400 specifies the baud rate (depends on the oscillator frequency of your board, see Section 7)<br />
-O2 specifies the size of an object pointer to 2 bytes<br />
-F2 specifies the size of a function pointer to 2 bytes.<br />
-E1 specifies the size of an event to 1 byte (an event may have up to 255 bytes).<br />
-Q1 specifies the size of a memory queue counter to 1 byte (a event queue can fit up to 255 events).<br />
-P1 specifies the size of a memory pool counter to 1 byte (a memory pool can manage up to 255 memory<br />
blocks).<br />
-B1 specifies the size of a memory block to 1 byte (a memory pool can manage block up to 255 bytes).<br />
Copyright © <strong>Quantum</strong> <strong>Leaps</strong>, LLC. All Rights Reserved.<br />
10 of 35