Datasheet

Table Of Contents
PICkit™ Serial Analyzer User’s Guide
DS51647C-page 62 © 2009 Microchip Technology Inc.
7.7.5 Creating A Script
Scripts are created by placing the cursor into the Script Detail column and right clicking.
A local menu will be displayed as shown in Figure 7-13. Select from the choice of
commands or script macro commands.
The sequence of macro commands are executed from top to bottom. Macro commands
are entered by right clicking in the box and selecting from the local menu as shown in
Figure 7-13.
Macro commands are entered according to the sequence of events as defined by the
SPI bus protocol. Studying the example scripts is a good way to learn the sequence of
events. The example scripts can also be modified and saved under a different name.
A complete listing of the available macro commands is given in Table 7-2. The macro
command abbreviation will be displayed in the Transactions window. The Transactions
window keeps a running log of the commands and data sent to and from the target
device.
FIGURE 7-13: SPI SCRIPT BUILDER – CREATING A SCRIPT
CAUTION
The choice of macro commands is very flexible. Therefore, the correctness of the
script has to be verified by the user. The PICkit Serial Analyzer program does not
verify the correctness of the script.
TABLE 7-2: SPI SCRIPT MACRO COMMAND
Macro Command
Command
Abbreviation
Description
SPIBITRATE [BR] Set Bit Rate. Next byte is the scaler, followed by
the pre-scaler.
SPIDATIN [DI] Input data. Next byte is the byte count.
SPIDATOUT [DO] Output data. Next byte is the byte count, followed
by the data.
SPIDATIO [DIO] Simultaneous data in and out. Next byte is byte
count, followed by the data.
SPISDOIN [SI] Set SDO pin to Input (tri-state)
SPISDOOUT [SO] Set SDO pin to Output
SPIINIT [I_] Initialize SPI controller
SPICSON [CSON] Assert CS (active-low)
SPICSOFF [CSOF] De-assert CS (active-low)