Home
PICkit Serial Analyzer USER`S GUIDE
Contents
1. Un DS51647B page 4 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 1 PICkit Serial Analyzer Overview 1 1 INTRODUCTION The PICkit Serial Analyzer development system enables a personal computer PC to communicate with embedded development systems via serial protocols such as 2 SPI asynchronous and synchronous USART The PC program uses a graphical interface to enter data and commands to communicate to the target device Data and commands can be entered using basic or scripting commands The PICkit Serial Analyzer connects to the embedded development system using a 6 pin header The PICkit Serial Analyzer is a sophisticated and highly configurable device Please take a few moments to familiarize yourself with the hardware interface and PC program by reading this user s guide Chapter 2 Getting Started will guide you through installing the PC program and running a simple demonstration program on the 28 Pin Demo Board DM164120 3 using the 2 serial protocol 1 2 HIGHLIGHTS This chapter discusses e PICkit Serial Analyzer Contents PICkit Serial Analyzer Development System e PICkit Serial Analyzer Hardware PICkit
2. 20 MHz 0x00 8 0x00 1 8 2 500 MHz 20 MHz 0x00 8 OxFF 256 2048 9 766 kHz 20 MHz 0x01 32 0x00 1 32 0 625 MHz 20 MHz 0x01 32 OxFF 256 8192 2 441 kHz 20 MHz 0x02 128 0x00 1 128 0 156 MHz 20 MHz 0x02 128 OxFF 256 32768 0 610 kHz TABLE 11 34 SPI STATUS BLOCK Byte Bit Description COMM SPI 12 7 0 Bit flags error status 0 WCOL error 1 SSPOV error 2 3 4 5 6 7 Composite error 13 7 0 SPI Configuration bits 0 1 SMP sample phase 1 1 CKE clock edge select 2 1 CKP clock polarity 3 1 AOD auto output disable on data input 4 1 SS 5 6 1 SLAVE 7 1 MASTER 14 7 0 15 7 0 16 7 0 17 7 0 18 7 0 BIT RATE Pre scale ref section x x x 19 7 0 BIT RATE Scaling ref section x x x 2007 Microchip Technology Inc DS51647B page 113 PICkit Serial Analyzer User s Guide TABLE 11 35 SPI CMD TAG BYTES TAG CCMD LEN Name Description 0x83 3 SPI BITRATE Set bit rate 0 1 scaler 2 pre scaler ref section x x x 0x84 2 SPI DATAIO IN Input data 0 1 byte count N 0x85 N 2 SPI DATAIO OUT Output data 0 1 byte count 2 data 1 data 0x86 2 SPI DATAIO INOUT Output data 0 1 byte count N 2 data N 1 data 0x87 1 SPI SDO IN Set SDO pin to INPUT tri state 0 0x88 1 SPI SDO OUT
3. A a smmusm 8 ugY 2007 Microchip Technology Inc DS51647B page 15 PICkit Serial Analyzer User s Guide NOTES DS51647B page 16 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 3 PICkit Serial Analyzer PC Program 3 1 INTRODUCTION This chapter covers the installation starting and high level operations of the PICkit Serial Analyzer program Detailed information about the entering of data and com mands for specific serial communications modes are given in the following chapters 3 2 HIGHLIGHTS This chapter discusses Installing The PICkit Serial Analyzer Software Starting the Program Configuration Wizard Main Window Specific Communications Modes 3 3 INSTALLING THE PICkit SERIAL ANALYZER SOFTWARE Insert the PICKit Serial Analyzer CD ROM into the CD ROM drive In a few moments the introductory screen should be displayed Follow the directions on the screen to install the PICkit Serial Analyzer software If the introductory screen does not appear browse to the CD ROM directory and select the AutorunPro exe program Note The PICkit Serial Analyzer program requires the Microsoft NET Framework Version 2 0 3 4 STARTING THE PROGRAM Y
4. asi AS IXOELL DSOI L 028 O09d 18x 284 asin Ae SEN 9VA 0N 72 2950 H9d TIEN SEX DISA TINV hE DdA 2d22 6NY E8N DEVE e DWHA 21NI 8NYV 2B24 ZHWO2 4922 79S X9S T1NI 0INV T9 1 3 VOS IOS 0114 01NL 2INY 08H oeh 1ND29 NI0ATH SS ANY SVA ADY LNOTIZ POOL VA 5 24A ENY EVA JaAA3 JaJA 2NV 2V8 12 MOT Se 250 N3M0d 250 7 05 1 0552 181219 504 RE anvo Ta 19 957 A 851 AS BE AS DS51647B page 131 2007 Microchip Technology Inc PICkit Serial Analyzer User s Guide PICkit SERIAL ANALYZER SCHEMATIC SHEET 2 OF 2 FIGURE A 2 3 995 ON9 105 AIS 005 145 906 LNW 906 LAWN 906518 40 90 0 8hT hOSWW ea 491 PPA 05 105 195 195 906 LEWW 20 ANA AA DEE D I eta ela O0S X 0001S9HZ ta 2069 IW Tal so 83 191 PPA OAL eeu 204947181 MIN ER 2007 Microchip Technology Inc DS51647B page 132 Serial Analyzer Schematics FIGURE A 3 SILKSCREEN or T 7255 4 Tec SPI USART ry 1 cs TX S Jo 2 TGT TGT Vdd elo GND GND GND SDA SDI Do 5 SCL SCK 2 500 RX CE Hi 1 55 7 Uu BB s 309g no ss ana as m FIGURE A 4 TOP COPPER Tec SPI USART 1 cs TX 2
5. IE 4 BREAK 4 5 DS51647B page 124 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware LIN specifications limit the BAUD rate to 20k Reference the following table for examples BAUD FOSC 4 BRG_CODE 1 where FOSC 20 MHz TABLE 11 48 BAUD CODE ACTUAL ERROR 100 49999 100 0 0 00 200 24999 200 0 0 00 300 16666 300 0 0 00 400 12499 400 0 0 00 500 9999 500 0 0 00 600 8332 600 0 0 00 700 7142 700 0 0 00 800 6249 800 0 0 00 900 5555 899 9 0 01 1000 4999 1000 0 0 00 2000 2499 2000 0 0 00 3000 1666 2999 4 0 02 4000 1249 4000 0 0 00 5000 999 5000 0 0 00 6000 832 6002 4 0 04 7000 713 7002 8 0 04 8000 624 8000 0 0 00 9000 555 8992 8 0 08 10000 499 10000 0 0 00 11000 454 10989 0 0 10 12000 416 11990 4 0 08 13000 384 12987 0 0 10 14000 356 14005 6 0 04 15000 332 15015 0 0 10 16000 312 15974 4 0 16 17000 293 17006 8 0 04 18000 277 17985 6 0 08 19000 262 19011 4 0 06 20000 249 20000 0 0 00 I 2007 Microchip Technology Inc DS51647B page 125 PICkit Serial Analyzer User s Guide NOTES DS51647B page 126 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 12 PICkit Serial Analyzer DLL 12 1 INTRODUCTION Custom software
6. Vdd TGT Vdd_TGT GND GND GND 4 SDA SDI 5 SCL SCK 500 RX LE 6 13 4 109 0 t no OI ss ai exo m FIGURE 5 BOTTOM COPPER 45 deg 1 250 1 175 1 075 Tec SPI USART o 1 cs TX 2 Vdd_TGT Vdd TGT Vdd_TGT 0 625 3 GND DND DND OW 0 575 SDA SDI O 5 SCL SCK 0 375 6 500 RX 0 175 0 075 0 000 III II V uy Ge 5 eo d no ss ana exo wc 2007 Microchip Technology Inc DS51647B page 133 PICkit Serial Analyzer User s Guide NOTES DS51647B page 134 2007 Microchip Technology Inc PICkit SERIAL ANALYZER USER S MICROCHIP GUIDE Appendix B 28 Pin Demo Board IC Demonstration Firmware B 1 INTRODUCTION The 28 Pin Demo Board CT demonstration firmware communicates with the PICkit Serial Analyzer using the 2 serial protocol The PICkit Serial Analyzer will be the I C Master and the 28 Pin Demo Board will be the 12C Slave device The 28 Pin Demo board is programmed to emulate an 2 Real Time Clock RTC and Serial EEPROM B 2 HIGHLIGHTS This chapter discusses Hardware Firmware 12 Communications Slave Devices Functions HARDWARE The 28 Pin Demo Board DM164120 3 is populated with and configured for PIC16F886 configured using the 8 MHz internal clock 32 kHz Tuning Fork Cr
7. 1 5 0 0 Found Serial Analyzer FW Ver 0 0201 058 contro block updated with preference data Basic View Set Advanced View Set i Basic View Set Er i Advanced View Set i fete ni EEE 3 6 4 Transactions Window The Transactions window shown in Figure 3 12 keeps a running log of the commands and data that are communicated between the PICkit Serial Analyzer program and target device From the menu bar on the Transaction window the contents can be saved File gt Save to a txt or rtf file The file can later be retrieved File gt Open and displayed in the Transactions window 1 DS51647B page 24 2007 Microchip Technology Inc PICkit Serial Analyzer Program Additional Transactions windows can be displayed From the PICkit Serial Analyzer menu bar select Window gt New Transaction Window The active Transactions window will log the current commands and data FIGURE 3 12 TRANSACTIONS WINDOW FILE Open Opens a txt or rtf file and displays it in the Transactions window Save Saves the contents of the Transactions window to a txt or rtf file Close Closes the selected Transactions window EDIT Copy The selected contents of the Transactions window will be copied to the clipboard Paste The contents of the clipboard will be pasted into the Transactions window Select All
8. Serial 12C Master Mode Communications PO Serial Analyzer DemoBoards User Defined Templates View Window E Gb view Base 9 FlashLED Reset Basic Operations Transactions File Edt Clear Reset Time COMMUNICATIONS The Communications menu selections display operation windows to enter data and commands to communicate with the target device Basic Operations Displays the Basic Operations window for the communications mode selected see PICkit Serial Analyzer gt Select Communications Mode Script gt Script Builder Displays the Script Builder window Script Execute Displays the Script Execute window 12C Slave Profile Displays the 2 Slave Profile Generator Enabled only in 2 Slave mode 2007 Microchip Technology Inc DS51647B page 21 PICkit Serial Analyzer User s Guide PICkit SERIAL ANALYZER The PICkit Serial Analyzer menu selection commands the PICkit Serial Analyzer hardware Select Communications Mode gt 2 Master Puts the Serial Analyzer in 2 Master Communications mode SPI Master Puts the PICkit Serial Analyzer in SPI Master Communications mode USART Asynchronous Puts the PICkit Serial Analyzer in USART Asynchro nous Communications mode USART Synchronous Master Puts the PICkit Serial Analyzer in USART Synchronous Master Communications mode 12 Slave Puts the
9. Operations gt Execute X Clear DS51647B page 52 2007 Microchip Technology Inc SPI and Microwire Master Communications FIGURE 7 4 SPI BASIC OPERATIONS Basic Operations SPI Master Enable v 0 1 1 3 Group 0 Group 1 Group 2 Group 3 Group 4 x x x Operations gt Execute X Clear 7 6 1 Basic Communications Serial EEPROM Example Figures 7 5 through 7 7 demonstrates how to communicate with 25LC020A SPI serial EEPROM Refer to the 25LC020A Data Sheet DS21833 for a detailed explanation of its communications Before data can be written to the 25LC020A the write enable WREN latch must be set This requires that CS be enabled command 0x06 transmitted and CS disabled Figure 7 5 shows only Group 0 enabled All other groups are disabled Clicking on the Execute button will transmit only the WREN command The command will be logged in the Transactions window FIGURE 7 5 SEEPROM EXAMPLE WREN COMMAND Basic Operations SPI Master n x Enable v 0 1 D B 4 Group 0 Group 1 Group 2 Broup 3 Group 4 x 06 x x x x Operations
10. 1 DS51647B page 84 2007 Microchip Technology Inc User Defined Templates Graph allows the data to be graphed during run time The popup graph may be resized as needed Once the parameter s are entered they can be saved as a User Defined Parameter file udp File gt Open Open an existing User Defined Parameter file udp File gt Save Save or replace a User Defined Parameter file udp Clear All Resets clears all parameter boxes OPTIONS Run All Runs all parameter scripts above that are marked as active Iterations How many times you wish to run the set of active parameters Delay time in between each parameter Error Timeout time the GUI will wait for a completed response to the script If you are running long scripts you may wish to increase this value 10 4 MY TEMPLATES When the User Defined Parameter file has been saved it will be displayed under the User Defined Templates My Templates on the menu bar as shown in Figure 10 2 Note The User Defined Parameter file udp must be stored in the same direc tory as the Serial Analyzer executable by default C Program Files Microchip PICkit Serial Analyzer Otherwise it will not be displayed under the My Templates menu selection FIGURE 10 2 SELECTING MY TEMPLATES PICkit Serial 2 Slave Mode Communications Serial Analyzer Demo Boards User Defined Templates View
11. 2 Data N 1 Data 0x83 2 USART DATA SRCV Receive data USART SM only 1 Byte count 0 84 1 USART DATA ARCV ENABLE _ Enable receive data monitor USART A only 0 TAG 0x85 1 USART DATA DISABLE Disable receive data monitor USART A only 0 TAG 0x86 1 USART BREAK XMT send BREAK USART A only 0 TAG 0x87 2 USART BREAK DATA XMT send BREAK then DATA byte USART A only 0 TAG 1 DATA byte TYP 0x55 0x88 3 USART BAUD set BAUD rate 0 1 BAUD value LSB 2 BAUD value MSB Reference section x x x 0x89 1 USART SCKP SET set CLOCK POLARITY bit USART SM only 0 TAG Ox8A 1 USART_SCKP_RST reset CLOCK POLARITY bit USART SM only 0x90 1 USART_AUX1_RST AUX1 0 0 TAG 0x91 1 USART_AUX1_SET AUX1 1 0 0 92 1 USART_AUX1_OUT AUX1 direction OUTPUT 0 TAG 0x93 1 USART_AUX1_IN AUX1 direction INPUT 0 TAG 0x94 1 USART_AUX1_WAIT_0O wait AUX1 0 0 TAG 0x95 1 USART_AUX1_WAIT_1 wait AUX1 1 0 TAG 0x96 1 USART_AUX2_RST AUX2 0 0 TAG 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware TABLE 11 42 USART CMD TAG BYTES CONTINUED 0x97 1 USART_AUX2_SET AUX2 1 0 TAG 0x98 1 USART_AUX2_OUT AUX2 direction OUTPUT 0 0 99 1 USART_AUX2_IN AUX2 direction INPUT 0 TAG 0x9A 1 USART AUX2 WAIT 0 wait AUX2 0 0 TAG Ox9B 1 USART
12. TX V GND OR nm A RX TABLE 11 38 CONNECTOR PINOUT IN USART SYNCHRONOUS MODE Pin Description Clock 2007 Microchip Technology Inc DS51647B page 115 PICkit Serial Analyzer User s Guide TABLE 11 39 USART CONTROL BLOCK Byte Bit Description COMM USART 16 7 0 17 7 0 0 1 clock polarity 1 hi lo at start bit cell 0 lo hi USART SM only ignored otherwise 1 1 2 1 Async receive disable USART A only ignored otherwise 3 1 4 1 5 1 6 1 7 1 18 7 0 0 1 Event marker enable read byte 1 1 Event marker enable write byte 2 1 Event marker enable status error 3 1 Event marker enable break tx 4 1 5 1 6 1 7 1 19 7 0 20 7 0 21 7 0 bit flags 0 AUX1 default state 0 1 1 AUX2 default state 0 1 2 AUX1 direction 1 IN 0 3 AUX2 direction 1 IN 0 4 n a 5 n a 6 n a 7 n a 22 7 0 BRG BAUD default LSB 23 7 0 BRG BAUD default MSB TABLE 11 40 BRG BAUD RATE TABLE BAUD Fosc 4 BRG 1 BAUD BRG ACTUAL ERR 300 16666 300 0 0 00 1200 4166 1199 9 0 01 4800 1041 4798 5 0 03 9600 520 9596 9 0 03 19200 259 1
13. 2007 Microchip Technology Inc DS51647B page 1 PICkit Serial Analyzer User s Guide Chapter 11 Troubleshooting Appendix A Hardware Schematics Appendix B 28 Pin Demo Board IC Demo Firmware CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions DOCUMENTATION CONVENTIONS Description Represents Examples Arial font Italic characters Referenced books MPLAB IDE User s Guide Emphasized text is the only compiler Initial caps A window the Output window A dialog the Settings dialog A menu selection select Enable Programmer Quotes A field name in a window or Save project before build dialog Underlined italic text with A menu path File Save right angle bracket Bold characters A dialog button Click OK A tab Click the Power tab N Rnnnn A number in verilog format where N is the total number of digits R is the radix and nisa digit 4 b0010 2 hF1 Text in angle brackets lt gt A key on the keyboard Press Enter F1 Courier New font Plain Courier New Sample source code define START Filenames autoexec bat File paths c mcci8 h Keywords asm endasm static Command line options Opa Bit values Oy eck Constants OxFF A Italic Courier New A variable argument file o Where file be any valid filename Squ
14. DS51647B page 70 2007 Microchip Technology Inc USART Asynchronous Communications 8 8 TABLE 8 2 USART SCRIPT MACRO COMMANDS CONTINUED USCLKPOLRST CR Reset CLOCK POLARITY bit USINIT LJ Initialize USART controller USRESET RE Reset USART controller USAUX1RST A1RST Reset Aux1 USAUX1SET A1RST Set Aux1 USAUX1OUT A1OUT Set Aux1 direction to Output USAUXAIN A1IN Set Aux1 direction to Input USAUX1WO A1W0 Aux1 Wait 0 USAUX1W1 A1W1 Aux1 Wait 1 USAUX2RST A2RST Reset Aux2 USAUX2SET A2RST Set Aux2 USAUX2OUT A2OUT Set Aux2 direction to Output USAUX2IN A2IN Set Aux2 direction to Input USAUX2WO A2W0 Aux2 Wait 0 USAUX2W1 A2W1 Aux2 Wait 1 SCRIPT EXECUTE The Script Execute window is shown in Figure 8 10 Once scripts are created using the Script Builder they can be assigned to buttons in the Script Execute window This makes a convenient window to execute multiple scripts either individually or iteratively Script executing will be logged in the Transactions window FIGURE 8 10 USART ASYNCHRONOUS SCRIPT EXECUTE Script Execute USART Scripts Assignable Buttons Unassigned Iterations Unassigned Delay ms Unassigned Drag script onto the button above Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Show Sent Script in Transaction Window Clear Buttons 8 8 1 Assignable Buttons
15. Script Builder Script Execute 8 3 PICkit SERIAL PIN ASSIGNMENTS The Serial Analyzer pin assignments for USART Asynchronous Communications mode are TABLE 8 1 USART ASYNCHRONOUS PIN ASSIGNMENTS Pin Label Type Description 1 TX Output Transmit Data with respect to the PICkit Serial Analyzer 2 Target Power 3 GND Power Ground 4 AUX1 Input Output Auxiliary I O port pin No 1 5 AUX2 Input Output Auxiliary I O port pin No 2 6 RX Input Receive Data with respect to the PICkit Serial Analyzer 2007 Microchip Technology Inc DS51647B page 63 PICkit Serial Analyzer User s Guide 8 4 SELECTING COMMUNICATIONS MODE The USART Asynchronous Communications mode is selected from the Configuration Wizard or menu bar Configuration Wizard Select P Ckit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select P Ckit Serial Analyzer gt Select Communications Mode gt USART Asynchronous 8 5 CONFIGURING USART ASYNCHRONOUS COMMUNICATIONS MODE Once the communications mode has been selected it is configured from the Configuration Wizard or menu bar Configuration Wizard Select P Ckit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select P Ckit Serial Analyzer gt Configure Communications Mode The Configure Mode window will open Depending on the view selected the Basic View Figure
16. USART Scripts Script Detail User USART Scripts Script Name Dutput2Bytes X Clear Script Del User Scripts 1 Show Array 8 7 1 Script Commands The left most column contains the Script Commands as shown in Figure 8 5 Script Name Enter the name of the script Save Script Saves the script Execute Script Executes performs the script displayed in the Script Detail column Clear Script Clears the Script Detail column Del User Scripts Deletes scripts from the User Scripts column Show Array Displays a spreadsheet like table in which large amounts of data may be entered This data can be included in the script by right clicking in a Script Detail cell and choosing Insert Array FIGURE 8 5 USART ASYNCHRONOUS SCRIPT BUILDER SCRIPT COMMANDS Script Commands Script Builder Ex USART Scripts Script Detail User USART Scripts Script Name Dutput2Bytes lg Save Script gt Execute Script X Clear Script Del User Scripts J Show Array 2007 Microchip Technology Inc DS51647B page 67 PICkit Serial Analyzer User s Guide 8 7 2 Example Scripts The second column contains Example Scripts as shown in Figure 8 6 These can be studied to learn how to create or to edit custom scripts To load the example script into the Script Detail column either double
17. toggles between Basic and Advanced views Flash LED Flashes the Red Busy LED to confirm communications Reset Resets the PICkit Serial Analyzer if an error condition is present Basic Operations Displays the Basic Operations window for the communications mode selected Configure Advanced View Only Displays the configuration window for the communications mode selected 3 6 3 Status Column The Status Column displays status information for the selected serial communications mode In Basic View mode a simplified status is displayed as shown in Figure 3 10 In Advanced View mode additional status information is displayed for the communications mode selected as shown in Figure 3 11 The status information that is displayed depends on the selected communications mode 12 SPI USART etc The following chapters give more detailed explanation of the status window for the particular serial communications mode 2007 Microchip Technology Inc DS51647B page 23 PICkit Serial Analyzer User s Guide FIGURE 3 10 STATUS COLUMN BASIC VIEW Status Column 6 28 2007 2 57 43 lcome to PICkit Serial version 2 1 0 0 Found PICkstS d l Ver 1 5 0 0 Found PICk t Serial Analyzer FW Ver 0 0201 USB control block updated with preference data Basic View Set FIGURE 3 11 STATUS COLUMN ADVANCED VIEW Status Column 6 28 2007 2 57 43 PM 1 to PICkit Serial version 2 1 0 0 Found PICkitS d11
18. Data Data Data Data Le x Serial Analyzer Slave Address Slave Address 0 Apply Show Profile Generator Receive responds to a basic Receive request from the master In Return Byte Count enter the number of bytes a Receive request will respond with then enter the data to be returned in the Data array The Basic page limits you to eight bytes of returned data Note The indicates the value is a hexadecimal number Clicking on x will toggle it to a d indicating that the value is a decimal number Write simply displays the byte count and data written by the master Read responds to a basic Read request by the master In Return Byte Count enter the number of bytes a Read request will respond with then enter the data to be returned in the Data array The Basic page limits you to eight bytes of returned data Byte Count will display the number of bytes between the slave read address and the slave write address Data will display the data between the slave read address and the slave write address PICkit Serial Slave Address set the slave address here you wish the software to respond to then press the Apply button A confirmation message should appear on the Transactions window 2007 Microchip Technology Inc DS51647B page 41 PICkit Serial Analyzer User s Guide Show Profile Generator Press this to close the Basic operations
19. FIGURE B 1 MASTER SLAVE DEVICE LEGEND Slave Master Write Byte s This transaction is used to write one or more bytes The maximum number of bytes is slave dependant DS51647B page 136 2007 Microchip Technology Inc 28 Pin Demo Board 12 7 Demonstration Firmware FIGURE B 2 PC WRITE BYTE S S SLAVE ADR A DATA A DATA A DATA A P IW WORD ADR Read Byte s with Word Address The word address is set to begin at a given value and incremented sequentially during the transaction FIGURE B 3 PCT READ BYTE S WITH WORD ADDRESS s SLAVEADR A WI DATA RS SLAVE ADR DATA A DATA WORD ADR R Read Byte s without Word Address The word address will continue in sequence from the previous transaction to the 2 slave On Reset the device address for all three slave devices are reset to zero FIGURE B 4 READ BYTE S WITHOUT WORD ADDRESS A S SLAVE ADR DATA A DATA N P R B 6 SLAVE DEVICES The 28 Pin Demo Board I2C Demonstration firmware responds to three 2 slave devices RTC Serial EEPROM and Executive B 6 1 Slave Address 0xA2 Real Time Clock Emulation The 28 Pin Demo Board VC Demonstration emulates an I C Real Time Clock RTC Table B 3 list the word addresses TABLE B 3 REAL TIM
20. Serial Analyzer PC Software 1 3 PICkit SERIAL ANALYZER CONTENTS The PICkit Serial Analyzer serial communications development system contains the following items 1 The PICkit Serial Analyzer 2 USB cable 3 PICKkitM Serial Analyzer CD ROM 1 4 PICkit SERIAL ANALYZER DEVELOPMENT SYSTEM The PICkit Serial Analyzer consists of several components that together make an embedded serial communications development system The PC program runs on Microsoft Windows compatible computers with a USB port The PICkit Serial Analyzer connects to the PC using a USB cable Finally the PICkit Serial Analyzer interfaces to the target device using a 6 pin header Figure 1 1 illustrates the PICkit Serial Analyzer embedded serial communications development system 2007 Microchip Technology Inc DS51647B page 5 PICkit Serial Analyzer User s Guide FIGURE 1 1 PICkit SERIAL ANALYZER DEVELOPMENT SYSTEM PC Target Device SPI PICkit Serial Analyzer USART 1 5 PICkit SERIAL ANALYZER HARDWARE The PICkit Serial Analyzer connects to a Microsoft Windows compatible computer using a USB port It interfaces to the target device using a 6 pin header Figure 1 2 shows an overview of the PICkit Serial Analyzer FIGURE 1 2 PICkit SERIAL ANALYZER Legend 1 StatusLEDs Lanyard Connection 5 Pin 1 Marker 2 Push Button 4 USB Port Connection 6 Communica
21. contents of the Transactions window will be selected Clear All The contents of the Transactions window will be cleared The Transaction window also allows usage of the common keyboard shortcuts Ctrl X Ctrl C Ctrl V to cut copy and paste from the clipboard CLEAR The contents of the Transactions window will be cleared RESET TIME Resets the PICkit Serial clock applicable only if Time Markers are enabled on the Configuration page 3 7 SERIAL COMMUNICATIONS MODES Detailed information about the entering of data and commands for specific serial communications modes are given in the following chapters 2007 Microchip Technology Inc DS51647B page 25 PICkit Serial Analyzer User s Guide NOTES DS51647B page 26 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 4 IC Master Communications 4 1 INTRODUCTION This chapter describes the 2 Master Communications mode 12 data and commands can be entered using a Basic Communications window or by creating Script Commands It is assumed that the user is familiar with the 12 protocol For more information see The 12 Specification Version 2 1 January 2000 is available from NXP Semiconductor formerly Philips Semiconductor web site at http www nxp com acrobat_download literature 9398 39340011 pdf An IC Master Communications tutorial is available on the Microchip Technology web site Click on
22. gt Execute X Clear Once the WREN latch has been enabled data can be written to the 25LC020A Figure 7 6 shows that Group 0 has been disabled and Group 1 enabled Clicking on the Execute button will send the Write command 0x02 the memory address 0x00 followed by three bytes of data OxAA OxBB and OxCC The command will be logged in the Transactions window 1 2007 Microchip Technology Inc DS51647B page 53 PICkit Serial Analyzer User s Guide FIGURE 7 6 SEEPROM EXAMPLE WRITE BYTES Basic Operations SPI Master Enable 0 2 3 Group 0 Group 2 Group 3 Group 4 Operations gt Execute X Clear Figure 7 7 shows how to read data from the 25LC020A Groups 0 and 1 are disabled and Groups 2 and 3 are enabled This example shows how data is transmitted and received in one transaction Chip Select CS active between Groups Clicking on the Execute button will send the Read command 0x03 and memory address 0x00 of Group 2 followed by a Read Ten Bytes command in Group 3 The commands and received data are displayed in the transactions window FIGURE 7 7 SEEPROM EXAMPLE READ BYTES Basic Operations SPI Master Group 4 x x x x x x x x x x x
23. An PC Master Communications tutorial is available on the Microchip Technology web site Click on the links Support gt Getting Started gt PIC MCU Tutorials SFC Master Mode Several application notes are available on the Microchip Technology web site Click on links Design gt App Notes gt Function Communications gt 12 5 2 HIGHLIGHTS This chapter discusses e Serial Pin Assignments Selecting Communications Mode Configuring PC Communications Mode Communications Basic Operations 2 Profile Generator 5 3 PICkit SERIAL PIN ASSIGNMENTS The Serial Analyzer pin assignments for 2 Slave mode are listed in the following table TABLE 5 1 PIN ASSIGNMENTS Pin Label Type Description 1 Unused 2 V Power Target Power 3 GND Power Ground 4 SDA Input Output Serial Data 5 SCL Power Serial Clock 6 Unused 2007 Microchip Technology Inc DS51647B page 37 PICkit Serial Analyzer User s Guide 5 4 SELECTING COMMUNICATIONS MODE The 2 Master Communications mode is selected from the Configuration Wizard or menu bar Configuration Wizard Select P Ckit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select P Ckit Serial Analyzer gt Select Communications Mode gt PC Slave 55 CONFIGURING 2 SLAVE COMMUNICATIONS MODE Once the communications mode has been selected it is configured from the Configu
24. Break Received Auto Baud Enable event marker Automatic Baud Rate Selection Status Error Enable event marker change in LIN status byte Note Disabling any of the event markers may cause the software to not respond correctly or at all ADVANCED OPTIONS Disable LED2 Default Disable default LED2 behavior LED2 Yellow Target LED Disable LED1 Default Disable default LED1 behavior LED1 Red Busy LED Enable Switch Test Enable low level switch test Chip Select Hi Sets LIN Adapter Chip Select Hi Receive Enable Enables f w to receive data Auto Baud Detect Set Enables Auto Baud detections and setting DS51647B page 46 2007 Microchip Technology Inc Lin Communications 6 6 COMMUNICATIONS BASIC OPERATIONS The LIN Basic Operations window can be opened by selecting Basic Operations from the tool bar or Communications gt Basic Operations from the menu bar The LIN Basic Operations window is shown in Figure 6 3 FIGURE 6 3 LIN BASIC OPERATIONS Basic Operations LIN Display Mode Output Window Listen Display All OnReceive Transactions Transmit LIN Checksum Type Get Baud Classic None Set Baud Enhanced DnReceive Timeout Commands Get Timeout ms Reset Frame Buffer Transmit Master D Data Checksum Status Break Syne x Display Mode Determines when OnReceive
25. CFG 4 0 Set immediate 00 1 On 0 Off N A Blink once On or Off 10 1 On 0 Off T 1 units Blink continuous 11 initial state 1 On 0 Off T 1 units Reserved 01 Legend Time unit 50 ms Note Set LED to blink continuously on off time 100 ms CFG OxC1 M b 11 0 1 EXEC data TAG bytes identify data streams sent from the EXEC block back to the host software TABLE 11 9 EXEC TAG EDATA BYTES TAG EDATA LEN Name Description 0x80 1 END OF DATA Marks the end of valid data 0 TAG 0x81 1 FIRMWARE VERSION Firmware version 0 TAG 1 Data 20 byte STATUS BLOCK 2 Date major version 0x82 25 CONTROL BLOCK DATA Control block contents 0 TAG 1 24 Data CONTROL BLOCK 0x83 21 STATUS BLOCK DATA Status block contents 0 TAG 1 20 Data minor version 0x84 7 CBUF STATUS Status block contents 0 TAG 1 Data CBUF1 bytes used 2 Data CBUF1 bytes unused 3 Data CBUF2 bytes used 4 5 Data CBUF2 bytes unused Data CBUF3 bytes used 6 Data CBUF3 bytes unused 0x85 N 2 CBUF1 DATA Data from CBUF1 0 TAG 1 Byte count 2 N 1 Data from CBUF1 0x86 N 2 CBUF2 DATA Data from CBUF2 0 TAG 1 Byte count 2 N 1 Data from CBUF2 I 2007 Microchip Technology Inc DS51647B page 91 PICkit Serial Analyzer User s Guide 11 5 COMM DS51647B page 92 TABLE 11 9 EXEC TAG EDATA
26. FIGURE 1 4 FIRMWARE DOWNLOAD WINDOW Firmware Download HEEEMEEEEE DS51647B page 8 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 2 Getting Started 2 1 INTRODUCTION This chapter will get you started using the PICkit Serial Analyzer with the 28 Pin Demo Board In this demo the PICkit Serial Analyzer will communicate with the 28 Pin Demo Board using the 12 serial protocol The PICkit Serial Analyzer will be the DC Master and the 28 Pin Demo Board will be the 12 Slave device The 28 Pin Demo board is programmed to emulate an 2 real time clock and Serial EEPROM For more information about the 28 Pin Demo Board hardware see the 28 Pin Demo Board User s Guide DS41301 For more information about the 28 Pin Demo Board 12 7 demo firmware see Appendix B 28 Demo Board IC Demonstration Firmware The demo program source code and hex file can be found on the PICkit Serial CD ROM at D 28 pin Demo Board Firmware 2 2 HIGHLIGHTS This chapter discusses Installing the PICkit Serial Analyzer Software Connecting the PICkit Serial Analyzer to the PC Connectin
27. MICROCHIP PICkit Serial Analyzer USER S GUIDE 2007 Microchip Technology Inc DS51647B Note the following details of the code protection feature on Microchip devices Microchip products meet the specification contained in their particular Microchip Data Sheet Microchip believes that its family of products is one of the most secure families of its kind on the market today when used in the intended manner and under normal conditions There are dishonest and possibly illegal methods used to breach the code protection feature All of these methods to our knowledge reguire using the Microchip products manner outside the operating specifications contained in Microchip s Data Sheets Most likely the person doing so is engaged in theft of intellectual property Microchip is willing to work with the customer who is concerned about the integrity of their code Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code Code protection does not mean that we are guaranteeing the product as unbreakable Code protection is constantly evolving We at Microchip are committed to continuously improving the code protection features of our products Attempts to break Microchip s code protection feature may be a violation of the Digital Millennium Copyright Act If such acts allow unauthorized access to your software or other copyrighted work you may have right to sue for relief
28. Select the 28 Pin Demo PC demonstration by clicking on Demo Boards gt 28 Pin Demo from the menu bar 28 Pin Demo 12 demonstration window will be displayed as shown in Figure 2 3 The Real Time Clock RTC will be displayed first Note the tabs to select between the RTC EEPROM and ADC demonstrations The demonstration program will constantly poll the 28 Pin Demo Board and display the contents of the real time clock and the ADC 2 7 1 Real Time Clock RTC Clicking on the Real Time Clock tab will display calendar and clock contents of the real time clock function running on the 28 Pin Demo Board The 28 Pin Demo Board has been programmed to emulate a stand alone serial 2 clock calendar device The 2 commands very similar to the commands used these devices demon stration program will constantly poll the 28 Pin Demo Board and display the contents of the real time clock The Real Time Clock window displays calendar and clock controls Notice the date and time when the 28 Pin Demo Board has first been powered on The date and time start at January 1 2000 at midnight 12 00 AM The user can manually enter calendar and clock values and send the values to the real time clock by clicking on the Update RTC button Or the user can click on the Set RTC to System Time button to set the real time clock to the date and time of the computer 2007 Microchip Technology Inc DS51647B page 11 PICkit Serial An
29. Serial Analyzer in I2C Slave Communications mode LIN Puts the PICkit Serial Analyzer in LIN Communications mode Microwire Puts the PICkit Serial Analyzer in Microwire Communications mode Configure Communications Mode Displays the Configuration Communications Mode window for the communications mode selected see PICkit Serial Analyzer Select Communications Mode Download PICkit Serial Analyzer Firmware Displays the Firmware Download window Firmware updates are available from the Microchip Technology web site Run Configuration Wizard Displays the Configuration Wizard Perform System Reset Closes and then reinitializes USB communications to the PICkit Serial Analyzer Reset PICkit Serial Analyzer Resets the PICkit Serial Analyzer if an error condition is present PICkit Serial Analyzer No Up to four PICkit Serial Analyzers can be controlled from the PC software The number is assigned to the hardware as it enumerates on the USB bus D D DEMO BOARDS The Demo Boards menu selection displays the selected demonstration window The PICkit Serial Analyzer program will be automatically configured for the communications mode of the selected demonstration 28 Pin Demo 12 Displays the 28 Pin Demo Board 2 demo graphical user interface For more information see Appendix B 28 Pin Demo Board 2 Firmware USER DEFINED TEMPLATES Display Template Displays the User Defined
30. User created scripts will be displayed in the central USART Scripts column To assign a script to a button click on the script name and drag it to the desired Assignable Buttons in the right column The script will be executed once each time the button is clicked The Assignable Buttons can be cleared by clicking on the Clear Buttons button 2007 Microchip Technology Inc DS51647B page 71 PICkit Serial Analyzer User s Guide 8 8 2 Iteration Scripts can be executed a user defined number of times at a specified interval of time Figure 8 11 shows an example A script named TX Data has been assigned to the Iteration button in the left column The number of iterations is entered in the Iterations box and the delay in milliseconds in the Delay box A summary of the iterations is displayed in the left column The macro is executed when the Iteration button is clicked FIGURE 8 11 USART ASYNCHRONOUS SCRIPT EXECUTE EXAMPLE Script Execute USART Scripts Assignable Buttons Iterations 2 s Y Unassigned Unassigned Delay ms 100 Unassigned Execute script TX_Data 2 times lt lt once every 100 ms Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Show Sent Script in Transaction Window EEE DS51647B page 72 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 9 USART Master Synchronous Communications 9 1 INT
31. hexadecimal number Clicking on x will toggle it to a d indicating that the value is a decimal number Write performs a write operation to the target device refer to The ke Specification reference in Section 4 1 Introduction above The basic structure of the command is Start bit S_ Slave Address W Enter the slave address of the device to communicate with The write bit should be cleared to indicate a write operation Word Address Enter the word address Data Enter up to eight bytes of data Stop bit P The command will be logged in the Transactions window A listing of the command abbreviations is given in Table 4 2 Receive issues a simple read command to the target device refer to The I2C Specifi cation reference in Section 4 1 Introduction above The basic structure of the com mand is Start bit S Slave Address W Enter the slave address of the device to communicate with The write bit should be set to indicate a read operation Byte Count Enter the number of bytes to receive Stop bit P 1 DS51647B page 30 2007 Microchip Technology Inc CT Master Communications FIGURE 4 3 BASIC OPERATIONS Basic Operations 12 Master Stave Byte Status Address R Court oe x ll x IP b Execute X Clear Stave Word Ad ress W Address Status D SIE Execute x x x be X Clear Read Steve Weed Stave B
32. x x j x x KK x J x x Operations gt Execute X Clear 7 7 SCRIPT BUILDER SPI commands can be combined into scripts saved and used over again The Script Builder window is opened by selecting Communications gt Script gt Script Builder from the menu bar The Script Builder is shown in Figure 7 8 The Script Builder window is divided into four columns as shown in Figures 7 9 through 7 12 EEEEESESEESESE DS51647B page 54 2007 Microchip Technology Inc SPI and Microwire Master Communications FIGURE 7 8 SPI SCRIPT BUILDER Script Builder Example SPI Scripts Script Detail Script Name EEWriteE nable EEWrite1 Byte EEReadbBytes lg Save Script gt Execute Script X Clear Script Del User Scripts Show Array 7 7 1 Script Commands The left most column contains the Script Commands as shown in Figure 7 9 Script Name Enter the name of the script Save Script Saves the script Execute Script Executes performs the script displayed in the Script Detail column Clear Script Clears the Script Detail column Del User Scripts Deletes scripts from the User Scripts column Show Array Displays a spreadsheet like table in which large amounts of data may be entered This data can be included in the script by right clicking in a Script Detail cell and cho
33. 1 Slave address 2 Register ID 3 Byte count N 4 Data N 3 Data OxC3 3 2 5 REGDATA RETURN read return register definition mode 2 0 TAG 1 Slave Address 2 Register ID 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware 11 7 3 2 TAG SDATA TABLE 11 30 TAG SDATA LEN NAME DESCRIPTION 0xCO 2 2 5 EVENT ADDR ADDRESS byte received 0 SDATA TAG 1 data address OxC1 2 I2CS EVENT DATA RX DATA byte received Master write 0 SDATA TAG 1 data 0 2 2 I2CS_EVENT_DATA_TX DATA byte sent Master read 0 SDATA TAG 1 data 0xC3 1 2 5 EVENT ACK received 0 SDATA TAG 4 1 I2CS EVENT received 0 SDATA TAG 0xC5 1 I2CS EVENT START START bit received 0 SDATA TAG 0xC6 1 I2CS EVENT STOP STOP bit received 0 SDATA TAG OxC7 2 I2CS EVENT STATUS ER Status error R 0 SDATA TAG 1 error status byte 0xC8 1 DCS DATA DATA request master read mode 1 0 SDATA TAG 0 9 1 I2CS_EVENT_REG READ REG READ mode 2 0 SDATA TAG Slave Address 2 Register ID OxCA 1 I2CS EVENT REG WRIT REG WRITE E 0 SDATA TAG mode 2 1 Slave Address 2 Register ID OxCB 3 I2CS_REGDATA register data mode 2 0 TAG 1 Slave Address 2 Register ID 3 Byte count 4 Data N 3 Data 2007 Microchip Technology Inc DS51647B page 111 PICkit Serial Analyzer User
34. 2 TES Ka a Insert Array gt Execute Script General Cmds gt Del User Scripts SS TE show Data IO Out 3 hon ano 1 Data IO In Out SDOIn Sal spoout x Init CSON CS OFF TABLE 7 2 SPI SCRIPT MACRO COMMAND Command ji Macro 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 LJ Initialize SPI controller SPICSON CSON Assert CS active low DS51647B page 58 2007 Microchip Technology Inc SPI and Microwire Master Communications TABLE 7 2 SPI SCRIPT MACRO COMMAND CONTINUED SPICSOFF CSOF De assert CS active low 7 8 SCRIPT EXECUTE The Script Execute window is shown in Figure 7 14 Once scripts are created using the Script Builder they can be assigned to buttons in the Script Execute window This makes a convenient window to execute multiple scripts either individually or iteratively Script executing will be logged in the Transactions window FIGURE 7 14 SPI SCRIPT EXECUTE Script Execute aj SPI Scripts Assignable Buttons Iterati
35. 2007 Microchip Technology Inc DS51647B page 43 PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 6 Lin Communications 6 1 INTRODUCTION This chapter describes the LIN Communications mode LIN data and commands can be entered using a Basic Communications window To use LIN communications you must attach the LIN Adapter to the PICkit Serial Analyzer and supply it power prior to attempting any communications It is assumed that the user is familiar with the LIN protocol For more information see LIN bus Specification Ver 1 2 http www lin subbus de 6 2 HIGHLIGHTS This chapter discusses PICkit Serial Pin Assignments Selecting Communications Mode Configuring LIN Communications Mode Communications Basic Operations 6 3 PICkit SERIAL PIN ASSIGNMENTS The PICkit Serial Analyzer pin assignments for LIN mode are TABLE 6 1 PIN ASSIGNMENTS Pin Label Type Description 1 TX Output Transmit 2 Unused ES 3 GND Power Ground 4 CS Wake Input Chip Select Wake 5 Fault TXE Input Output Fault TXE 6 RX Input Receive 6 4 SELECTING COMMUNICATIONS MODE The LIN Communications mode is selected from the Configuration Wizard or menu bar Configuration Wizard Select PICkit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select P Ckit Serial Analyzer gt Select Communications Mode gt LIN 2007 Microchip Technology Inc DS5164
36. 26 843 sec 0x18 1 TIMEOUT_AB1_KILL Kill disable timeout AB1 0 TAG 0x19 1 MACRO_CLEAR Start macro definition 0 TAG 0 1 2 MACRO DATA ADD Add bytes to macro 0 TAG 1 Byte count N 2 Data N 1 Data Ox1B 3 MACRO RUN Run macro 0 TAG Loop count 0 indefinitely 2 Loop count 0 indefinitely Ox1C 1 END OF SCRIPT Mark end of script 0 TAG Ox1D 1 MACRO DATA START Mark start of macro data block 0 TAG Ox1E 1 MACRO DATA END Mark end of macro data block 0 TAG I 2007 Microchip Technology Inc DS51647B page 93 PICkit Serial Analyzer User s Guide TABLE 11 11 COMM SCRIPT COMMAND TAG BYTES CONTINUED TAG CCMD LEN Name Description Ox1F 0x20 2 MARKER EVENT_TIMER_RESET Script marker 0 TAG 1 Marker Event timer Reset 0 TAG TABLE 11 12 COMM SCRIPT DATA TAG BYTES TAG CDATA LEN Name Description 0x00 OxOF 16 RESERVED RESERVED 0x10 2 DATA BYTE Data byte follows 0 TAG 1 data 0x11 N 2 DATA_BYTES Data bytes follow 0 TAG 1 Byte count N 2 Data N 1 Data 0x12 EVENT_MACRO_LOOP Macro loop count milestone message 0 TAG 1 Loop number 0x13 EVENT_TIME Time marker for previous event 0 TAG 1 Time LSB 2 Time MSB res 409
37. Aux2 Wait 0 USAUX2W1 A2W1 Aux2 Wait 1 9 8 SCRIPT EXECUTE The Script Execute window is shown in Figure 9 10 Once scripts are created using the Script Builder they can be assigned to buttons in the Script Execute window This makes a convenient window to execute multiple scripts either individually or iteratively Script executing will be logged in the Transactions window FIGURE 9 10 USART ASYNCHRONOUS SCRIPT EXECUTE Script Execute Iterations USART Scripts Assignable Buttons Unassigned Unassigned Delay ms vins Unassigned Drag script onto the button above Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Show Sent Script in Transaction Window 9 8 1 Assignable Buttons User created scripts will be displayed in the central USART Scripts column To assign a script to a button click on the script name and drag it to the desired Assignable Buttons in the right column The script will be executed once each time the button is clicked The Assignable Buttons can be cleared by clicking on the Clear Buttons button 2007 Microchip Technology Inc DS51647B page 81 PICkit Serial Analyzer User s Guide 9 8 2 Iteration Scripts can be executed a user defined number of times at a specified interval of time Figure 9 11 shows and example A script named TX Data has been assigned to the Iteration button in the left column The number of iterations is ent
38. BYTES CONTINUED TAG EDATA LEN Name Description 0x87 N 2 CBUF3 DATA Data from CBUF3 0 TAG 1 Configuration byte 2 N 1 Data from CBUF3 0x88 2 PACKET ID Packet number 0 TAG 1 Data arbitrary packet ID TAG byte 0x80 means the transaction is over TAG byte 0x81 signifies that the following data is the firmware version 0x82 signifies that the data following is the control block CONTROL BLOCK 0x83 signifies that the data following data is the status block STATUS BLOCK The EXEC portion of STATUS BLOCK is shown in Table 11 10 TABLE 11 10 EXEC STATUS BLOCK Byte Bit Description EXEC 0 7 0 EXEC status 0 1 CBUF1 overflow 2 CBUF2 overflow 3 CBUF3 overflow 4 Data error e g illegal TAG missing TAG dependent data etc 5 Restore control block failed defaults used 6 7 Composite error 1 7 0 EXEC status flags 0 SWITCH test active 1 SWITCH state i e 0 depressed 1 released 2 3 4 5 6 7 2 7 0 3 7 0 TAG byte 0x84 is the script buffer status which shows availability of memory in each buffer TAG bytes 0x85 0x86 and 0x87 identify data streams coming from RAM buffers CBUF1 CBUF2 and CBUF3 respectively RAM buffer 2 CBUF2 is used in this archi tecture to queue the data stream from the COMM module to be sent to the host software thus TAG byte 0x86 identifies this stream TAG bytes 0x85 and 0x87 are typ
39. s interpreted by COMM CDATA COMM data TAG s generated by COMM The other major blocks are the control memory block and the status memory block The control block is used to configure the PICkit Serial Analyzer The control block is divided into the following three sections EXEC module configuration Generic COMM module configuration Protocol specific communication configuration This third section will change depending on the protocol The Status block keeps the status of various flags and is similarly divided into three sections TABLE 11 2 CONTROL BLOCK TAG Bytes Definition 0 7 EXEC section 8 15 Generic COMM section 16 23 Protocol specific communication section 1 DS51647B page 88 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware TABLE 11 3 STATUS BLOCK TAG Bytes Definition 0 3 EXEC section 4 11 Generic COMM section 12 19 Protocol specific communication section 11 4 EXEC The EXEC module will directly decode the data stream from the host The list of differ ent commands is shown in Table 11 4 Every data stream from the software to the PICkit Serial Analyzer begins with one of the following EXEC command TAG bytes TABLE 11 4 EXEC COMMAND ECMD TAG BYTES TAG ECMD LEN Name Description 0x00 1 END OF DATA Marks the end of valid data 0 TAG 0x01 1 C
40. s Guide 11 8 SPI COMMUNICATIONS SPI is a 4 wire serial protocol that uses data in data out clock and Chip Select pins It is a very basic protocol using a clock edge to capture data The CONTROL_BLOCK is used to enable SPI event markers set the bit rate and configure transaction protocol options TABLE 11 31 CONNECTOR PINOUT IN SPI MODE Pin Description CS V GND SDI SCK SDO OJJ AJJ N gt TABLE 11 32 SPI CONTROL BLOCK Byte Bit Description COMM SPI 16 7 0 Bit flags 0 1 Event marker enable read byte 1 1 Event marker enable write byte 2 1 Event marker enable status error 3 4 5 6 7 1 17 7 0 SPI Configuration bits 0 1 SMP sample phase 1 1 CKE clock edge select 2 1 CKP clock polarity 3 1 DAOD disable auto output disable on data input 4 n a 5 n a 6 n a 7 CSPOL Chip Select Polarity 0 LO TRUE 1 HI TRUE 18 7 0 19 7 0 20 7 0 21 7 0 22 7 0 BIT RATE Pre scale code 23 7 0 BIT RATE Scaling code Note 1 CSPOL determines the active state of CS if CSPOL 0 CS is active low if CSPOL 1 CS is active high upon initialization CS is set inactive DS51647B page 112 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware TABLE 11 33 BITRATE CODES
41. 1 event marker enable NACK RX 5 1 event marker enable REG READ 6 1 event marker enable REG WRITE 7 1 event marker enable status error 18 7 0 0 1 event marker enable START reserved not implemented 1 1 event marker enable STOP 2 1 event marker enable DATA RQ 3 4 5 6 7 19 7 0 20 7 0 MODE 0 read data bytes 1 thru N 21 7 0 MODE 0 read data byte 0 22 7 0 SLAVE ADDRESS 23 7 0 SLAVE ADDRESS MASK DS51647B page 108 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware 11 7 2 2 STATUS BLOCK TABLE 11 28 BYTE BIT DESCRIPTION COMM 12 5 12 7 0 bit flags error status 0 Slave profile malformed mode 2 1 2 3 4 5 SSPOV 6 WCOL 7 composite error 13 7 0 bit flags info status 0 SCK line state 0 1 1 SDA line state 0 1 2 3 4 5 6 7 14 7 0 15 7 0 16 7 0 17 7 0 18 7 0 19 7 0 I 2007 Microchip Technology Inc DS51647B page 109 PICkit Serial Analyzer User s Guide DS51647B page 110 11 7 3 Communication Tags 11 7 3 1 TAG SCMND TABLE 11 29 SCMND LEN NAME DESCRIPTION 0xCO 1 CS INIT initialize IC controller 0 TAG OxC1 N 2 2 5 SEND BYTES send provide read bytes mode 1 0 TAG 1 byte count N 2 data N 1 data OxC2 N 3 2 5 REGDATA LOAD write load register definition mode 2 0 TAG
42. 2 transaction looks like this on the bus START A8 0 1 RESTART A9 data byte received STOP As the script is executed a data stream will be developed using TAGs CDATA described in Table 11 19 and returned to the host software via CBUF2 1 0 51647 100 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware TABLE 11 19 12 DATA TAG BYTES See LEN Name Description 0x80 1 CM EVENT START TX Start bit event 0 CDATA TAG 0x81 1 CM EVENT STOP TX Stop bit event 0 CDATA TAG 0x82 1 CM EVENT RESTART TX Restart bit event 0 CDATA TAG 0x83 1 I CM EVENT ACK TX ACK bit event 0 CDATA TAG 0x84 1 CM EVENT NACK TX NACK bit event 0 CDATA TAG 0x85 1 CH EVENT ACK RX ACK bit event 0 CDATA TAG 0x86 1 CM EVENT NACK NACK bit event 0 CDATA TAG 0x87 2 CM EVENT BYTE TX BYTE transmit 0 CDATA TAG 1 data 0x88 2 CM EVENT BYTE BYTE transmit 0 CDATA TAG 1 data 0x89 2 CM EVENT ERR transaction error 0 CDATA TAG 1 error byte 0x8A 2 CM EVENT STATUS ERR status error 0 CDATA TAG 1 error byte I 2007 Microchip Technology Inc DS51647B page 101 PICkit Serial Analyzer User s Guide 11 7 ICS COMMUNICATIONS The 12 5 communication mode is a flexible 12 slave that can be configured to respond to one or more bus addresses Three operating modes described bel
43. 34 91 708 08 91 UK Wokingham Tel 44 118 921 5869 Fax 44 118 921 5820 2007 Microchip Technology Inc DS51647A page 144
44. AUTOBAUD detection is enabled the PKSA will wait a maximum of WAIT BRK for the BREAK to complete at The duration of WAIT BRK must be set to accommodate the slowest BAUD rate supported 6 msec was chosen to support 1000 BAUD 50 If the end of BREAK is not seen in that time the AUTOBAUD ERROR bit is set in the STATUS BLOCK and the operation is aborted If the end of BREAK is seen the AUTOBAUD mechanism is enabled and the BAUD rate of the SYNC character is measured At the second interrupt RCIF 2 at E the operation is complete and the new measured BAUD rate is used for subsequent transactions If the AUTOBAUD measurement experienced an overflow the AUTO BAUD ERROR bit is set in the STATUS BLOCK and the default BAUD rate from the CONTROL BLOCK is reloaded into the USART In either case the resultant BAUD rate is reflected in the STATUS BLOCK After the BREAK the PKSA will wait indefinitely for the SYNC character to begin with the USART receiver disabled WARNING The SYNC character is not actually received by the PKSA during an AUTOBAUD operation therefore it is not reflected reported to the HOST The EVENT MARKER sequence would be BREAK_RX and AUTOBAUD followed by BAUD_L BAUD_H If AUTOBAUD was not enabled the EVENT MARKER sequence would be BREAK RX then BYTE RX followed by 0x55 FIGURE 11 5 A B D 90 225 gt 1 gt RCIF 2 gt WAIT BRK
45. BLOCK Byte Bit Description COMM 12 12 7 0 Bit flags error status 0 WCOL error 1 SSPOV error 2 received when ACK was expected 3 4 5 6 7 Composite error 13 7 0 Bit flags info status 0 1 2 3 4 5 6 7 14 7 0 15 7 0 16 7 0 0 AUX1 state 0 1 1 AUX2 state 0 1 2 AUX1 direction 1 IN 0 OUT 3 AUX2 direction 1 IN 0 4 5 6 7 17 7 0 SDA Line Voltage 255 5V 18 7 0 SCL Line Voltage 255 5V 19 7 0 BIT RATE CODE currently in use The TAG CCMND bytes are used by the host software to describe an 2 trans action in script form The script is sent via USB to the script buffer CBUF1 and inter preted by the COMM controller to execute the transaction on the 2 bus The return data stream contains KC read data as well as event marker TAGs that mark the occurrence of each entity of the 2 transaction e g TAG 0x81 indicates a Start bit I DS51647B page 98 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware TABLE 11 18 12CM CMD TAG BYTES TAG CCMD LEN Name Description 0x80 1 INIT Initialize master 0 TAG 0x81 1 START Issue CT Start 0 TAG 0
46. Communications 12 SLAVE MODE There are three modes of IZC slave operation DEFAULT Basic mechanical mode of operation in which the PKSA blindly accepts any all write data and provides canned default read data in response to any enabled 2 address and all device addresses INTERACTIVE This mode allows the host to orchestrate 2 transactions in real time This necessarily requires the host to provide read and receive data as needed while the PKSA holds the 2 bus clock line waiting Write data is reported to the host via transaction event tags AUTO In AUTO mode the PKSA operates autonomously as defined by a dynamic SLAVE PROFILE table stored in PKSA RAM At any time the host can read and or update the table as needed SCRIPT TIMEOUT When the slave responds to Read and Receive queries the software will wait a maxi mum of Script Timeout ms to receive a script complete tag before issuing an error If your slave profile is responding with large amounts of data you may need to increase the Script Timeout to avoid errors FIGURE 5 2 CT SLAVE CONFIGURE COMMUNICATIONS MODE ADVANCED VIEW Configure Communications Mode 2 Slave Options Event Markers Advanced Options Save Changes Enable E vent Markers Abrt Mac Exe C Disable LED2 Default Enable Time Markers Macro Loop Disable LED Default Enable Pullups MacLp65536 7 Enable Switch Test Script Timeout Volt
47. IC commands and data be read and written to the 28 Pin Demo Board from the Basic Operations window as shown in Figure 2 6 Ensure that the PICkit Serial Analyzer program is in 2 Master mode by selecting PICkit Serial Analyzer gt Run Con figuration Wizard from the menu bar and selecting 2 Master Note 28 Pin Demo 12 window and the Basic Operations window cannot be opened at the same time When the 28 Pin Demo I C window is opened the Basic Operations window will automatically close FIGURE 2 6 IC BASIC OPERATIONS Basic Operations 12C Master x me Pn uu m Sant P gt Execute Lx Ges 5 e e x SP X Clear Read Save Wes Stave byte B Ahass Address Ashes gt Emeute x x RS x x P m X Clear 2 8 1 Real Time Clock RTC The Slave address for the emulated real time clock on the 28 Pin Demo Board is hexadecimal A2 0xA2 The Word Address selects the following memory locations TABLE 2 1 MEMORY LOCATIONS Word Address Contents 0x00 Configuration 1 0x01 Configuration 2 0x02 Seconds 0x03 Minutes 0x04 Hours 0x05 Days 0x06 Weekdays 0x07 Months 0x08 Years DS51647B page 14 2007 Microchip Technology Inc Getting Started For example to read seconds from the real time clock Step 1 Enter 0xA2 into the Slave Addr
48. Mode 64 8 6 Communications Basic Operations 66 8 7 Script Builder io i E e ER ERE eer Rp agreed dis qc ERA 66 8 8 exire ee Ia tei iat ur IR ee e dU ERA ERA 71 Chapter 9 USART Master Synchronous Communications EIN WAWA EAS 73 9 27 EE 73 9 3 PICkit Serial Pin Assignments 4444 73 9 4 Selecting Communications Mode 73 9 5 Configuring USART Synchronous Master Communications Mode 74 9 6 Communications Basic Operations 76 97i OCDE BUlldet epp 76 9 85 Script ee 81 Chapter 10 User Defined Templates 15 EB n ee Ee e EE 83 1022 te Tute eese ret oae nt e eene eee rei ias 83 10 3 Creating and Using Templates 4 84 10 4 My Templates Line exp ndn dia RR ES CHEN n xp ERI See 85 10 5 GRAPHING DATA iii ea es e 86 Chapter 11 PICkit Serial Analyzer Firmware 2007 Microchip Technology Inc DS51647B page v PICkit Serial Analyzer User s Guide 87 12 Highlights eau some 87 11296 OVO 87 TIA CEET 89 11293 COMMISE E 92 11 6 Communications tn deett hen tenes 96 11 7 12CS Communications Sims ENEE 102 11 8 SPI Communications 112 11 9
49. SCL SCK SCK Fault TXE 6 SDO RX SDO RX Note The 6 pin header 0 100 spacing accepts 0 025 square pins KEEN 2007 Microchip Technology Inc DS51647B page 7 PICkit Serial Analyzer User s Guide 1 6 PICkit SERIAL ANALYZER SOFTWARE 1 6 1 PC Program The PICkit Serial Analyzer PC program uses a graphical interface to enter data and commands to communicate to the target device Data and commands can be entered using basic or scripting commands Chapter 3 PICkit Serial Analyzer PC Program explains the installation and operation of the program Following Chapter 3 there are individual chapters that explain the specific serial communications modes and their operation 1 6 2 Dynamically Linked Library DLL The PICkit Serial Analyzer DLL is explained in Chapter 12 PICkit Serial Analyzer DLL 1 6 3 Firmware The PICkit Serial Analyzer firmware is explained in Chapter 11 PICkit Serial Analyzer Firmware The latest version of the PICkit Serial Analyzer firmware can be downloaded from the Microchip Technology web site The firmware is updated by selecting P Ckit Serial Analyzer gt Download PICKkit Serial Analyzer Firmware from the menu bar An open file window will open Select the hex file to be uploaded to the PICkit Serial Analyzer and click on the Open button The Firmware Download window will open as shown in Figure 1 4 to indicate the status of the firmware update
50. Set SDO pin to OUTPUT 0 Ox8A 1 SPI INIT Initialize SPI controller per CONTROL BLOCK 0 0 8 1 CS Assert CS 0 0 8 1 SPI_CS_OFF De assert CS 0 Note 1 CS polarity is determined by CONTROL BLOCK configuration bit CSPOL CSPOL 0 asserting sets CS 0 de asserting sets CS 1 CSPOL 1 asserting sets CS 1 de asserting sets CS 0 TABLE 11 36 SPI DATA TAG BYTES TAG CDATA LEN Name Description 0x80 2 SPI EVENT BYTE TX BYTE transmit 0 1 data 0x81 2 SPI EVENT BYTE RX BYTE transmit 0 1 data 0x82 2 SPI EVENT STATUS ERR Status error 0 error byte DS51647B page 114 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware 11 9 USART COMMUNICATIONS Universal Synchronous Asynchronous Receive Transmit USART protocol is a stan dard 2 wire serial communication In Asynchronous mode there is a transmit line and a receive line In Synchronous mode the transmit line becomes the clock line and the receive line becomes the bidirectional data line In Asynchronous mode 8 bits are framed by a Start and Stop bit A ninth bit can be included to use as a parity bit To configure the protocol set the clock polarity to rising edge or falling edge if using Synchronous mode Select the baud rate according to the BRG table TABLE 11 37 CONNECTOR PINOUT IN USART ASYNCHRONOUS MODE Pin Description
51. Timeout to avoid errors 2007 Microchip Technology Inc DS51647B page 45 PICkit Serial Analyzer User s Guide FIGURE 6 2 LIN CONFIGURE COMMUNICATIONS MODE ADVANCED VIEW Configure Communications Mode LIN Options Event Markers Advanced Options lg Save Changes Enable Event Markers C Abit Mac Exe C Disable LED2 Default Enebe Time Makes C Macro Loop Disable LED Default C Mac Lp 65536 C Enable Switch Test Se Mac Lp Done Chip Select HI Script Timeout C Timeout Timert Receive Enable LJ Timeout Timer2 Auto BAUD detect set 2000 ms Status Error Adjust timeout for script Data No need to press CO Data TX Save Changes C Break TX Break Auto BAUD LIN BAUD Status Error Target 20000 Enable Al Actual 20000 LIN Options EVENT MARKERS Abrt Mac Exe Enable event marker abort macro execution Macro Loop Enable event marker top of macro loop Lp 65536 Enable event marker macro loop count overflow e 65536 Mac Lp Done Enable event marker macro loop iterations complete Timeout Timer1 Enable event marker Timer1 expired Timeout Timer2 Enable event marker Timer2 expired Status Error Enable event marker change in status byte Data RX Enable event marker Data received Data TX Enable event marker Data transmitted Break TX Enable event marker Break transmitted Break RX Enable event marker
52. event marker top of macro loop Mac Lp 65536 Enable event marker macro loop count overflow e 65536 Mac Lp Done Enable event marker macro loop iterations complete Timeout Timer1 Enable event marker Timer1 expired Timeout Timer2 Enable event marker Timer2 expired Status Error Enable event marker change in status byte Read Byte Enable event marker read byte Write Byte Enable event marker write byte Status Error Enable event marker change in USART status byte Break TX Enable event marker A Break has been transmitted ADVANCED OPTIONS Disable LED2 Default Disable default LED2 behavior LED2 Yellow Target LED Disable LED1 Default Disable default LED1 behavior LED1 Red Busy LED Enable Switch Test Enable low level switch test 2007 Microchip Technology Inc DS51647B page 65 PICkit Serial Analyzer User s Guide AUX1 Default State AUX1 communication line default state 0 1 AUX2 Default State AUX2 communication line default state 0 1 AUX1 Direction AUX1 communication line direction 1 input 0 output AUX2 Direction AUX2 communication line direction 1 input 0 output Async Receive Disabled Received Data is disabled 8 6 COMMUNICATIONS BASIC OPERATIONS The USART Asynchronous Operations window can be opened by selecting Communications Basic Operations from th
53. load a user script from the User Scripts column into the Script Detail column the user can double click or right click and select from the local menu User Scripts can be deleted by right clicking and selecting Delete Script from the local menu FIGURE 8 8 USART ASYNCHRONOUS SCRIPT BUILDER USER SCRIPTS User Scripts Script Builder Ex USART Scripts Script Detail ser LISART Scripts Script Name Dutput2Bytes Save Script gt Execute Script X Clear Script Del User Scripts Show Array 8 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 8 9 Select from the choice of commands or script macro commands 2007 Microchip Technology Inc DS51647B page 69 PICkit Serial Analyzer User s Guide 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 8 9 Macro commands are entered according to the sequence of events as defined by the USART Asynchronous 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 The choice of macro commands is very flexible Therefore the correctness of the script has to be v
54. specify 1 default BAUD rate 2 LIN adapter chip select line state Optionally 1 set receive enable configuration bit to allow the PKSA to receive RX data and report it to the HOST 2 enable desired event markers MONITOR To configure the PKSA to perform as LIN bus MONITOR the HOST must write the CONTROL BLOCK to specify 1 LIN adapter chip select line state 2 set receive enable configuration bit to allow the PKSA to receive RX data and I 2007 Microchip Technology Inc DS51647B page 121 PICkit Serial Analyzer User s Guide report it to the HOST 3 set auto baud enable configuration bit to allow PKSA to track baud rate of bus transactions Optionally 1 enable desired combination of event markers 11 10 3 Communication Tags 11 10 3 1 TAG SCMND TAG commands and data sent to the PICkit Serial Analyzer TABLE 11 46 TAG LEN NAME DESCRIPTION 0x80 1 LIN_INIT initialize USART controller 0 TAG 0x81 N 2 UN XMT DATA transmit DATA byte s 0 TAG 1 Byte count 2 Data N 1 Data 0x82 1 LIN_XMT_BRK transmit BREAK 0 0 83 N 2 LIN XMT DATA transmit BREAK then DATA bytes the data must include SYNC char 0 TAG 1 Byte count 2 Data SYNC character N 1 Data 0x84 N 2 11 FRAME transmit DATA byte s implied leading BREAK amp SYNC 0 TAG 1 Byte count 2 Data N 1 Dat
55. usec max 26 8 sec 0x14 EVENT_TIME_ROLLOVER Event timer rollover 0 TAG 0x15 EVENT_MACRO_DONE Macro loop complete 0 TAG 1 Loop count LSB 2 Loop count MSB 0x16 EVENT_MACRO_ROLLOVER Macro loop count rollover 65536 useful with infinite loop count 0 TAG 0x17 EVENT_MACRO_ABORT Macro execution was aborted by bit in command block 0 TAG 0x18 EVENT_TIMEOUT_ABO Timer ABO timeout 0 TAG 0x19 EVENT_TIMEOUT_AB1 Timer AB1 timeout 0 TAG 0 1 EVENT_STATUS_ERR Status error 0 TAG 1 STATUS BLOCK 04 0 1 EVENT_END_OF_SCRIPT End of Script TAG encountered 0 TAG Wale MARKER Marker tag encountered 0 TAG 1 MARKER DS51647B page 94 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware TABLE 11 13 COMM SCRIPT CONTROL BLOCK Byte Bit Description COMM GENERAL 7 0 COMM mode 00 IDLE 01 I2CM 02 SPI M 04 USART A 05 USART SM 07 I2CS OA LIN MWIRE M SS COMM control bits 1 Enable event markers global 1 Enable event markers time stamp 1 Enable PULLUPS 1 On 1 VSRC variable N O1 A NM 1 Abort macro execution 10 23 flags 1 Event marker enable macro loop 1 E
56. wire communication I 2007 Microchip Technology Inc DS51647B page 51 PICkit Serial Analyzer User s Guide 7 6 COMMUNICATIONS BASIC OPERATIONS The SPI Basic Operations window can be opened by selecting Communications Basic Operations from the tool bar or Communications Basic Operations from the menu bar The SPI Basic Operations window is shown in Figure 7 3 The Basic Operations win dow is organized into five columns Individual columns are enabled by clicking on the Enable check box The Send button indicates that the column boxes are used to enter data bytes that will be transmitted to the target device Clicking on the Send button toggles the column mode to Rcv Receive and the number of received bytes is entered as shown in Figure 7 4 Clicking on the Execute button will execute the enabled columns in order from left to right The Clear button clears all boxes Note The x indicates the value is a hexadecimal number Clicking on x will toggle it to a d indicating that the value is a decimal number The commands will be logged in the Transactions window A listing of the command abbreviations is given in Table 7 2 FIGURE 7 3 SPI BASIC OPERATIONS Basic Operations SPI Master amp 3 Group 1 Group 2 Group 3 x x x x x x x x x x x s n v x x x x x x
57. 007 Microchip Technology Inc DS51647B page 57 PICkit Serial Analyzer User s Guide 7 7 5 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 Creating A Script 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 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 pt Builde E Example SPI Scripts Script Detail User SPI Scripts Script Name EEWriteE nable e A FE ie
58. 07 Microchip Technology Inc DS51647B page 73 PICkit Serial Analyzer User s Guide 9 5 CONFIGURING USART SYNCHRONOUS MASTER COMMUNICATIONS MODE Once the communications mode has been selected it is configured from the Configu ration Wizard or menu bar Configuration Wizard Select P Ckit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select P Ckit Serial Analyzer gt Configure Communications Mode The Configure Mode window will open Depending on the view selected the Basic View Figure 9 1 displays a minimum choice of configurations commands In the Advanced View Figure 9 2 displays an extended choice of configuration commands Save the configuration by clicking on the Save Changes button FIGURE 9 1 USART SYNCHRONOUS MASTER CONFIGURE COMMUNICATIONS MODE BASIC VIEW Configure Communications Mode m Options Save Changes v Enable Event Markers Enable Time Markers Script Timeout Voltage 7 Serial will 3000 2 ms power my device 5 Volt Adjust timeout for script Other fail No need to press Save Changes 5 0 USART BAUD Target Actual 1220 OPTIONS Enable Event Markers Enable event markers Enable Time Markers Enable time stamp to accompany all event markers VOLTAGE Serial will power my device Select the check box if the PICkit Serial will power the ta
59. 1 DW_ 02 16 01 RS D 0 S J 11 23 34 04 P_ 2 26 51 PM Sent script Reg2 ols 5 1 4 1 02 16 02 RS Dv s 01 02 03 04 05 fos OF 10 11 12 13 14 B1 100 Delay Between EE d Caisse Bytes Used 0 CBuf2 Bytes Left 255 120 Specific Detail Direction Deh 0 Out I DS51647B page 86 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 11 PICkit Serial Analyzer Firmware 11 1 INTRODUCTION This chapter explains the internal operations of the PICkit Serial Analyzer firmware The source code is available on the PICkit Serial Analyzer CD ROM at D PICkit Serial Analyzer Firmware 11 2 HIGHLIGHTS This chapter discusses EXEC COMM 12CM Communications 12CS Communications SPI MICROWIRE Communications USART Communications LIN Communications 11 3 OVERVIEW Internally the PICkit Serial Analyzer operates two firmware state controllers running in parallel EXEC executive and COMM communication The EXEC controller is responsible for overall PICkit Serial Analyzer configuration moving data to from the host via USB and moving data to from the COMM controller via RAM buffers The COMM controller supervises serial communication with the target device This includes both configuring the nece
60. 2839 5507 Fax 86 757 2839 5571 China Wuhan Tel 86 27 5980 5300 Fax 86 27 5980 5118 China Xian Tel 86 29 8833 7250 Fax 86 29 8833 7256 ASIA PACIFIC India Bangalore Tel 91 80 4182 8400 Fax 91 80 4182 8422 India New Delhi Tel 91 11 4160 8631 Fax 91 11 4160 8632 India Pune Tel 91 20 2566 1512 Fax 91 20 2566 1513 Japan Yokohama Tel 81 45 471 6166 Fax 81 45 471 6122 Korea Gumi Tel 82 54 473 4301 Fax 82 54 473 4302 Korea Seoul Tel 82 2 554 7200 Fax 82 2 558 5932 or 82 2 558 5934 Malaysia Penang Tel 60 4 646 8870 Fax 60 4 646 5086 Philippines Manila Tel 63 2 634 9065 Fax 63 2 634 9069 Singapore Tel 65 6334 8870 Fax 65 6334 8850 Taiwan Hsin Chu Tel 886 3 572 9526 Fax 886 3 572 6459 Taiwan Kaohsiung Tel 886 7 536 4818 Fax 886 7 536 4803 Taiwan Taipei Tel 886 2 2500 6610 Fax 886 2 2508 0102 Thailand Bangkok Tel 66 2 694 1351 Fax 66 2 694 1350 12 08 06 DS51647A page 143 2007 Microchip Technology Inc DSTEMP EUROPE Austria Wels Tel 43 7242 2244 39 Fax 43 7242 2244 393 Denmark Copenhagen Tel 45 4450 2828 Fax 45 4485 2829 France Paris Tel 33 1 69 53 63 20 Fax 33 1 69 30 90 79 Germany Munich Tel 49 89 627 144 0 Fax 49 89 627 144 44 Italy Milan Tel 39 0331 742611 Fax 39 0331 466781 Netherlands Drunen Tel 31 416 690399 Fax 31 416 690340 Spain Madrid Tel 34 91 708 08 90 Fax
61. 7B page 44 Lin Communications 6 5 CONFIGURING LIN SLAVE COMMUNICATIONS MODE Once the communications mode has been selected it is configured from the Configuration Wizard or menu bar Configuration Wizard Select P Ckit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select P Ckit Serial Analyzer gt Configure Communications Mode The Configure Mode window will open Depending on the View selected the Basic View Figure 6 1 displays a minimum choice of configurations commands In the Advanced View Figure 6 2 displays an extended choice of configuration commands Save the configuration by clicking on the Save Changes button FIGURE 6 1 LIN CONFIGURE COMMUNICATIONS MODE BASIC VIEW Configure Communications Mode m Options lg Save Changes Enable E vent Markers Enable Time Markers Script Timeout 2000 2 ms Adjust timeout for script fal No need to press Save Changes LIN BAUD Target Actual 10000 OPTIONS Enable Event Markers Enable event markers Enable Time Markers Enable time stamp to accompany all event markers LIN BAUD Enter desired baud rate here You are limited to a range of 1000 to 20000 SCRIPT TIMEOUT When transmitting frames the software will wait a maximum of Script Timeout ms to receive a script complete tag before issuing an error If your LIN hardware is slow to respond you may need to increase the Script
62. 8 1 displays a minimum choice of configurations commands In the Advanced View Figure 8 2 displays an extended choice of configuration commands Save the configuration by clicking on the Save Changes button FIGURE 8 1 USART ASYNCHRONOUS CONFIGURE COMMUNICATIONS MODE BASIC VIEW Configure Communications Mode Options Save Changes v Enable Event Markers L Enable Time Markers Script Timeout Voltage PICkit Serial will 3000 lt ms power my device 5 Volt Adjust timeout for script C Other No need to press a Save Changes 5 0v USART BAUD Target Actual 1220 OPTIONS Enable Event Markers Enable event markers Enable Time Markers Enable time stamp to accompany all event markers VOLTAGE PICkit Serial will power my device Select the check box if the PICkit Serial will power the target device The target can be powered at 5 VDC or a user selectable variable voltage Even though the voltage can be set as low 0 VDC it is up to the user to verify the required operating voltage of the target device DS51647B page 64 2007 Microchip Technology Inc USART Asynchronous Communications The USB port current limit is set to 100 mA If the target plus Serial Analyzer exceeds this current limit the USB port will turn off The target may be powered externally if more power is req
63. 9230 8 0 16 28800 173 28735 6 0 22 57600 86 57471 3 0 22 115200 42 116279 1 0 94 DS51647B page 116 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware TABLE 11 41 USART STATUS BLOCK Byte Bit Description COMM USART 12 7 0 Bit flags error status 0 FERR framing error 1 OERR overrun error 2 INIT error bad mode 3 n a 4 n a 5 n a 6 n a 7 Composite error 13 7 0 14 7 0 0 17 clock polarity dflt 1 hi lo at start bit cell 07 lo hi USART SM only ignored otherwise 1 1 2 1 Async receive disabled USART A only ignored otherwise 3 n a 4 n a 5 n a 6 n a 7 15 7 0 16 7 0 0 AUX1 state 0 1 1 AUX2 state 0 1 2 AUX1 direction 1 IN O OUT 3 AUX2 direction 1 IN O OUT 4 n a 5 n a 6 n a 7 n a 17 7 0 18 7 0 BAUD default LSB 19 7 0 BRG BAUD default MSB I 2007 Microchip Technology Inc DS51647B page 117 PICkit Serial Analyzer User s Guide DS51647B page 118 TABLE 11 42 USART CMD TAG BYTES Be LEN Name Description 0x80 1 USART_INIT Initialize USART controller 0 TAG 0x82 N 2 USART DATA Transmit data 0 1 Byte count
64. AUX2 WAIT 1 wait AUX2 1 0 TABLE 11 43 USART DATA BYTES res LEN Name Description 0 80 2 USART_EVENT_BYTE_TX BYTE transmit 0 TAG 1 data 0 81 2 USART_EVENT_BYTE_RX BYTE received 0 TAG 1 data 0x82 2 USART EVENT STATUS ERR Status error 0 TAG 1 Jerror byte 0x83 1 USART EVENT BREAK TX BREAK transmitted 0 TAG 11 10 LIN COMMUNICATIONS 11 10 1 Introduction The PKSA LIN support is confined to MASTER and MONITOR functionality As a MASTER the PKSA accepts instruction from the HOST in the form of script TAG s Execution of the script results in the PKSA transmitting on the LIN bus as a MASTER In practice the transmission would constitute a LIN frame header or an entire LIN frame i e message As a LIN bus MONITOR the PKSA can detect and report all events transactions on the bus generated by other devices on the bus or generated by the PKSA MASTER module The event marker TAG s are used to report bus activity in its variety of forms but must be enabled individually using CONTROL BLOCK configuration bits as seen below I 2007 Microchip Technology Inc DS51647B page 119 PICkit Serial Analyzer User s Guide 11 10 2 Configuration Status 11 10 2 1 CONTROL_BLOCK TABLE 11 44 BYTE BIT DESCRIPTION COMM LIN 16 7 0 bit flags 0 1 1 1 2 1 3 1 set LI
65. Analyzer Slave Address Mode Slave 0 Run Profile from PC Interactive Address Run Profile from PKSA Auto CREATING A PROFILE Create a profile by filling in Inputs for each register Active Allows you to activate or deactivate a register This must be active before you can fill in the rest of the data The purpose of this checkbox is to allow run time activation or deactivation of a register Comm Flashes when the register is activated read from or written to Slave Address Hex representation of the register s slave address Register Name Enter a register name This is for reference only and does not affect operation Word Address Hex representation of the word address of the register will be forced to zero if Memory Block is selected Enable Read Determines whether or not the register is read accessible Enable Write Determines whether not the register is write accessible DS51647B page 42 2007 Microchip Technology Inc CT Slave Communications Memory Block Check if the register is to be treated as a contiguous block of memory such as an EE array Data Size Number of bytes in the register If the register is not a Memory Block this many bytes will be returned when the register is read If the register is a Memory Block the profile generator will return one byte at a time until it is Nacked Data S
66. Asummary of the iterations is displayed in the left column The macro is executed when the Iteration button is clicked FIGURE 4 11 CM SCRIPT EXECUTE EXAMPLE Script Execute 12CM Scripts Assignable Buttons Read_Memory Read Memory 2 Iterations 2 Unassigned Unassigned Delay ms 100 Unassigned Execute script Read Memory 2 limes once every Unassigned 00 ms Unassigned Unassigned Unassigned Unassigned Unassigned Show Sent Script in Transaction Window Gm i 1 DS51647B page 36 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 5 IC Slave Communications 5 1 INTRODUCTION This chapter describes DC Slave Communications The 2 Slave mode allows you to mimic 12 slave by responding to standard Read Write and Receive commands You can mimic an 2 slave device from either the Serial Analyzer PC interface Interactive mode or from the PICkit Serial Analyzer itself Auto mode Additionally you can run the Interactive mode from either the Basic Communications page or from the 12 Slave Profile page It is assumed that the user is familiar with the 12 protocol For more information see The Specification Version 2 1 January 2000 is available from NXP Semiconductor formerly Philips Semiconductor web site at http www nxp com acrobat download literature 9398 39340011 pdf
67. BAUD rate is configured by a 2 byte code as detailed in the table s below Upon initialization the PKSA is configured with the default BAUD specified in the CONTROL BLOCK bytes 22 amp 23 as documented in the table above Additionally the BAUD rate can be changed in the context of script execution real time using the appropriate script SCMND At all times the STATUS BLOCK reflects the currently active BAUD rate This BAUD rate applies to all data transmitted by the PKSA AUTOBAUD The PKSA LIN monitor function has the flexibility to auto baud detect and modify the PKSA hardware configuration to receive messages from the LIN bus at the BAUD rate being transmitted This flexibility must be enabled using the configuration bit in the CONTROL BLOCK byte 16 bit 7 The HOST can be apprised of the auto baud detect action through an event marker TAG The AUTOBAUD operation depends on receiving a BREAK 13 bits of Os followed by a SYNC byte 0x55 Referring to the timing diagram below the BREAK begins at A At B the PKSA expected a STOP bit USART interrupts the PKSA receive interrupt flag and sets FERR framing error The PKSA interprets 1 DATA 0 and 2 FERR framing error as having received a BREAK therefore the FERR is automati 2007 Microchip Technology Inc DS51647B page 123 PICkit Serial Analyzer User s Guide cally reset and not reported to the host If
68. Ds should be seen to increment once per second in a binary progres sion 0x0 OxF three times then 0x0 0xB once as the RTC SECONDS value increments from 0x00 to 0x3B 59 decimal The firmware must be forced from this mode by command or Reset B 7 5 Communications Connector Display This feature displays the state of the 4 signal pins on the communications connector LED1 PIN 1 AUX1 LED2 PIN 4 SDA LED3 PIN 5 SCL LED4 PIN 6 AUX2 Normally LED2 and LED3 should be illuminated if the 12 bus has active pull ups and the SCK is not held low The firmware must be forced from this mode by command or Reset B 7 6 RESET Display The RESET Display is executed on Reset power up or by command The sequence is a series of individual displays as follows 1 PING PONG display cycles 2 i e LED1 2 3 4 3 2 1 2 3 4 3 2 1 2 Blink all LEDs in unison cycles 1 i e 1 sec OFF 1 sec ON 1 sec OFF 3 ADC display described above cycles perpetual B 7 7 1 Second Blink Blink all LEDs in unison at 1 second intervals i e 1 sec OFF 1 sec ON 1 sec OFF This feature uses time based on the Timer1 low power oscillator and external 32 kHz tuning fork crystal 2007 Microchip Technology Inc DS51647B page 141 PICkit Serial Analyzer User s Guide DS51647B page 142 2007 Microchip Technology Inc MICROCHIP WORLDWIDE SALES AND SERVICE AMERICAS Corporate Office 2355 West Chandler Blvd Chandler AZ 85224 6199
69. E B 6 PING PONG LED PATTERN DS1 DS2 DS3 DS3 On Off Off Off Off On Off Off Off Off On Off Off Off Off On Off Off On Off Off On Off Off On Off Off Off B 7 2 Timer1 Test Timer1 Test provides a basic test of the auxiliary clock used for the RTC The 28 Pin Demo Board employs a 32 kHz crystal on TIMER1 LP Oscillator to provide a 1 second interval for the RTC emulated device The test begins by clearing the one second flag then waits a maximum of 1 1 seconds to see if the flag is reset Alternatively the HOST can test the RTC clock by examining EXEC REGISTER 0x02 at logically timed intervals FIGURE 7 TIMER1 TEST Write 0x81 to EXEC_REG_00 EXEC REG O3 bit 7 YES EXEC REG O3 bit 6 p pee DS51647B page 140 2007 Microchip Technology Inc 28 Pin Demo Board 12 7 Demonstration Firmware B 7 3 ADC Display The ADC Display begins by displaying hex values OKOA OxOD and in sequence to signify ADC test After the opening display sequence the LEDs displays the Most Significant 4 bits of the ADC result measuring channel ANO potentiometer RP1 As RP1 is manually turned from one extreme to the other the LED display should range from binary 0000 to1111 The firmware must be forced from this mode by command or Reset B 7 4 RTC Display The RTC Display displays the Least Significant 4 bits of EXEC_REG_02 RTC SEC ONDS The LE
70. E CLOCK RTC WORD ADDRESSES REG NAME DESCRIPTION 0x00 RTC CONFIG 1 7 0 6 0 5 STOP stop time function 0 RUN 1 STOP 4 0 3 0 2 0 1 0 0 0 0x01 RTC_CONFIG_2 7 0 6 0 5 0 4 0 3 AF Alarm flag 2 0 1 Alarm enable 0 0 0x02 RTC_SECONDS 00 59 seconds coding BCD bit 7 VL 0x03 RTC_MINUTES 00 59 minutes coding BCD 0x04 RTC HOURS 00 23 hours coding BCD 0x05 RTC WEEKDAY 00 06 weekday 0x06 RTC_DAYS 01 31 day of the month 0x07 RTC MONTHS 01 12 month of the year coding BCD 2007 Microchip Technology Inc DS51647B page 137 PICkit Serial Analyzer User s Guide TABLE B 3 REAL TIME CLOCK RTC WORD ADDRESSES CONTINUED 0x08 RTC_YEARS 00 99 year coding BCD 0x09 RTC ALARM MIN 00 59 minute of alarm coding BCD bit 7 enable OKOA RTC ALARM HOUR 00 23 hour of alarm coding BCD bit 7 enable Ox0B RTC ALARM DAY 01 31 day of alarm coding BCD bit 7 enable Ox0C ALARM WEEK 00 06 weekday of alarm bit 7 enable OxOD not assigned OxOE not assigned OxOF not assigned B 6 2 Slave Address 0xA8 EEProm Emulation The 28 Pin Demo Board CT Demonstration emulates a serial EEPROM Device emulation provides for 256 bytes A newly programmed 28 Pin Demo Board defaults the first 8 bytes to 0x00 to 0x07 sequentially The value of the remaining bytes is undefined unknown A Read operation is
71. END TABLE TAG END 0x80 1 0 51647 106 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware EXAMPLE The following SLAVE PROFILE defines 2 slave addresses 2 registers for 1 and 1 register block for the other TABLE 11 26 TABLE TAG SLAVE ADDR 0x20 DATA SLAVE ADDR 0x16 DATA RESERVED 0x00 DATA RESERVED 0x00 l DATA TABLE TAG REGISTER DEF 0x41 DATA REGISTER 0x21 DATA BYTE COUNT 0x02 DATA 0x34 DATA 0x12 DATA TABLE TAG REGISTER DEF 0x40 DATA REGISTER 0x22 DATA BYTE COUNT 0x01 DATA 0x56 TABLE TAG SLAVE ADDR 0X20 DATA SLAVE ADDR 0x18 DATA RESERVED 0x00 l DATA RESERVED 0x00 DATA TABLE TAG REGISTER DEF 0x48 DATA REGISTER ID 0x00 DATA BYTE COUNT 0x04 DATA 0x12 DATA 0x34 DATA 0x56 DATA 0x78 TABLE TAG END 0 80 I 2007 Microchip Technology Inc DS51647B page 107 PICkit Serial Analyzer User s Guide 11 7 2 Configuration Status 11 7 2 1 CONTROL BLOCK TABLE 11 27 BYTE BIT DESCRIPTION COMM 12 5 16 7 0 Mode 0 default 1 interactive 2 automatic register table 17 7 0 bit flags EVENT MARKERS 0 1 event marker enable ADDR RX 1 1 event marker enable DATA RX 2 1 event marker enable DATA TX 3 1 event marker enable ACK RX 4
72. G byte 0x02 writes the 24 byte CONTROL BLOCK the EXEC portion of the control block appears in Table 11 7 TABLE 11 7 EXEC CONTROL BLOCK Byte Bit Description 0 7 0 EXEC control bits 0 1 2 3 4 1 Disable default behavior LED2 5 1 Disable default behavior LED1 6 1 Flush CBUF2 on count e g CBUF2 gt bytes then flush 7 1 Flush CBUF2 on time intervals 1 7 0 0 1 Enable switch test 1 n a 2 n a 3 n a 4 n a 5 n a 6 n a 7 n a 2 7 0 3 7 0 CBUF2 flush count threshold e g CBUF2 gt bytes then flush 4 7 0 CBUF2 flush interval res 409 us min 409 us max 104 msec a value of 0 defaults to 1 i e the minimum 5 7 0 6 7 0 7 7 0 DS51647B page 90 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware TAG bytes 0x03 0x04 and 0x05 write data bytes to their respective script buffers In the current architecture Script Buffer 1 CBUF 1 is used to store communication com mands that will be fetched and executed by the COMM block So TAG byte 0x03 is used to delineate data that is to be sent to the script buffer including communication protocols to be sent to the unit under test TAG bytes 0x04 and 0x05 are typically not used TAG bytes 0x06 and 0x07 configure the LEDs as follows TABLE 11 8 LED CONFIGURATION Description Mode State Time CFG 7 6 CFG 5
73. I Input Data Input x x x x x x Send One Character at a time gt Execute ES Clear X Clear 9 7 SCRIPT BUILDER USART Asynchronous commands can be combined into scripts saved and used over again The Script Builder window is opened by selecting Communications gt Script gt Script Builder from the menu bar The Script Builder is shown in Figure 9 4 The Script Builder window is divided into four columns as shown in Figures 9 5 through 9 8 DS51647B page 76 2007 Microchip Technology Inc USART Master Synchronous Communications FIGURE 9 4 USART SYNCHRONOUS MASTER SCRIPT BUILDER Script Builder Ex USART Scripts Script Detail User USART Scripts Script Name Dutput2Bytes Save Script gt Execute Script X Clear Script Del User Scripts 3 Show Array 9 7 1 Script Commands The left most column contains the Script Commands as shown in Figure 9 5 Script Name Enter the name of the script Save Script Saves the script Execute Script Executes performs the script displayed in the Script Detail column Clear Script Clears the Script Detail column Del User Scripts Deletes scripts from the User Scripts column Show Array Displays a spreadsheet like table in which large amounts of data may be entered This data can be included in the script by right clicking in a Sc
74. ICkit Serial will power the target device The target can be powered at 5 VDC or a user selectable variable voltage Even though the voltage can be set as low as 0 VDC it is up to the user to verify the required operating voltage of the target device CAUTION The USB port current limit is set to 100 mA If the target plus PICkit Serial Analyzer exceeds this current limit the USB port will turn off The target may be powered externally if more power is required DS51647B page 50 2007 Microchip Technology Inc SPI and Microwire Master Communications SPI BIT RATE Select the desired SPI bit rate by selecting the radio button for the desired range and then selecting the bit rate using the slider FIGURE 7 2 SPI CONFIGURE COMMUNICATIONS MODE ADVANCED VIEW Configure Communications Mode SPI Master Options Event Markers Advanced Options Save Changes Enable Event Markers LI Abrt Mac Exe Disable LED2 Default Enable Tine Marker L Macro Loop Disable LED1 Default Mac Lp 65536 Enable Switch Test Mac Lp Done Sample Phase Script Timeout Voltage Timeout Timerl Clock Edge Select ai PICkit will Timeout Timer2 Clock Polarity 3000 ies Status Error Auto Output Disable Read Byte Chip Select Polarity Adjust timeout for script TT fail No need to press W
75. Inc ANS PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Table of Contents Chapter 1 PICkit Serial Analyzer Overview MEM e 5 1 2 0 us Nai 5 1 3 PICkit Serial Analyzer Contents 5 1 4 Serial Analyzer Development System 5 1 5 PICkit Serial Analyzer Hardware 2 6 1 6 Serial Analyzer Software 8 Chapter 2 Getting Started zs EE e an 9 2 2 P ghliglils 9 2 3 Installing the PICkit V Serial Analyzer Software 9 2 4 Connecting the PICkit Serial Analyzer to the PC 9 2 5 Connecting the PICkit Serial Analyzer to the 28 Pin Demo Board 10 2 6 Starting the PICkit Serial Analyzer Program 10 2 7 Running the 28 Pin Demo 2 1 Demonstration Program 11 2 8 12 Communications Basic Operations lt lt lt lt 14 2 9 28 Demo IC Source Code and Firmware 15 Chapter 3 PICkit Serial Analyzer PC Program S21 IBIOGOUCHOLD oh t aee EROR S eS aca pea cde CO S Ga RP ERE ARE 17 2 25 ein ele 17 3 3 Installing the Serial Analyzer Software 17 3 4 Starting the PIOgr etti ui
76. N adapter chip select line HI 4 1 5 1 6 1 receive enable 7 1 enable auto baud detect set 17 7 0 bit flags 0 1 event marker enable data RX 1 1 event marker enable data TX 2 1 event marker enable break TX 3 1 event marker enable break RX 4 1 event marker enable auto baud 5 n a 6 7 1 event marker enable status error 18 7 0 19 7 0 20 7 0 21 7 0 22 7 0 BAUD rate code default LSB 23 7 0 BAUD rate BRG code default MSB DS51647B page 120 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware 11 10 2 2 STATUS BLOCK TABLE 11 45 BYTE BIT DESCRIPTION COMM LIN 12 7 0 bit flags error 0 FERR framing error 1 OERR overrun error 2 FAULT from LIN bus adapter 3 AUTOBAUD detect error e g overflow 4 n a 5 n a 6 INIT error 7 composite error 13 7 0 bit flags status 0 PIN state FAULT 1 PIN state CS 2 AUTOBAUD detect in progress 3 n a 4 n a 5 n a 6 n a 7 n a 14 7 0 n a 15 7 0 n a 16 7 0 n a 17 7 0 n a 18 7 0 currently active BAUD rate BRG code LSB 19 7 0 currently active BAUD rate BRG code MSB 11 10 2 3 CONFIGURATION CONSIDERATIONS The PKSA can be configured to operate as LIN bus MASTER MONITOR or both MASTER To configure the PKSA to perform as LIN bus MASTER the HOST must write the CONTROL BLOCK to
77. OMMAND Executive command 0 TAG 1 Command byte see Table 11 5 0x02 25 CONTROL BLOCK WRITE Write control block to PIC MCU 0 TAG 1 24 Control block 0x03 N 2 CBUF1 WRITE Write data to circular buffer 1 0 TAG 1 Byte count N 2 N 1 Data 0x04 N 2 CBUF2_WRITE Write data to circular buffer 2 0 TAG 1 Byte count N 2 N 1 Data 0x05 N 2 CBUF3 WRITE Write data to circular buffer 3 0 TAG 1 Byte count N 2 N 1 Data 0x06 2 LED1_CONFIG Configure LED 1 0 TAG 1 Configuration Byte 0x07 2 LED2_CONFIG Configure LED 2 0 TAG 1 Configuration byte TAG byte 0x01 signifies that the following byte is one of the commands listed in Table 11 5 I 2007 Microchip Technology Inc DS51647B page 89 PICkit Serial Analyzer User s Guide TABLE 11 5 TAG BYTE 0x01 COMMAND CODES CMD Description 0x00 Master Reset EXEC Reset COMM Reset idled 0x01 COMM initialization COMM is initialized as defined by CONTROL BLOCK 0x02 Request EXEC STATUS PACKET Ref Table 11 6 0x03 Save CONTROL BLOCK to EEPROM 0x04 Restore CONTROL BLOCK from EEPROM 0x05 Flush CBUF2 0x06 COMM Reset rest buffers clear status block COMM hardware is not re initialized TABLE 11 6 EXEC STATUS PACKET Byte LEN Type Description 0 1 2 0x88 PACKET ID 0x01 2 4 3 0x81 FIRMWARE VERSION 5 29 25 0x82 CONTROL BLOCK 30 50 21 0x83 STATUS BLOCK 51 57 7 0x84 CBUF STATUS TA
78. PICkit Serial Analyzer User s Guide Menu Bar Select P Ckit Serial Analyzer gt Select Communications Mode gt SPI Master 7 5 CONFIGURATING SPI COMMUNICATIONS MODE Once the communications mode has been selected it is configured from the Configu ration Wizard or menu bar Configuration Wizard Select P Ckit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select Serial Analyzer gt Configure Communications Mode The Configure Mode window will open Depending on the View selected the Basic View Figure 7 1 displays a minimum choice of configurations commands In the Advanced View Figure 7 2 displays an extended choice of configuration commands Save the configuration by clicking on the Save Changes button FIGURE 7 1 SPI CONFIGURE COMMUNICATIONS MODE BASIC VIEW Configure Communications Mode Options Save Changes Enable E vent Markers L Enable Time Markers Script Timeout Voltage 71 HCH Serial will 3000 ms power my device Adjust timeout for script fail No need to press Save Changes 5 0 SPI Bit Rate 1 25MHz 9 77kHz 625kHz 2 44kHz 15625kHz 0 61kHz 8 77Khz OPTIONS Enable Event Markers Enable event markers Enable Time Markers Enable time stamp to accompany all event markers VOLTAGE Serial will power my device Select the check box if the P
79. RODUCTION This chapter describes the USART Synchronous Master Communications mode USART Synchronous Master data and commands can be entered using a Basic Communications window or by creating Script Commands It is assumed that the user is familiar with the USART Synchronous protocol For more information see USART AUSART or EUSART chapter of the PIC microcontroller data sheet of interest 9 2 HIGHLIGHTS This chapter discusses e Serial Pin Assignments Selecting Communications Mode Configuring USART Synchronous Master Communications Mode Communications Basic Operations Script Builder Script Execute 9 3 PICkit SERIAL PIN ASSIGNMENTS The Serial Analyzer pin assignments for USART Synchronous Master Communications mode are TABLE 9 1 USART SYNCHRONOUS MASTER PIN ASSIGNMENTS Pin Label Type Description 1 CK Output Clock 2 V Power Target Power 3 GND Power Ground 4 AUX1 Input Output Auxiliary UO port pin No 1 5 AUX2 Input Output Auxiliary I O port No 2 6 DT Input Output Data 9 4 SELECTING COMMUNICATIONS MODE The USART Synchronous Master Communications mode is selected from the Config uration Wizard or menu bar Configuration Wizard Select PICkit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select P Ckit Serial Analyzer gt Select Communications Mode gt USART Synchronous Master 20
80. Tel 480 792 7200 Fax 480 792 7277 Technical Support http support microchip com Web Address www microchip com Atlanta Duluth GA Tel 678 957 9614 Fax 678 957 1455 Boston Westborough MA Tel 774 760 0087 Fax 774 760 0088 Chicago Itasca IL Tel 630 285 0071 Fax 630 285 0075 Dallas Addison TX Tel 972 818 7423 Fax 972 818 2924 Detroit Farmington Hills MI Tel 248 538 2250 Fax 248 538 2260 Kokomo Kokomo IN Tel 765 864 8360 Fax 765 864 8387 Los Angeles Mission Viejo CA Tel 949 462 9523 Fax 949 462 9608 Santa Clara Santa Clara CA Tel 408 961 6444 Fax 408 961 6445 Toronto Mississauga Ontario Canada Tel 905 673 0699 Fax 905 673 6509 ASIA PACIFIC Asia Pacific Office Suites 3707 14 37th Floor Tower 6 The Gateway Habour City Kowloon Hong Kong Tel 852 2401 1200 Fax 852 2401 3431 Australia Sydney Tel 61 2 9868 6733 Fax 61 2 9868 6755 China Beijing Tel 86 10 8528 2100 Fax 86 10 8528 2104 China Chengdu Tel 86 28 8665 5511 Fax 86 28 8665 7889 China Fuzhou Tel 86 591 8750 3506 Fax 86 591 8750 3521 China Hong Kong SAR Tel 852 2401 1200 Fax 852 2401 3431 China Qingdao Tel 86 532 8502 7355 Fax 86 532 8502 7205 China Shanghai Tel 86 21 5407 5533 Fax 86 21 5407 5066 China Shenyang Tel 86 24 2334 2829 Fax 86 24 2334 2393 China Shenzhen Tel 86 755 8203 2660 Fax 86 755 8203 1760 China Shunde Tel 86 757
81. Template window My Templates Selects and displays template windows created by the user VIEW e Basic The Serial Analyzer program will display basic commands status view Advanced The PICkit Serial Analyzer program will display advanced commands and status view WINDOW New Transaction Window Opens new or additional transaction window Multiple 1 DS51647B page 22 2007 Microchip Technology Inc PICkit Serial Analyzer Program transaction windows can be opened as needed for logging communications Close All Closes all windows e Cascade Cascade windows Tile Horizontally Tile windows horizontally Tile Vertically Tile windows vertically HELP e About Displays program version information Show PICkit Serial Analyzer Connections Displays pinout for current communications mode Show Event Bytes Displays Event Marker code for current communication mode User s Guide Displays the Serial User s Guide 3 6 2 Tool Bar FIGURE 3 9 TOOL BAR Toot Bar Serial 12C Master Mode Communications PICK Serial Analyzer Damo Boards User Defined Templates View Window Bask 9 FlashiED Reset Basic Operations Transactions Fle Eck Clear S Reset Time The Tool Bar gives quick access to often used commands These commands are also available from the Menu Bar View Basic Advanced
82. This includes the MPLAB ICE 2000 and MPLAB ICE 4000 In Circuit Debuggers The latest information on the Microchip in circuit debugger MPLAB ICD 2 MPLAB IDE The latest information on Microchip MPLAB IDE the Windows Integrated Development Environment for development systems tools This list is focused on the MPLAB IDE MPLAB SIM simulator MPLAB IDE Project Manager 2007 Microchip Technology Inc DS51647B page 3 PICkit Serial Analyzer User s Guide and general editing and debugging features Programmers The latest information on Microchip programmers These include the MPLAB PM3 and PRO MATE II device programmers and the PICSTART Plus and PICkit 2 development programmers CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels Distributor or Representative Local Sales Office Field Application Engineer FAE Technical Support Customers should contact their distributor representative or field application engineer FAE for support Local sales offices are also available to help customers A listing of sales offices and locations is included in the back of this document Technical support is available through the web site at http support microchip com DOCUMENT REVISION HISTORY Revision A January 2007 nitial release of this document HEEENNEEE
83. UF3 A event data BC read data 11 7 1 2 1 Operation Execute the following sequence for initialization 1 Issue COLD START Reset 2 Write CONFIGURATION BLOCK with COMM I2CS MODE 1 EVENT MARK ERS enabled 3 Issue WARM START The HOST must monitor 12 transactions via the EVENT MARKERS Should the I C MASTER request read data the PKSA will hold the 2 SCK line low and alert the HOST with SDATA TAG I2CS_DATA_RQ The HOST must supply data to the PKSA to be returned to the 12CS MASTER using SCMND TAG I2CS SEND BYTES If more data is supplied than is required for the transaction the remaining data will be dis carded If an insufficient number of bytes are supplied by the HOST the PKSA will return all data supplied then hold SCK line low and re issue SCMND TAG I2CS_DATA_RQ to the HOST 11 7 1 3 MODE AUTO AUTO is the most sophisticated mode allowing the PKSA to operate autonomously from a slave profile loaded in PKSA RAM CBUF3 The slave profile defines one or more IZC slave addresses and a unique set of device registers for each The device registers can be defined in two ways 1 discrete non contiguous registers of various lengths or 2 a block of contiguous addresses with flexible access to 1 or more bytes within that block in a single transaction Additionally each register can be defined as Read Write Read only or Write only The 2 bytes in the PKSA CONTROL BLOCK ADDRESS and MASK
84. USART Communications core 115 ie Gee ce 119 Chapter 12 PICkit Serial Analyzer DLL InttodicllOD 127 12 2 127 Chapter 13 Troubleshooting Eck IWUOCGHCHORU tne inden ce lad intel ley bod eran hela ARE 129 13 2 Frequently Asked Questions eee tee 129 Appendix A Serial Analyzer Schematics 131 Tote e TR et cec Gas Ca eta Ca Ga b 131 Appendix B 28 Pin Demo Board CT Demonstration Firmware 135 Bo onitodu cuo dudas UC do DON wa 135 B2 USES TT EE 135 Hardware 135 BA ien ems bcp D tls 135 B5 2 Communications cd 136 Bo 137 COEBNOUONS me 140 Worldwide Sales and Service 143 DS51647B page vi 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated and this manual is no exception Microchip tools and documentation are constantly evolving to meet customer needs so some actual dialogs and or tool descriptions may differ from those in this document Please refer to our web site www microchip com to obtain the latest documentation available Documents are identified with a DS number This
85. Window d ag View Advanced 9 FlashLED C Reset Basic 7 Display Template My Templates 4 4Reg TestOne This implementation of the User Defined Template differs from the one in the prior release of PICkit Serial Analyzer in that you create and run the template on the same form This allows for a great deal of run time flexibility For example you can change any of the Inputs from section 10 3 while you are running the scripts a loop 1 2007 Microchip Technology Inc DS51647B page 85 PICkit Serial Analyzer User s Guide 10 5 GRAPHING DATA You may also graph any of the data being displayed in real time simply press the Graph button for the corresponding parameter The graph may be resized as desired See Figure 10 3 The style button on the bottom of the graph toggles the view between an area line column or point plot FIGURE 10 3 GRAPHING DATA PICkit Serial I2C Master Mode Transactions III Name Pen Bye Decimais Value 5_ B8 CC 00 P Lon 0 0 Grapl Source Voltage 4 9 Data Line Voltage 47V Clock Une Voltage 4 7 2 26 51 PM Sent script Regd ei Paremetert 2 10 Farane sl O Pa Ki 5 4 02 16 00 RS w_ o 5 00 00 76 657 54 44 F 2 26 51 PM Sent script Regt ics 5
86. a ame 44 6 2 cato Re te 44 6 3 PICkit Serial Pin Assignments 44 6 4 Selecting Communications Mode 44 6 5 Configuring Lin Slave Communications Mode 45 6 6 Communications Basic Operations 47 SPI and Microwire Master Communications EEN ee 49 Y22 CROIS esse Re tco tia 49 7 3 Serial Analyzer Pin Assignments 49 7 4 Selecting Communications Mode 49 7 5 Configurating SPI Communications Mode 50 7 6 Communications Basic Operations 52 DS51647B page iv 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Table of Contents f SERIES QM ONU DIDI NU E 54 1 0 SOIL EXECUTE rein e EE 59 Chapter 8 USART Asynchronous Communications MUO GUCUOM re 63 8 2 63 8 3 Serial Pin Assignments 63 8 4 Selecting Communications Mode 64 8 5 Configuring USART Asynchronous Communications
87. a 0x85 3 LIN BAUD SET set BAUD rate 0 TAG 1 BAUD code LSB 2 BAUD code MSB Note 1 Data bytes i e frame to be published must include the appropriate CHECKSUM enhanced CHECKSUM if frame is destined for a LIN 2 0 slave The PKSA has no comprehension of data content or format data bytes are simply transmitted verbatim DS51647B page 122 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware 11 10 3 2 TAG SDATA TAG commands and data returned from the PICkit Serial Analyzer TABLE 11 47 TAG SDATA LEN NAME DESCRIPTION 0x80 2 LIN_EVENT_BYTE_RX BYTE received 0 TAG 1 data 0x81 2 LIN EVENT BYTE TX BYTE transmitted 0 TAG 1 data 0x82 2 LIN EVENT STATUS ERR status error 0 TAG 1 error byte 0x83 1 LIN EVENT BREAK RX BREAK received 0 TAG 0x84 1 LIN EVENT BREAK TX BREAK transmitted 0 TAG 0x85 3 LIN EVENT AUTOBAUD AUTOBAUD event 0 TAG BAUD CODE LSB 2 BAUD CODE MSB Those TAGs above identified as EVENT generally mark the occurrence of LIN bus activity As with all other supported PKSA serial protocols the EVENT TAGs are gen erated when as are detected in real time and queued in a circular buffer for transmis sion to the HOST Each TAG can be individually enabled disabled using the appropriate configuration bit in the CONTROL BLOCK 11 10 4 Parameter Detail 11 10 4 1 BAUD The PKSA
88. a user script from the User Scripts column into the Script Detail column the user can double click or right click and select from the local menu Note The x indicates the value is hexadecimal number Clicking on x will toggle it to a d indicating that the value is a decimal number FIGURE 4 7 CT SCRIPT BUILDER SCRIPT DETAIL Script Detail Script Builder Example 120M Script Name ReadAdhAs Wie d du B ReadBlockAddu8 Save Script Receive dk S X Clear Script Del User Scripts 2 Show Array x x xixixix x xix ix x x 4 7 4 User Scripts The fourth column contains User Scripts as shown in Figures 4 8 User scripts that are created named and saved are displayed in the User Scripts column To load a user script from the User Scripts column into the Script Detail column the user can double click or right click and select from the local menu User Scripts can be deleted by right clicking and selecting Delete Script from the local menu FIGURE 4 8 12 SCRIPT BUILDER USER SCRIPTS User Scripts Script Builder Example 120M Scapts Scnpt Name Read dd8 Saas WiteddAs WinteBlockAd amp A8 m ReadBlochAddA8 Lig Save Script Recevetd AS gt Execute Script X Clear Script Del User Scripts I Show Anay 1 2007 Microchip Technology In
89. ag before issuing an error If your I2C hardware is slow to respond or you are transferring a lot of data you may need to increase the Script Timeout to avoid errors EVENT MARKERS Abrt Mac Exe Enable event marker abort macro execution Macro Loop Enable event marker top of macro loop Mac Lp 65536 Enable event marker macro loop count overflow i e 65536 Mac Lp Done Enable event marker macro loop iterations complete Timeout Timer1 Enable event marker Timer1 expired Timeout Timer2 Enable event marker Timer2 expired Status Error Enable event marker change in status byte Start Bit Enable event marker Start bit Stop Bit Enable event marker Stop bit Restart Bit Enable event marker Restart bit Ack Nack TX Enable event marker Ack byte transmit Ack Nack RX Enable event marker Ack or Nack byte received Write Byte Enable event marker write byte Read Byte Enable event marker read byte TX Error Enable event marker TX error Status Error Enable event marker change in 12 status byte ADVANCED OPTIONS Disable LED2 Default Disable default LED2 behavior LED2 Yellow Target LED Disable LED1 Default Disable default LED1 behavior LED1 Red Busy LED Enable Switch Test Enable low level switch test 1 2007 Microchip Technology Inc DS51647B page 29 PICkit Seria
90. age Mac Lp Done Serial will Timeout Timerl Timeout Timer2 2000 5 m power my device 5 Volt Status Error 72 Addr RX Adjust timeout for script Other fail No need to press Data Rx Save Changes Data TX Ack Rx Nack RX Default Mode Read Data Reg Read Byte 0 0 Reg write Bytes 1 N 0 Status Error Stop Data RQ 5 0 12 Slave Mode Default Interactive Automatic SITTI Slave Address Mask o Enable All Yi I2CS Options AddrMask 1 EVENT MARKERS Abrt Mac Exe Enable event marker abort macro execution Macro Loop Enable event marker top of macro loop Mac Lp 65536 Enable event marker macro loop count overflow i e 65536 Mac Lp Done Enable event marker macro loop iterations complete Timeout Timer1 Enable event marker Timer1 expired Timeout Timer2 Enable event marker Timer2 expired Status Error Enable event marker change in status byte Addr RX Enable event marker Slave address received Data Enable event marker Data received Data TX Enable event marker Data transmitted Ack RX Enable event marker Ack byte received 2007 Microchip Technology Inc DS51647B page 39 PICkit Serial Analyzer User s Guide RX Enable event marker Nack byte received Reg Read Enable event marker Register Read Reg Write Enable even
91. al Cmds USART Init Data Trasmit Set BAUD Rate AUX Data Receive Reset Clock Polarity Set Clock Polarity TABLE 9 2 USART SCRIPT MACRO COMMANDS Macro Command d Description USDATATX TX Transmit data Next byte is the byte count followed by the data USDATARX RX Receive data Next byte is the byte count USDATARXEN ER Enable Receive data monitor USDATARXDS DR Disable Receive data monitor USBREAKTX BK Send Break USBRKDATTX BKD Send Break then data byte Next byte is the data byte USBAUD BD Set BAUD Rate Next byte is BAUD LSB followed by BAUD MSB US9BITSET 9 Set 9 bit Data mode US9BITRST 9R Reset 9 bit Data mode sets 8 bit USCLKPOLSET CS Set CLOCK POLARITY bit USCLKPOLRST CR Reset CLOCK POLARITY bit DS51647B page 80 2007 Microchip Technology Inc USART Master Synchronous Communications TABLE 9 2 USART SCRIPT MACRO COMMANDS CONTINUED USINIT 1 Initialize USART controller USRESET RE Reset USART controller USAUX1RST A1RST Reset Aux1 USAUX1SET A1RST Set Aux1 USAUX1OUT A1OUT Set Aux1 direction to Output USAUXAIN A1IN Set Aux1 direction to Input USAUX1WO A1W0 Aux1 Wait 0 USAUX1W1 A1W1 Aux1 Wait 1 USAUX2RST A2RST Reset Aux2 USAUX2SET A2RST Set Aux2 USAUX2OUT A2OUT Set Aux2 direction to Output USAUX2IN A2IN Set Aux2 direction to Input USAUX2WO A2W0
92. alyzer User s Guide FIGURE 2 3 28 PIN DEMO RTC Real Time Clock EEPROM ADC Update RTC Set RTC To July 2007 System Time Sun Mon Tue Wed Thu Fri Sat 1 5 6 7 8 9 10 11 12 13 14 15 16 17 18 18 20 21 22 23 24 25 26 27 28 29 30 31 4 43 03 PM 2 7 2 Serial EEPROM EEPROM Clicking on the EEPROM tab will display the 256 byte array of EEPROM memory as shown in Figure 2 4 The 28 Pin Demo Board has been programmed to emulate a stand alone serial 2 EEPROM device such as 241 02 The 12 commands very similar to the commands used in these devices The Serial EEPROM tab displays the contents of a serial EEPROM implemented on the 28 Pin Demo Board When this tab is first displayed the values are grayed out This means that the display does not match the contents of the emulated serial EEPROM Click on Read EE button and the program will read and display the contents of the 28 Pin Demo Board Notice that the displayed values are now black Individual memory locations can be changed by clicking on the value and typing in a new value in hexadecimal Notice that the changed values will be displayed in red This means the value has changed but has not been written to the emulated serial EEPROM Click on the Write EE button and the values will be written The color of the value will turn to black indicating that the value has been written and the display matches the contents of the emula
93. ameter This must be active before you can fill in the rest of the data The purpose of this checkbox is to allow run time activation or deactivation of a script Run Press this button to run your script and display data after you have completed filling out the parameter template line Script Select a user defined script from the drop down box This script must first be created using the Script Builder for the respective communications mode Return Data Indicate if data is received Yes or not No Parameter Name Enter a parameter name This is for reference only and does not affect the data retrieved or displayed Parameter Byte Count The number of bytes read 1 2 or 4 Start Byte Select which byte of a possible series of bytes that will be used for the display Byte Order Select Least Significant to Most Significant or Most Significant to Least Significant If the parameter is only one byte long this option will not be available Slope Conversion value read value slope offset displayed value Offset Offset of read value read value slope offset displayed value Signed Unsigned Select between Signed or Unsigned read value this option is only available if the format is set to Dec Format Binary Decimal Hexadecimal or BCD Binary Coded Decimal of Dec pts Select number of decimal points in the displayed value this option is only available if the format is set to Dec
94. are brackets Optional arguments 18 options file options Curly brackets and pipe character Choice of mutually exclusive arguments an OR selection errorlevel 0 1 Ellipses Replaces repeated text var_name Represents code supplied by user var_name void main void DS51647B page 2 2007 Microchip Technology Inc Preface WARRANTY REGISTRATION Please complete the enclosed Warranty Registration Card and mail it promptly Sending in the Warranty Registration Card entitles users to receive new product updates Interim software releases are available at the Microchip web site RECOMMENDED READING This user s guide describes how to use the PICkit Serial Analyzer Other useful documents are listed below The following Microchip documents are available and recommended as supplemental reference resources Readme Files For the latest information on using other tools read the tool specific Readme files in the Readmes subdirectory of the MPLAB IDE installation directory The Readme files contain update information and known issues that may not be included in this user s guide THE MICROCHIP WEB SITE Microchip provides online support via our web site at www microchip com This web site is used as a means to make files and information easily available to customers Accessible by using your favorite Internet browser the web site contains the
95. ay Read Bytes Read Block Bi Rate Read Bytes Read Block NLB AL TABLE 4 2 CT SCRIPT MACRO COMMAND Macro Command 4 Description 2 lJ CM Initialization I2CSTART S 1 IC Start I2CSTOP P_ 2 Stop I2CRESTART RS PCT Restart I2CWRTBYT IW 1 PCM Write Bytes Next byte is the byte count followed by the data I2CRDBYT 1 IC Read Bytes Next byte is the byte count 1 DS51647B page 34 2007 Microchip Technology Inc CT Master Communications TABLE 4 2 CT SCRIPT MACRO COMMAND CONTINUED I2CRDBLK RB CM Read Block I2CBITRATE BR 5 12 7 Bit Rate min 0 35k max 127 100k Next byte is the bit rate I2CRESET RE Reset MSSP module I2CRDBYTNLB RN Read bytes NACK last byte Next byte is the byte count I2CRDBLKNLB RBN Read block NACK last byte I2CAUX1RST A1RST Reset AUX1 2 15 A1RST Set AUX1 I2CAUX1OUT A1OUT Set AUX1 direction to Output I2CAUX1 IN A1IN Set AUX1 direction to Input I2CAUX1WO A1W0 AUX1 Wait 0 I2CAUX1W1 A1W1 AUX1 Wait 1 I2CAUX2RST A2RST Reset AUX2 I2CAUX2SET A2RST Set AUX2 2 2 A2OUT Set AUX2 direction to Output 2 2 A2IN Set AUX2 direction to Input I2CAUX2WO A2W0 AUX2 Wait O I2CAUX2W1 A2W1 AUX2 Wait 1 48 SCRIPT EXECUTE The Script Execute window is shown in Fi
96. be externally powered if more power is needed Microsoft Windows 98 SE Question After plugging the PICkit Serial Analyzer into the USB port Windows 98 SE asks for a driver Where is the driver Answer PICkit Serial Analyzer uses the Human Interface Device HID driver included with the Windows Operating System When Windows 98 SE prompts for a driver select Search for the best driver for your device Then select the check box next to Microsoft Windows Update and click Next Windows will automatically install the appropriate driver Do not use Microchip s MPLAB ICD 2 USB driver 2007 Microchip Technology Inc DS51647B page 129 PICkit Serial Analyzer User s Guide Microsoft Windows 95 98 NT Question Can I run on Windows 95 98 NT Answer No These operating systems either do not support USB or have drivers that are not compatible DS51647B page 130 2007 Microchip Technology Inc PICkit SERIAL ANALYZER USER S GUIDE kit Serial Analyzer Schematics This appendix contains the PICkit Serial Management hardware diagrams PICkit SERIAL ANAYLZER SCHEMATIC SHEET 1 OF 2 Appendix A PIC INTRODUCTION MICROCHIP A 1 005 8r DOS 10 X3 23 vo 10 48 E DEG EEN D Es 2 GE dA 0 528 T ES SEH AST zk HERR Eu amor 52 LOL PPA 22 24 92 30n 2499 1S011 194
97. c DS51647B page 33 PICkit Serial Analyzer User s Guide 4 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 Figures 4 9 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 Figures 4 9 Macro commands are entered according to the sequence of events as defined by the 2 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 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 A complete listing of the available macro commands is given in Table 4 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 4 9 CT SCRIPT BUILDER CREATING A SCRIPT Script Builder Example I2CM Scripts Scnpt Name Sa delete Insert Blank DT eae a idtm jg nm m3 mil X Clear Script I2CM Del User Scripts 3 Show An
98. ck and select from the local menu Note The indicates the value is a hexadecimal number Clicking on x will toggle it to a d indicating that the value is a decimal number DS51647B page 78 2007 Microchip Technology Inc USART Master Synchronous Communications FIGURE 9 7 USART SYNCHRONOUS MASTER SCRIPT BUILDER SCRIPT DETAIL Script Detail Script Builder USART Scripts User USART Scripts Script Name Dutput2Bytes X Clear Script Del User Scripts 1 Show Array 9 7 4 User Scripts The fourth column contains User Scripts Detail as shown in Figure 9 8 User scripts that are created named and saved are displayed in the User Scripts column To load a user script from the User Scripts column into the Script Detail column the user can double click or right click and select from the local menu User Scripts can be deleted by right clicking and selecting Delete Script from the local menu FIGURE 9 8 USART SYNCHRONOUS MASTER SCRIPT BUILDER USER SCRIPTS User Scripts Script Builder Ex USART Scripts Script Detail ser USART Scripts Script Name Output2Bytes Save Script gt Execute Script X Clear Script Del User Scripts 1 Show Array 9 7 5 Creating Script Scripts are created by placing the cursor into the Script Detail column and right clicking A local menu will be di
99. click or right click and select from the local menu FIGURE 8 6 USART ASYNCHRONOUS SCRIPT BUILDER EXAMPLE SCRIPTS Example Scripts Script Builder x USART Scripts Script Detail User USART Scripts Script Name Output2Bytes lg Save Script gt Execute Script X Clear Script Del User Scripts 1 Show Array 8 7 3 Script Detail The third column contains Script Detail as shown in Figure 8 7 This column is used to create the script or view an existing script More information about creating a customer script is discussed in Section 8 7 5 Creating A Script To load a user script from the User Scripts column into the Script Detail column the user can double click or right click and select from the local menu Note The x indicates the value is a hexidecimal number Clicking on x will toggle it to a d indicating that the value is a decimal number DS51647B page 68 2007 Microchip Technology Inc USART Asynchronous Communications FIGURE 8 7 USART ASYNCHRONOUS SCRIPT BUILDER SCRIPT DETAIL Script Detail Script Builder Ex USART Scripts Script Name Dutput2Bytes X Clear Script Del User Scripts 1 Show Array 8 7 4 User Scripts The fourth column contains User Scripts as shown in Figure 8 8 User scripts that are created named and saved are displayed in the User Scripts column To
100. d perform a power on routine LEDs will flash in sequence DS1 DS2 DS3 DS4 DS3 DS2 and DS1 twice All LEDs will turn off All LEDs will turn on All LEDs will turn off LEDs will display in hexadecimal D LEDs will display the top 4 bits of the ADC value read from potentiometer RP1 FIGURE 2 1 CONNECTING PICkit SERIAL TO THE 28 PIN DEMO BOARD 2 6 STARTING THE PICkit SERIAL ANALYZER PROGRAM You can start the program by Clicking on the desktop icon or Navigating to Start gt All Programs gt Microchip gt PICkit Serial Analyzer After a few moments the program will start and display the main window as shown in Figure 2 2 If this is the first time you are running the program the Configuration Wizard will auto matically run Click on the Next button and accept the default settings for EC Master mode For more information about using the 12C Master mode see Chapter 4 2 Master Communications DS51647B page 10 2007 Microchip Technology Inc Getting Started FIGURE 2 2 PICkit SERIAL ANALYZER MAIN WINDOW Cantiquration Wizard Welcome To PICkit Serial Analyzer Configuration Wizard 958 coetro block updated with p 22 2 The tolong md you Prop the setup of We Sen Lean Advanced View Set Serial Analyzer correctly Wasic View Set 2 7 RUNNING THE 28 PIN DEMO DEMONSTRATION PROGRAM
101. data The CONTROL_BLOCK is the source of read data for any all addresses Of course optional EVENT markers report 2 transactions to the host 1 0 51647 102 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware FIGURE 11 2 PKSA EXEC gt CONTROL LB comm ADR een 2 STATUS 4 Fes D 2 E H V 9 usB CBUF1 2 CBUF3 event data BC read data 11 7 1 1 1 Operation The DEFAULT mode requires very little configuration initialization 1 Issue COLD START 2 Write CONFIGURATION BLOCK with 12 5 and MODE 0 3 Issue WARM START 11 7 1 2 MODE INTERACTIVE The INTERACTIVE mode provides the greatest flexibility but at the expense of trans action latencies The host monitors 2 transactions near real time using EVENT mark ers Should a transaction require read data to return to the ke master the 2 bus is suspended by holding the clock line low until the host supplies data via the standard script buffer D 2007 Microchip Technology Inc DS51647B page 103 PICkit Serial Analyzer User s Guide FIGURE 11 3 PKSA EXEC 4 CONTROL LH COMM i 1 2 STATUS PCS D SEH 5 USB 4 B C T CBUF1 E A CBUF2 _ CB
102. data is displayed Listen will display when the completed frame is different than the last frame Transmit will not display data and Display All will display all OnReceive data Output Window Toggles between displaying data on the Transactions window and a specialized LIN display BAUD Allows the user to get and set the baud rate Checksum Type Toggles between Classic Enhanced or no checksum Commands Reset Frame Buffer forces a manual reset of the working frame in the DLL Reset Timestamp forces the next frame to be received to start at time 0 0 seconds 2007 Microchip Technology Inc DS51647B page 47 PICkit Serial Analyzer User s Guide Transmit Allows the user to transmit a frame Enter the MasterlD and frame data if any The checksum is automatically calculated Press the Execute button to transmit the frame The Clear button will clear the contents of the MasterlD and the data textboxes Note The x indicates the value is a hexadecimal number Clicking on x will toggle it to a indicating that the value is a decimal number DS51647B page 48 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 7 SPI and Microwire Master Communications 7 1 INTRODUCTION This chapter describes the SPI and Microwire Master Communications mode Microw ire is a subset of the SPI protocol Data and commands can be entered using a Basic Communications windo
103. defines the set of SLAVE addresses that the PKSA will ACKNOWLEDGE All addresses excluded by the ADDRESS and MASK will be automatically NOT ACKNOWLEDGED For all acknowledged address the pre loaded SLAVE PROFILE dictates the response behavior For IC transactions involving SLAVE ADDRESSES or REGISTERS not defined in the SLAVE PROFILE WRITE data is discarded and a READ data is defaulted OxFF Sim ilarly writing to a READ ONLY register or attempting to write beyond the addressable 1 0 51647 104 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware limits of the register will cause the write data to be discarded Reading from a WRITE ONLY register or attempting to read beyond the addressable limits of the reg ister will result in default data OxFF FIGURE 11 4 PKSA 4 CONTROL LH COMM 1 2 l STATUS FCS D i Pc E H HK S USB gt CBUF1 E A CBUF2 4 cBUr3 B PROFILE A event data 2 read data 11 7 1 3 1 Operation The HOST configures the AUTO mode as follows 1 Issue COLD START Reset 2 Write CONFIGURATION BLOCK comm I2CS mode 2 appropriate EVENT MARKERS enabled 3 Write SLAVE PROFILE to CBUF3 4 Issue WARM START The AUTO mode allows the PKSA to operate autonomously i e without HOST in
104. e Communications Mode from the menu bar FIGURE 3 4 CONFIGURATION WIZARD PAGE 2 OF 4 Configuration Wizard Communication Speed Page 2 of 4 Select your I2C commurecaton speed Communication speed may also be adjusted by using the e of Mode page from the PICkit Seng Analyzer menu dropdown alter completing the Configuration Wizard Esch 2007 Microchip Technology Inc DS51647B page 19 PICkit Serial Analyzer User s Guide DS51647B page 20 The 12 bus requires pull up resistors The PICkit Serial Analyzer has the ability to enable internal 2 2 kQ pull up resistors If the target device does not have pull up resis tors installed then enable pull ups by selecting the Yes radio button as shown in Figure 3 5 If the target device has the pull up resistors installed you can disable the internal pull ups by selecting the No radio button FIGURE 3 5 CONFIGURATION WIZARD PAGE 3 OF 4 Configuration Wizard Device Pullups Page 3 of 4 Do you need to enable pullups for your device PICkit Serial Analyzer can power the target device from 0 to 5 Vdc at a combined total current limit of 100 mA PICkit Serial Analyzer plus target device The Configura tion Wizard Page 4 of 4 as shown in Figure 3 6 allows you to choose between powering the target device and selecting the specific target voltage CAUTION Even though the voltage can be set as low as 0 VDC it
105. e tool bar or Communications Basic Operations from the menu bar The USART Asynchronous Basic Operations window is shown in Figure 8 3 There are two basic communications commands Read and Write Data can be transmitted to the target device as 7 bit ASCII or 8 bit byte 7 bit ASCII data is entered in the left hand window 8 bit byte is entered in the right hand column Both transmitted and received data is displayed in the Transaction window Note The x indicates the value is a hexadecimal number Clicking on x will toggle it to a d indicating that the value is a decimal number The command will be logged in the Transactions window A listing of the command abbreviations is given in Table 8 2 FIGURE 8 3 USART ASYNCHRONOUS BASIC OPERATIONS Basic Operations USART Sync Master ASCII Input Data Input Send One Character at a time b Execute X Clear X Clear 8 7 SCRIPT BUILDER USART Asynchronous commands can be combined into scripts saved and used over again The Script Builder window is opened by selecting Communications gt Script gt Script Builder from the menu bar The Script Builder is shown in Figure 8 4 The Script Builder window is divided into four columns as shown in Figures 8 5 through 8 8 DS51647B page 66 2007 Microchip Technology Inc USART Asynchronous Communications FIGURE 8 4 USART ASYNCHRONOUS SCRIPT BUILDER Script Builder
106. egistered trademarks of Microchip Technology Incorporated in the U S A Analog for the Digital Age Application Maestro CodeGuard dsPICDEM dsPICDEM net dsPICworks ECAN ECONOMONITOR FanSense FlexROM fuzzyLAB In Circuit Serial Programming ICSP ICEPIC Mindi MiWi MPASM MPLAB Certified logo MPLIB MPLINK PICDEM PICDEM net PICLAB PICtail PowerCal Powerlnfo PowerMate PowerTool REAL ICE rfLAB rfPICDEM Select Mode Smart Serial SmartTel Total Endurance UNI O WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U S A and other countries SQTP is a service mark of Microchip Technology Incorporated in the U S A All other trademarks mentioned herein are property of their respective companies 2007 Microchip Technology Incorporated Printed in the U S A All Rights Reserved gt Printed on recycled paper Microchip received ISO TS 16949 2002 certification for its worldwide headquarters design and wafer fabrication facilities in Chandler and Tempe Arizona Gresham Oregon and Mountain View California The Company s quality system processes and procedures are for its PIC MCUs and dsPIC DSCs KEELOQ code hopping devices Serial EEPROMs microperipherals nonvolatile memory and analog products In addition Microchip s quality system for the design and manufacture of development systems is ISO 9001 2000 certified DS51647B page ii 2007 Microchip Technology
107. er can double click or right click and select from the local menu Note The x indicates the value is a hexadecimal number Clicking on x will toggle it to a d indicating that the value is a decimal number DS51647B page 56 2007 Microchip Technology Inc SPI and Microwire Master Communications FIGURE 7 11 SPI SCRIPT BUILDER SCRIPT DETAIL Script Detail Script Builder Example SPI Scripts Script Detail User SPI Scripts Script Name EEWriteEnable i m EEWrite1 Byte EEReadBBytes Save Script X Clear Script Del User Scripts Show Array 7 7 4 User Scripts The fourth column contains User Scripts as shown in Figure 7 12 User scripts that are created named and saved are displayed in the User Scripts column To load a user script from the User Scripts column into the Script Detail column the user can double click or right click and select from the local menu User Scripts can be deleted by right clicking and selecting Delete Script from the local menu FIGURE 7 12 SPI SCRIPT BUILDER USER SCRIPTS User Scripts Script Builder Example SPI Scripts Script Detail User SPI Scripts Script Name EEWriteEnable ES m EEWritel Byte EERead6Bytes Save Script gt Execute Script X Clear Script Del User Scripts 3 Show Array x sols Esel Moe Lo tala e ler oen e esl 1 2
108. ered in the Iterations box and the delay in millisecond in the Delay box A summary of the iterations is dis played in the left column The macro is executed when the Iteration button is clicked FIGURE 9 11 USART ASYNCHRONOUS SCRIPT EXECUTE EXAMPLE Script Execute USART Scripts Assignable Buttons Unassigned Iterations 2 Unassigned Unassigned Execute script TX Data 2 times once every 100 ms Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Show Sent Script in Transaction Window DS51647B page 82 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 10 User Defined Templates 10 1 INTRODUCTION User Defined Templates extend User Scripts by interpreting the data read from the target device and displaying it in a human readable form The conversion formula is EQUATION 10 1 CONVERSION FORMULA Read Value Slope Offset Display Value For example 8 bit ADC value is read and we desire a displayed value in voltage 0 to 5 Volts The 8 bit ADC value read value can be 0 to 256 decimal The ADC refer ence voltage is 5 The slope is the constant value used to convert between the ADC read value and the desired display value In this example EQUATION 10 2 SLOPE EXAMPLE Slope ADC Reference Voltage 8 bit ADC 5 256 0 01953125 Using a User Defined Template the interpretatio
109. erified by the user The PICkit Serial Analyzer program does not verify the correctness of the script A complete listing of the available macro commands is given in Table 8 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 8 9 USART ASYNCHRONOUS SCRIPT BUILDER CREATING A SCRIPT Script Builder Ex USART Scripts Script Detail User USART Scripts Script Name Output2Bytes N Insert Blank Save Script EN Insert Array gt Execute Script GeneralCmds gt X Clear Script USART Init Del User Scripts p Data Trasmit 4 Set BAUD Rate Z Show Array AUX Data Receive Reset Clock Polarity Set Clock Polarity TABLE 8 2 USART SCRIPT MACRO COMMANDS Macro Command 2 Description USDATATX TX Transmit data Next byte is the byte count followed by the data USDATARX RX Receive data Next byte is the byte count USDATARXEN ER Enable Receive data monitor USDATARXDS DR Disable Receive data monitor USBREAKTX Send Break USBRKDATTX BKD Send Break then data byte Next byte is the data byte USBAUD BD Set BAUD Rate Next byte is BAUD LSB followed by BAUD MSB US9BITSET 9 Set 9 bit Data mode US9BITRST 9R Reset 9 bit Data mode sets 8 bit USCLKPOLSET CS Set CLOCK POLARITY bit
110. ess W block in the Read section of the Basic Operations window lower third of window Step 2 Enter 0x02 into the Word Address block Step 3 Note that the Slave Address R has already been entered for you the Read bit is set Step 4 Enter 0x01 into the Byte Count block Step 5 Click on the Execute button The 12 combination command Write then Read will be sent to the 28 Pin Demo Board The command and the contents of Word Address 0x02 seconds will be displayed in the transaction window as shown in Figure 2 7 FIGURE 2 7 RTC TRANSACTIONS DEMO Transactions Edt X Clear S Reset Time Sent IX Read Cmd 5 42 02 RS 43 01 P 5 106 2 8 2 EEPROM The Slave address for the emulated Serial EEPROM on the 28 Pin Demo Board is hexadecimal 8 0xA8 The Word Address selects one of 256 8 bit memory locations TABLE 2 2 WORD ADDRESS CONTENTS Word Address Contents 0x00 Memory Contents OxFF Memory Contents 2 8 3 ADC The Slave address for the ADC on the 28 Pin Demo Board is hexadecimal 0 The Word Address 0x01 selects the memory location containing the Most Significant 8 bits of the 10 bit ADC of the PIC microcontroller 2 9 28 PIN DEMO I2C SOURCE CODE AND FIRMWARE The demo program source code and hex file can be found on the PICkit Serial CD ROM at D 28 pin Demo Board Firmware
111. executed during the transaction The Write operation begins after the Stop bit is received The firmware will not respond to 2 communications during the Write FIGURE B 5 SERIAL EEPROM OPERATION Write Operation E Send Start Bit Send Control Byte w Write Bit NO YES continue 6 3 Slave Address 0xAA Executive EXEC The Executive 12 pseudo device provides features convenient for testing and dem onstrating the PICkit Serial Analyzer and the 28 Pin Demo Board I2C firmware The DC word addresses are listed in Table B 4 DS51647B page 138 2007 Microchip Technology Inc 28 Pin Demo Board 12 7 Demonstration Firmware TABLE B 4 TABLE B 4 EXECUTIVE EXEC WORD ADDRESSES REG NAME DESCRIPTION 0x00 EXEC_STATE State of executive state controller bit 7 1 force state controller to one of eight entry points specified by bits 2 0 0x01 EXEC ADC CHO ADC results of CHANNEL ANO potentiometer RP1 0x02 EXEC RTC SECS binary value representation of RTC SECONDS 0x03 EXEC STATUS state of communications connector pins bit 0 PIN 1 AUX1 bit 1 PIN 4 SDA bit 2 PIN 5 SCL bit 3 PIN 6 AUX2 bits 5 4 undefined bit 6 operation error bit 7 operation busy 0x04 EXEC 04 undefined can be read written with no operational effect 0x05 EXEC 05 undefined can be read written with no operational effec
112. following information Product Support Data sheets and errata application notes and sample programs design resources user s guides and hardware support documents latest software releases and archived software General Technical Support Frequently Asked Questions FAQs technical support requests online discussion groups Microchip consultant program member listing Business of Microchip Product selector and ordering guides latest Microchip press releases listing of seminars and events listings of Microchip sales offices distributors and factory representatives DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE Microchip s customer notification service helps keep customers current on Microchip products Subscribers will receive e mail notification whenever there are changes updates revisions or errata related to a specified product family or development tool of interest To register access the Microchip web site at www microchip com click on Customer Change Notification and follow the registration instructions The Development Systems product group categories are Compilers The latest information on Microchip C compilers and other language tools These include the MPLAB C18 and MPLAB C30 C compilers MPASM and MPLAB ASM30 assemblers MPLINK and MPLAB LINK30 object linkers and MPLIB and MPLAB LIB30 object librarians Emulators The latest information on Microchip in circuit emulators
113. g the PICkit Serial Analyzer to the 28 Pin Demo Board Starting the PICkit Serial Analyzer Program Running The 28 Pin Demo 12 Demonstration Program 2 Communications Basic Operations 28 Pin Demo IC Source Code and Firmware 2 3 INSTALLING THE PICkit SERIAL ANALYZER SOFTWARE Insert the PICKit Serial Analyzer CD ROM into the CD ROM drive In a few moments the introductory screen should be displayed Follow the directions on the screen to install the PICkit Serial Analyzer software If the introductory screen does not appear browse to the CD ROM directory and select the AutorunPro exe program Note The PICkit Serial Analyzer program requires the Microsoft NET Framework Version 2 0 If the NET Framework is not installed on your computer or if in doubt select the application plus Microsoft Framework installation 2 4 CONNECTING THE PICkit SERIAL ANALYZER TO THE PC Connect the PICkit Serial Analyzer to the PC using the supplied USB cable There are no USB drivers to install The green Power indicator should light indicating that the PICkit Serial Analyzer is powered 2007 Microchip Technology Inc DS51647B page 9 PICkit Serial Analyzer User s Guide 2 5 CONNECTING THE PICkit SERIAL ANALYZER TO THE 28 PIN DEMO BOARD Connect the PICkit Serial Analyzer to P3 on the 28 Pin Demo Board as shown in Figure 2 1 The PICkit Serial Analyzer will supply power to the 28 Pin Demo Board an
114. gures 4 10 Once scripts are created using the Script Builder they can be assigned to buttons in the Script Execute window This makes a convenient window to execute multiple scripts either individually or iteratively Script executing will be logged in the Transactions window The Script Execute window is opened by selecting Communications gt Script gt Script Execute from the menu bar FIGURE 4 10 PCM SCRIPT EXECUTE Script Execute Scripts Assignable Buttons Iterations 1 Delay ms Drag script onto the button above Unassigned Unassigned Unassigned Show Sent Script in Transaction Window Clear Buttons 1 2007 Microchip Technology Inc DS51647B page 35 PICkit Serial Analyzer User s Guide 4 8 1 Assignable Buttons User created scripts will be displayed in the central 2 Scripts column assign a script to a button click on the script name and drag it to the desired Assignable Buttons in the right column The script will be executed once each time the button is clicked The Assignable Buttons can be cleared by clicking on the Clear Buttons button 4 8 2 Iteration Scripts can be executed a user defined number of times at a specified interval of time Figures 4 11 shows an example A script named Read_Memory has been assigned to the Iteration button in the left column The number of iterations are entered in the Iterations box and the delay in millisecond in the Delay box
115. ically unused The COMM module will decode TAG bytes from the data stream in the script buffer The TAG bytes may represent commands to internally configure the PICkit Serial Ana lyzer and report status or the TAG bytes may be protocol specific identification that 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware needs to be translated into the device under test s protocol and communicated to the device The COMM module performs both of these functions This section will describe the COMM TAGs common to all supported serial protocols Table 11 11 describes the TAGs CCMD used in the data stream to the COMM controller Table 11 12 describes TAGs CDATA used in the data stream from the COMM controller TABLE 11 11 COMM SCRIPT COMMAND TAG BYTES TAG CCMD LEN Name Description 0x00 OxOF 16 RESERVED Reserved 0x10 3 Wait 1 Wait for time interval 0 1 Time LSB 2 Time MSB I res 409 6 usec max 26 843 sec 0x12 2 LED1 Configure LED 0 TAG 1 LED Configuration byte 0x13 2 LED2 Configure LED2 0 TAG 1 LED Configuration byte 0x15 3 TIMEOUT_ABO_SET Set time out ABO 0 TAG 1 Time out value LSB 2 Time out value MSB res 409 5 ms max 26 843 sec 0x16 1 TIMEOUT_ABO_KILL Kill disable time out ABO 0 TAG 0x17 3 TIMEOUT_AB1_SET Set time out AB1 0 TAG 1 Time out value LSB 2 Time out value MSB res 409 6 ms max
116. is up to the user to verify the required operating voltage of the target device CAUTION The USB port current limit is set to 100 mA If the target plus PICkit Serial Analyzer exceeds this current limit the USB port will turn off The target may be powered externally if more power is required FIGURE 3 6 CONFIGURATION WIZARD PAGE 4 OF 4 Configuration Wizard Voltage Source Page 4 of 4 Does PICK need to power your device PICKi Serial wall vi power my device Serial wili power your 5Vok device select the checkbox to Other the left then determine your voltage 2007 Microchip Technology Inc PICkit Serial Analyzer Program Once all pages of the Configuration Wizard are completed you can choose to not display the wizard at start up by checking the Do not show this wizard on start up again check box FIGURE 3 7 CONFIGURATION WIZARD YOU RE DONE Configuration Wizard You re Done 7 Press to complete the Configuration Wizard v Do not show this wizard on startup again Wizard may be accessed anytime from menu dropdown PICKit Serial Analyzer gt Run Configuration Wizard OK 3 6 MAIN WINDOW 3 6 1 Menu Bar The menu bar selects various functions of the PICkit Serial Analyzer program A summary of the functions are FIGURE 3 8 MENU BAR Menu Bar 7
117. it AUX2 0 An example of a data stream in the script buffer that would direct the COMM back to communicate in 2 to the unit Under test is as follows 0x81 I CM START 0x84 I CM WRITE BYTES 0x02 Number of bytes 8 PCM address for writing 0x01 12 command code 0x83 I CM RESTART 0x84 I CM WRITE BYTES 0x01 Number of bytes 9 PCM address for reading 0x89 I CM READ BYTES NLB 0x01 Number of bytes 0x82 CM STOP The script above is interpreted as follows TAG 0x81 instructs the COMM module to generate an 2 Start bit on the 12 bus TAG 0x84 indicates 2 bytes will be transmitted following the start 0xA8 and 0x01 The first byte is the 2 slave address with write read bit Reset and a data command byte of 0x01 The COMM module does not place any significance on the value of the data bytes but merely transmits them blindly as instructed The next TAG 0x83 instructs the COMM module to issue a Restart bit on the 12 bus TAG and data bytes 0x84 0x01 0xA9 will cause 1 byte 0xA9 to be transmitted Here again the COMM module does not interpret the data the 2 slave will interpret 9 as an address with write read bit set TAG 0x89 followed by data byte 0x01 instructs the COMM module to attempt to read 1 byte from the slave then issue a NACK on the bus Finally an 2 Stop bit is issued according to tag 0x82 The resulting
118. l Analyzer User s Guide Switch Off not depressed blink LED1 LED2 off Switch ON depressed blink LED2 LED off AUX1 Default State AUX1 communication line default state 0 1 AUX2 Default State AUX2 communication line default state 0 1 AUXA Direction AUX1 communication line direction 1 input 0 output AUX2 Direction AUX2 communication line direction 1 input 0 output D D 46 COMMUNICATIONS BASIC OPERATIONS The 12 Basic Operations window be opened by selecting Communications Basic Operations from the tool bar or Communications gt Basic Operations from the menu bar The 12 Basic Operations window is shown in Figures 4 3 There are three basic communications commands Read and Write and Receive Read performs a combination Write then Read commands to the target device refer to the 2 Specification reference in Section 4 1 Introduction above The basic structure of the command is Start bit S_ Slave Address W Enter the slave address of the device to communicate with The write bit should be cleared to indicate a write operation Word Address Enter the word address Restart RS Slave Address R The slave address with the write bit set will be automatically entered when the Slave Address W has been entered Byte Count Enter the number of bytes to be read Stop bit P_ D D Note The x indicates the value is
119. munications mode The Configuration Wizard Welcome window is shown in Figure 3 2 You may choose to continue by clicking on the Next button or canceling the wizard by clicking on the Cancel button DS51647B page 18 2007 Microchip Technology Inc PICkit Serial Analyzer PC Program FIGURE 3 2 CONFIGURATION WIZARD WELCOME Configuration Wizard Welcome To The PICkit Serial Analyzer Configuration Wizard x The following steps wili guide you through the setup of the Serial Analyzer The Configuration Wizard Page 1 of 4 as shown in Figure 3 3 displays the available communications modes and allows you to choose one of the modes FIGURE 3 3 CONFIGURATION WIZARD PAGE 1 OF 4 Configuration Wizard Communication Mode Page 1 of 4 Choose which mode of commurecation you wish to use GC Master 12 Slave SPI Master USART Asye O USART Sync Master O UN O Mictowre lt Back gt Cancel In this example 2 Master Communication s mode is selected The Configuration Wizard Page 2 of 4 as shown in Figure 3 4 allows you to select the bus speed A more comprehensive list of bus speeds can be chosen from the Configuration Window by selecting P Ckit Serial Analyzer Configur
120. n of the ADC value can be displayed in volts DC 10 2 HIGHLIGHTS This chapter discusses Creating and Using Templates My Templates Graphing Data 2007 Microchip Technology Inc DS51647B page 83 PICkit Serial Analyzer User s Guide 10 3 CREATING AND USING TEMPLATES Create a User Define Template by selecting User Define Templates gt Display Template from the menu bar The User Defined Template window is displayed as shown in Figure 10 1 showing three active scripts Note First a user define script s must be created using the Script Builder win dow for the selected serial communications mode Refer to the respective serial communications chapter under the Script Builder section FIGURE 10 1 THE USER DEFINED TEMPLATE User Defined Template File gt lt Clear All Return Param Param Start Byte Num Active Run Script Data Name Byte Count Byte Order Slope Offset Signed Radix Decimals Value VoltScript Voltage ADCScip v CurScript Current Options Run Al 2 iterations 0 Bape Create the Parameter Template by filling in each line Each line is a single parameter a value read converted to value displayed The nputs below define how a particular parameter is interpreted Active Allows you to activate or deactivate a par
121. number is located on the bottom of each page in front of the page number The numbering convention for the DS number is DSXXXXXA where XXXXX is the document number and A is the revision level of the document For the most up to date information on development tools see the MPLAB IDE on line help Select the Help menu and then Topics to open a list of available on line help files INTRODUCTION This chapter contains general information that will be useful to know before using the PICkit Serial Analyzer User s Guide Items discussed in this chapter include Document Layout Conventions Used in this Guide Warranty Registration Recommended Reading The Microchip Web Site Development Systems Customer Change Notification Service Customer Support Document Revision History DOCUMENT LAYOUT This document describes how to use the PICkit Serial Analyzer as a development tool to communicate with embedded development systems via serial protocols The manual layout is as follows Chapter 1 PICkit Serial Analyzer Overview Chapter 2 Getting Started Chapter 3 PICkit Serial Analyzer PC Program Chapter 4 Master Communications Chapter 5 SPI Master Communications Chapter 6 USART Asynchronous Communications Chapter 7 USART Master Synchronous Communications Chapter 8 User Defined Templates Chapter 9 PICkit Serial Analyzer Firmware Chapter 10 PICkit Serial Analyzer DLL
122. oard i2c slave pksd asm I2C TM service for three slave devices 2 Real Time Clock 8 EEPROM OxAA Executive EXEC led asm LED management set reset LEDs per state register main asm Initialization Idle loop and Interrupt Service Routine context management pksi asm Monitor PICkit Serial Analyzer interface I O pins post results to state register rtc asm 2 device real time clock emulation maintains 16 locations for register based 1 0 timer0 asm Utilizes TMRO as a source for multiple soft timers timer1 asm Utilizes TMR1 with external 32 kHz crystal for RTC 1 second ticks 2 COMMUNICATIONS B 5 1 Overview The 28 Pin Demo Board IC Demo responds to three 12 slave addresses TABLE B 2 DEVICE SLAVE ADDRESSES ADDR NAME DESCRIPTION 2 RTC Device emulation Real Time Clock OxA8 EEPROM Device emulation EEPROM OxAA EXEC Supervisory features All devices slave addresses respond to the 2 protocols described below Each slave device supports a fixed number of word addresses see section B 6 Slave Devices below The word address is automatically incremented during a transaction for sequential access of the device registers If the word address is incremented beyond the end of the supported address range the address will wrap B 5 2 Protocols Figure B 1 shows the Master and Slave legend used for Figures B 2 through B 4
123. ons Unassigned Unassigned Delay ms y ms Unassigned Drag script onto the button above Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned v Show Sent Script in Transaction Window 7 8 1 Assignable Buttons User created scripts will be displayed in the central SPI Scripts column To assign a script to a button click on the script name and drag it to the desired Assignable Buttons in the right column The script will be executed once each time the button is clicked The Assignable Buttons can be cleared by clicking on the Clear Buttons button 7 8 2 Iteration Scripts can be executed a user defined number of times at a specified interval of time Figure 7 15 shows an example A script named Read_Memory has been assigned to the Iteration button in the left column The number of iterations are entered in the Iterations box and the delay in millisecond in the Delay box Asummary of the iterations is displayed in the left column The macro is executed when the Iteration button is clicked I 2007 Microchip Technology Inc DS51647B page 59 PICkit Serial Analyzer User s Guide FIGURE 7 15 SPI SCRIPT EXECUTE EXAMPLE Script Execute SPI Scripts Assignable Buttons Read Memory Iterations 1 z Unassigned Unassigned Delay ms Unassigned Execute script Read_Memory Unassigned Unassigned Unassigned Clear Bu
124. ooting 13 1 INTRODUCTION This chapter describes questions and answers to common problems associated with using the PICkit Serial Analyzer and how to resolve them 13 2 FREQUENTLY ASKED QUESTIONS PICkit Serial Analyzer could not be found Question am receiving the error message PICkit Serial Analyzer could not be found in the Transactions window but the PICkit Serial Analyzer is plugged in What is wrong Answer Open the Windows operating system Device Manger by clicking on Control Panel gt System selecting the Hardware tab and clicking on Device Manger button Check if there is an error displayed under Human Interface Devices as shown in Figure 13 1 If an error is displayed try unplugging and the re plugging the USB cable until the error goes away this may take 3 or 4 tries If the error persists try another USB port or hub Try plugging the PICkit Serial Analyzer into another computer to verify that the USB port is working FIGURE 13 1 WINDOWS DEVICE MANAGER gy Human Interface Devices R USB Human Interface Device Current Limit Exceeded Question received the error message USB Hub Current Limit Exceeded from the Windows operating system What is wrong Answer The USB port current limit is set to 100 mA If the target device plus PICkit Serial Analyzer exceeds this current limit the USB port will shut down Check for shorts The target device can
125. osing Insert Array FIGURE 7 9 SPI SCRIPT BUILDER SCRIPT COMMANDS Script Builder ample SPI Scripts Script Detail User SPI Scripts Script Name EEWrite1 Byte EEReadBBytes lg Save Script X Clear Script Del User Scripts 3 Show Array Y x a 1 2007 Microchip Technology Inc DS51647B page 55 PICkit Serial Analyzer User s Guide 7 7 2 Example Scripts The second column contains Example Scripts as shown in Figure 7 10 These can be studied to learn how to create or to edit custom scripts To load the example script into the Script Detail column either double click or right click and select from the local menu FIGURE 7 10 SPI SCRIPT BUILDER EXAMPLE SCRIPTS Example Scripts Script Builder Example SPI Scripts Script Detail User SPI Scripts Script Name EEWriteE nable EEWrite1 Byte EEReadBBytes lg Save Script gt Execute Script X Clear Script Del User Scripts Show Array 7 7 3 Script Detail The third column contains Script Detail as shown in Figure 7 11 This column is used to create the script or view an existing script More information about creating a customer script is discussed in Section 7 7 5 Creating A Script To load a user script from the User Scripts column into the Script Detail column the us
126. ot respond as a slave The control block of memory dedicated to communication allows for setting of the bit rate and displaying event markers in the software windows TABLE 11 15 CONNECTOR PINOUT IN ICM MODE Pin Description 1 2 V 3 GND 4 SDA 5 SCL 6 I DS51647B page 96 2007 Microchip Technology Inc PICkit Serial Analyzer Firmware TABLE 11 16 CONTROL BLOCK Byte Bit Description COMM 16 7 0 Bit flags 0 1 event marker enable Start bit 1 1 event marker enable Stop bit 2 1 event marker enable Restart bit 3 1 event marker enable ack nack tx 4 5 1 event marker enable ack nack rx 6 7 1 event marker enable write byte 17 7 0 Bit flags 0 1 event marker enable read byte 1 1 event marker enable transaction error 2 1 event marker enable status error STATUS_BLOCK 12 0 3 4 5 6 7 18 7 0 19 7 0 20 7 0 21 7 0 0 AUX1 default state 0 1 1 AUX2 default state 0 1 2 AUX1 direction 1 IN 0 3 AUX2 direction 1 IN 0 4 5 6 7 22 7 0 23 7 0 BIT RATE FOSC 4 X 1 min 0 127 49 gt 100k bps 127 gt 39k bps I 2007 Microchip Technology Inc DS51647B page 97 PICkit Serial Analyzer User s Guide TABLE 11 17 STATUS
127. ou can start the program by Clicking on the desktop icon or Navigating to Start gt All Programs gt Microchip gt PICkit Serial Analyzer After a few moments the program will start and display the main window as shown in Figure 3 1 I 2007 Microchip Technology Inc DS51647B page 17 PICkit Serial Analyzer User s Guide FIGURE 3 1 PICkit SERIAL ANALYZER MAIN WINDOW Transactions 6 28 2007 10 56 12 lcome to PICkit Serial version 2 1 0 0 Found PICkitS dil Ver 1 5 0 0 Found PICkit Serial Analyzer FW Ver 0 0201 USB control block updated with preference data Basic View Set 3 5 CONFIGURATION WIZARD If itis the first time that the PICkit Serial Analyzer program is the Configuration Wiz ard will run automatically The Configuration Wizard can be manually invoked by select ing DICK Serial Analyzer gt Run Configuration Wizard from the menu bar The Configuration Wizard will guide you through the basic steps to configure the PICkit Serial Analyzer program for a specific communications mode 2 Master I C Slave SPI USART LIN Microwire Advanced configuration can be done from the Configuration Window by selecting P C kit Serial Analyzer Configure Communications Mode from the menu bar As an example Figure 3 2 through Figure 3 7 show how to configure for 2 Master mode Refer to the specific communications chapter for detailed information on the Configuration Wizard for that com
128. ow provide sev eral levels of sophistication and operability In all modes transactions can be reported to the host using optional PKSA event tags Additionally mode dependant data is avail able as described below TABLE 11 20 MODE NAME DESCRIPTION 0 DEFAULT basic mechanical mode of operation in which the PKSA blindly accepts any all write data and provides canned default read data in response to any enabled I2C address and all device registers addresses data defined in CONTROL BLOCK 1 INTERACTIVE This mode allows the host to orchestrate I2C transactions in real time This necessarily requires the host to provide read data as needed while the PKSA holds the I2C bus clock line waiting Write data is reported to the host via transaction event tags 2 AUTO In AUTO mode the PKSA operates autonomously as defined by a soft SLAVE PROFILE table stored in PKSA RAM described below At any time the host can read and or update the table contents as needed Note The ability to service multiple slave addresses is hampered by a bug in silicon versions A3 and before Slave address MASK should be set to zero 0 11 7 1 Modes 11 7 1 1 MODE DEFAULT As stated in the introduction the DEFAULT mode requires little no configuration and results in minimal transaction latencies This mode is of limited use in that it does not provide for address dependant dynamic read
129. page and open the 2 Slave Profile Generator page Note The Basic operations page and the Profile Generator page cannot both be opened at the same time due to dll conflict issues 5 7 COMMUNICATIONS PROFILE GENERATOR The 2 Slave Profile Generator allows you to mimic an 2 slave device from either the PICkit Serial Analyzer PC interface or from the PICkit Serial Analyzer itself The trade off between the two methods is flexibility vs response time Mimicking a device from the PC allows for a great deal of run time flexibility while running from the PICkit Serial Analyzer decreases response time You can mimic up to eight registers in a profile DISPLAYING THE 12 SLAVE PROFILE GENERATOR The profile generator may be opened by either pressing the Show Profile Generator button on the I CS Basic Operations page or by the menu item Communications gt Slave Profile Generator Figure 5 4 shows the Slave Profile Generator with the first two registers activated FIGURE 5 4 CT SLAVE PROFILE GENERATOR 2 Slave Profile Generator ile X Clear Al Slave Register Word Enable Enable Memory Data Use Large Comm Address Name Address Read Write Block Size Data Array v Active 0 2 0 2 v Block 02 v Active 0 Register Block 0 Active Active Active Active C Active Active Serial
130. personality is defined by a slave profile downloaded by the host to PKSA RAM i e CBUF3 The profile defines one or more 2 slave addresses and a set of one or more device REGISTERS for each The profile must begin with a SLAVE ADDRESS TAG and be terminated by an END TAG TABLE 11 21 TABLE TAG DESCRIPTION 0x10 SLAVE ADDRESS Ox2X REGISTER DEFINITION 0x40 END OF SLAVE PROFILE Note 1 The upper nibble defines the TABLE TAG the lower nibble is reserved for option flags TABLE 11 22 TABLE TAG SLAVE ADDRESS 0X20 TABLE TAG SLAVE ADDR 0x20 DATA SLAVE ADDRESS DATA RESERVED DATA RESERVED The SLAVE definition is 4 bytes long including the TAG Two bytes are reserved for firmware operation TABLE 11 23 TABLE TAG REGISTER DEFINITION TABLE TAG REG DEF 0x4X DATA REGISTER ID ADDRESS DATA BYTE COUNT DATA DATA 0 DATA DATA N 3 The length of a REGISTER definition is flexible Lower nibble of TABLE TAG is defined as option bits refer to table below TABLE 11 24 TABLE TAG 3 memory block of sequential locations beginning with register TABLE TAG 2 TABLE TAG 1 disable READ TABLE TAG 0 disable WRITE A memory block is a set of N contiguous addresses beginning with REGISTER ID An lC transaction is permitted to access one or more bytes anywhere within the block TABLE 11 25 TABLE TAG
131. programs can be created by accessing the Dynamically Linked Library DLL PICkitS dll with the software language of your choice All of the function ality to create tag byte scripts that will be converted to protocol scripts is built into the DLL and is very easy to use Any programming language that can access functions from a DLL can be used however a Microsoft NET framework language is recommended 12 2 OVERVIEW The name of the DLL is PickitS dll and is included in the PICkit Serial Analyzer instal lation The functions used to create custom GUI apps are Divided into logical classes inside the DLL The classes are listed below I2C Master class PICkitS I2CM I2C Slave class PICkitS I2CS SPI Master class PICkitS SPIM Microwire Master class PICkitS MicrowireM USART class PICkitS USART LIN class PICkitS LIN Device class PICkitS Device USBRead Class PICkitS USBRead Applications call functions from class Device for initialization and cleanup and from a specific protocol class for input and output Example projects written in Visual Basic NET Express a free download from Microsoft and detailed documentation for each protocol are available for download from the PICkit Serial Website 2007 Microchip Technology Inc DS51647B page 127 PICkit Serial Analyzer User s Guide DS51647B page 128 2007 Microchip Technology Inc PICkit SERIAL ANALYZER MICROCHIP USER S GUIDE Chapter 13 Troublesh
132. ration Wizard or menu bar Configuration Wizard Select P Ckit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select P Ckit Serial Analyzer gt Configure Communications Mode The Configure Mode window will open Depending on the View selected the Basic View Figure 5 1 displays a minimum choice of configurations commands The Advanced View Figure 5 2 displays an extended choice of configuration commands Save the configuration by clicking on the Save Changes button FIGURE 5 1 CT SLAVE CONFIGURE COMMUNICATIONS MODE BASIC VIEW Configure Communications Mode m Options lg Save Changes Enable Event Markers C Enable Time Markers Enable Pulups Script Timeout Voltage Serial will i 12000 ms power my device 5 Volt Adjust timeout for script Other fail No need to press Save Changes 5 0 12 Slave Default Interactive Automatic OPTIONS Enable Event Markers Enable event markers Enable Time Markers Enable time stamp to accompany all event markers Enable Pull ups Enable internal 2 2 pull ups on SDA and SCL communication lines VOLTAGE PICkit Serial will power my device Select the check box if the Serial will power the target device The target can be powered at 5 VDC or a user selectable variable voltage DS51647B page 38 2007 Microchip Technology Inc CT Slave
133. rd or menu bar Configuration Wizard Select P Ckit Serial Analyzer gt Run Configuration Wizard from the menu bar Menu Bar Select_P Ckit Serial Analyzer gt Configure Communications Mode The Configure Mode window will open Depending on the View selected the Basic View Figures 4 1 displays a minimum choice of configurations commands In the Advanced View Figures 4 2 displays an extended choice of configuration commands Save the configuration by clicking on the Save Changes button FIGURE 4 1 CT CONFIGURE COMMUNICATIONS MODE BASIC VIEW Configure Communications Mode xj Options Save Changes v Enable Event Markers Enable Time Markers Cancel v Enable Pullups Script Timeout Voltage Serial will 3000 ms power my device 5 Volt Adjust timeout for script Other ail No need to press 2 Save Changes 5 0V Comm I2CM Bit Rate 100 kHz OPTIONS Enable Event Markers Enable event markers Enable Time Markers Enable time stamp to accompany all event markers Enable Pull ups Enable internal 2 2 kO pull ups on SDA and SCL communica tion lines VOLTAGE PICkit Serial will power my device Select the check box if the PICkit Serial will power the target device The target can be powered at 5 VDC or a user selectable variable voltage Even though the voltage can be set as low as 0 VDC it is up
134. rget device The target can be powered at 5 VDC or a user selectable variable voltage Even though the voltage can be set as low 0 VDC it is up to the user to verify the required operating voltage of the target device CAUTION The USB port current limit is set to 100 mA If the target plus PICkit Serial Analyzer exceeds this current limit the USB port will turn off The target may be powered externally if more power is required USART BAUD Enter the desired USART symbol rate Baud in the text box DS51647B page 74 2007 Microchip Technology Inc USART Master Synchronous Communications FIGURE 9 2 USART SYNCHRONOUS MASTER CONFIGURE COMMUNICATIONS MODE ADVANCED VIEW Configure Communications Mode USART Sync Master al x ptions Event Markers Advanced ptions Save Changes v Enable Event Markers Abit Mac Exe Disable LED2 Default Enable Time Markers Macro Loop Disable LED1 Default Mac Lp 65536 Enable Switch Test Mac Lp Done AUX1 Default State Script Timeout Voltage Timeout Timerl AUX2 Default State v ee TA L Timeout Timer2 AUXI Direction 3000 ms p 2 v Status Error AUX2 Direction 5Vot FI Clock Polarit Adjust timeout for script O Other Read Byte L d No need to press 2 v Write Byte Save Changes v Sta
135. ript Detail cell and choosing Insert Array FIGURE 9 5 USART SYNCHRONOUS MASTER SCRIPT BUILDER SCRIPT COMMANDS Script Commands Script Builder Ex USART Scripts Script Detail User USART Scripts Script Name Dutput2Bytes gt Execute Script gt lt Clear Script Del User Scripts 23 Show Array 2007 Microchip Technology Inc DS51647B page 77 PICkit Serial Analyzer User s Guide 9 7 2 Example Scripts The second column contains Example Scripts as shown in Figure 9 6 These can be studied to learn how to create or to edit custom scripts To load the example script into the Script Detail column either double click or right click and select from the local menu FIGURE 9 6 USART SYNCHRONOUS MASTER SCRIPT BUILDER EXAMPLE SCRIPTS Example Scripts Script Builder x USART Scripts Script Detail User USART Scripts Script Name Output2Bytes X Clear Script Del User Scripts Show Array 9 7 3 Script Detail The third column contains Script Detail as shown in Figure 9 7 This column is used to create the script or view an existing script More information about creating a customer script is discussed in Section 9 7 5 Creating a Script To load a user script from the User Scripts column into the Script Detail column the user can double click or right cli
136. rite Byte Save Changes Status Err SPI Options SPI Bit Rate 1 25MHz 9 77kHz 625kHz 2 44kHz 156 25kHz 0 61kHz 9 77Khz EVENT MARKERS Abrt Mac Exe Enable event marker abort macro execution Macro Loop Enable event marker top of macro loop Mac Lp 65536 Enable event marker macro loop count overflow i e 65536 Mac Lp Done Enable event marker macro loop iterations complete Timeout Timer1 Enable event marker Timer1 expired Timeout Timer2 Enable event marker Timer2 expired Status Error Enable event marker change in status byte Write Byte Enable event marker write byte Read Byte Enable event marker read byte Status Err Enable event marker change in SPI status byte ADVANCED OPTIONS Disable LED2 Default Disable default LED2 behavior LED2 Yellow Target LED Disable LED1 Default Disable default LED1 behavior LED1 Red Busy LED Enable Switch Test Enable low level switch test Switch Off not depressed blink LED1 LED2 off Switch ON depressed blink LED2 LED1 off Sample Phase SPI transaction configuration Sample phase Clock Edge Select SPI transaction configuration Clock Edge Clock Polarity SPI transaction configuration Clock Polarity Auto Output Disable Disables output during input Allows the SDI lines and the SDO lines to be shorted for 3
137. sa ode dod n aea 17 35 Configuration Wizard 18 3 6 Main AVION baden tente eer tas tbt stir tes te 21 3 7 Serial Communications Modes 25 Chapter 4 CT Master Communications 2007 Microchip Technology Inc DS51647B page iii PICkit Serial Analyzer User s Guide Chapter 5 Chapter 6 Chapter 7 Z WAO 27 4 2 Ten le II 27 4 3 PICkit Serial Pin Assignments 22 42 27 44 Selecting Communications Mode 27 4 5 Configuring 2 Communications Mode eee 28 4 6 Communications Basic Operations 30 SCPE BUGS iiie opu o OE ur eI dies 31 46 Seript EXECUTE 35 CT Slave Communications S ch MAUGO Se e dE e o d DRE 37 5 2 olliahllighis olei nee eite roce 37 5 3 PICkit Serial Pin Assignments EE 37 5 4 Selecting Communications Mode 38 5 5 Configuring I2C Slave Communications Mode 38 5 6 Communications Basic Operations 41 5 7 Communications Profile Generator 42 Lin Communications ECK al ua Send ROM ee en e R
138. sing Insert Array FIGURE 4 5 CT SCRIPT BUILDER SCRIPT COMMANDS Script Commands Script Builder Example 120M Scapts Sept Detal Script Name Resd dk g a que WirteBlockAdd amp 8 ReadBlockAdduB Save Script RecaiveAddead Execute Script X Clear Script Del User Scripts Show a xix x xixixixix xixi x x x 4 7 2 Example Scripts The second column contains Example Scripts as shown in Figures 4 6 These can be studied to learn how to create or to edit custom scripts To load the example script into the Script Detail column either double click or right click and select from the local menu FIGURE 4 6 CT SCRIPT BUILDER EXAMPLE SCRIPTS Example Scripts Script Builder Example 120M Scapts Sent Detal Script Name 8 Wines dB WinteBlockAdd amp 8 ReadBlockAddu8 ied Save Script 3 9 gt Execute Script X Clear Script Del User Scripts 2 Show 4 7 3 Script Detail The third column contains Script Detail as shown in Figures 4 7 This column is used to create the script or view an existing script More information about creating a custom script is discussed in Section 4 7 5 Creating A Script 1 DS51647B page 32 2007 Microchip Technology Inc CT Master Communications To load
139. splayed as shown in Figure 9 9 Select from the choice of commands or script macro commands 2007 Microchip Technology Inc DS51647B page 79 PICkit Serial Analyzer User s Guide 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 9 9 Macro commands are entered according to the sequence of events as defined by the USART Synchronous Master 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 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 A complete listing of the available macro commands is given in Table 9 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 9 9 Script Builder Script Name USART SYNCHRONOUS MASTER SCRIPT BUILDER CREATING A SCRIPT Ex USART Scripts Output2Bytes Save Script b Execute Script gt lt Clear Script Del User Scripts Z Show Array Script Detail User USART Scripts Delete N Insert Blank Insert Array Gener
140. ssary communication hardware and executing a sequential script defining a serial transaction FIGURE 11 1 ARCHITECTURE ARCHITECTURE EXEC gt CONTROL COMM USB STATUS CONTROL 8 EPO OUT CIRCULAR BUFFERS D EPO IN E CBUF PCT T scratch EP1 OUT CBUF1 SPI X gt wk script data E EP4AJN CBUF2 USART A t output data I 2007 Microchip Technology Inc DS51647B page 87 PICkit Serial Analyzer User s Guide Data streams associated with PICkit Serial Analyzer are formatted with markers called bytes A TAG may be stand alone or accompanied by data As seen in Table 11 1 the data stream for each state controller has a set of associated TAG bytes defined in detail later in the document EXEC manages the interface with the host The data stream sent to PICkit Serial Analyzer from the host is encoded with ECMD TAGs and the data stream returned to the host from PICkit Serial Analyzer uses EDATA TAGs Likewise the COMM con troller utilizes another set of predefined TAG s CCMD TAGs outgoing scripts and CDATA TAGs returning data EXEC has no knowledge of COMM TAG s but simply transports data blindly between the host and COMM using EXEC TAG s RAM buffers are used as conduits to exchange data with COMM Data destined for COMM is q
141. t 0x06 EXEC 06 undefined can be read written with no operational effect 0x07 EXEC VERSION Firmware version number State Controller The Executive state controller manages background functions The HOST enacts a function by writing to EXEC STATE with a valid state entry value i e 0x80 0x87 Writing values outside this range will cause unknown results TABLE B 5 EXEC STATE ENTRY VALUES VALUE NAME DESCRIPTION 0x80 EXEC DISPLAY PING display PING PONG LED pattern DS1 2 3 4 3 2 1 2 0x81 EXEC TIMER1 TEST operation timer1 test 0x82 EXEC DISPLAY ADC display of Most Significant 4 bits of ADC results measuring variable resistor 0x83 EXEC DISPLAY RTC display of RTC SECONDS binary 0 15 0x84 EXEC DISPLAY PKSI display of state of communications connector pins PIN 1 AUX1 LED2 PIN 4 SDA LED3 PIN 5 SCA LED4 PIN 6 AUX2 0x85 EXEC DISPLAY RESET display RESET sequence 0x86 EXEC DISPLAY 1SEC display blink all LEDs 1 sec ON 1 sec OFF 0x87 EXEC 0x87 undefined 2007 Microchip Technology Inc DS51647B page 139 PICkit Serial Analyzer User s Guide B 7 FUNCTIONS B 7 1 Ping Pong Display The PING PONG display is useful in testing the four LEDs which are illuminated individually and in sequence as seen below The following pattern is executed at a 100 millisecond step interval FIGUR
142. t marker Register Write e Status Error Enable event marker change in RC status byte Stop Enable event marker 2 Stop Data RQ Enable event marker Data request Note Disabling any of the event markers may cause the software to not respond correctly or at all ADVANCED OPTIONS Disable LED2 Default Disable default LED2 behavior LED2 Yellow Target LED Disable LED1 Default Disable default LED1 behavior LED1 Red Busy LED Enable Switch Test Enable low level switch test DEFAULT MODE READ DATA Sets byte 0 and following byte response for Default mode SLAVE ADDRESS MASK Sets the IC slave address to which the Serial Analyzer will respond Note The Address Mask is not currently implemented due to hardware limitations It is left in the software for possible future use DS51647B page 40 2007 Microchip Technology Inc CT Slave Communications 5 6 COMMUNICATIONS BASIC OPERATIONS The I C Slave Basic Operations window can be opened by selecting Basic Operations from the tool bar Communications gt Basic Operations from the menu bar BC Slave Basic Operations window is shown in Figures 5 3 There are three basic communications commands Receive Write and Read FIGURE 5 3 2 SLAVE BASIC OPERATIONS Basic Operations 2 Slave Receive Write Return Byte Byte Count Count Byte Count gt m v v
143. ted serial EEPROM HEEEEEEEE DS51647B page 12 2007 Microchip Technology Inc Getting Started FIGURE 2 4 28 PIN DEMO EEPROM Real Time Clock EEPROM 00 01 03 EJ a 45 FF FF FF FF FF FF FF FF EF FENTE Read EE FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 2 7 3 Analog to Digital Converter ADC Clicking on the ADC tab will show a meter gauge displaying the value of the ADC as read from potentiometer RP1 as shown in Figure 2 5 The meter gauge displays the Most Significant 8 bits of the 10 bit ADC internal to the PIC microcontroller Rotate potentiometer RP1 and the display changes almost instantaneously The demonstration program will constantly poll the 28 Pin Demo Board and display the contents of the ADC FIGURE 2 5 28 PIN DEMO ADC Real Time Clock EEPROM ADC d 0 100 200 9 ADC Value O74 2007 Microchip Technology Inc DS51647B page 13 PICkit Serial Analyzer User s Guide 2 8 IC COMMUNICATIONS BASIC OPERATIONS Individual
144. ter vention Practically speaking the HOST GUI will most likely want to reflect activity with the SLAVE registers as it occurs A couple options can be employed Option 1 would call for the HOST to enable I C transaction EVENT MARKERS detailing each IC transaction in which the PKSA participated This requires that the HOST decode interpret the transactions on a byte by byte basis Option 2 utilizes the register access EVENT MARKERS I2CS EVENT REG READ amp I2CS EVENT REG WRITE fired to the HOST when a register within the SLAVE PROFILE is accessed The fact that a slave register was read is an event but does not represent a change in the data loaded in the SLAVE PROFILE In the event that a reg ister within the SLAVE PROFILE was written it may be important for the HOST moni toring the SLAVE PROFILE to fetch the new data from that register for processing display Data is retrieved from a register using SCMND TAG DCS REGDATA READ The register contents are returned with SDATA TAG I2CS_REGDATA The register contents can be written or read by the HOST To insure data integrity of multi byte registers the contents are accessed only between IC transactions This may cause a slight delay in executing the request or in servicing the next pending I2C transactions 1 2007 Microchip Technology Inc DS51647B page 105 PICkit Serial Analyzer User s Guide 11 7 1 3 2 Slave Profile In AUTO mode the PKSA
145. the links Support gt Getting Started gt PIC MCU Tutorials gt 2 Master Mode Several application notes are available on the Microchip Technology web site Click on links Design gt App Notes Function Communicat ions gt 2 4 2 HIGHLIGHTS This chapter discusses PICkit Serial Pin Assignments Selecting Communications Mode Configuring 12 Communications Mode Communications Basic Operations Script Builder Script Execute 4 3 PICkit SERIAL PIN ASSIGNMENTS The Serial Analyzer pin assignments for 2 Master mode are TABLE 4 1 PIN ASSIGNMENTS Pin Label Type Description 1 AUX1 Input Output Auxiliary I O port pin No 1 2 Power Target Power 3 GND Power Ground 4 SDA Input Output Serial Data 5 SCL Power Serial Clock 6 AUX2 Input Output Auxiliary I O port pin No 2 4 4 SELECTING COMMUNICATIONS MODE The 12 Master Communications mode is selected from the Configuration Wizard or menu bar Configuration Wizard Select PICkit Serial Analyzer gt Run Configuration Wizard from the menu bar 2007 Microchip Technology Inc DS51647B page 27 PICkit Serial Analyzer User s Guide Menu Bar Select P Ckit Serial Analyzer gt Select Communications Mode gt Master 4 5 CONFIGURING COMMUNICATIONS MODE DS51647B page 28 Once the communications mode has been selected it is configured from the Configu ration Wiza
146. tions Connector DS51647B page 6 2007 Microchip Technology Inc PICkit Serial Analyzer Overview 1 5 1 Status LEDs The Status LEDs indicate the status of the PICkit Serial Analyzer 1 Power green Power is applied to the PICkit Serial Analyzer by the USB port 2 Target yellow The PICkit Serial Analyzer is communicating with the target device 3 Busy red The PICkit Serial Analyzer is communicating with the target device 1 5 2 Push Button The push button is available for future implementation 1 5 3 Lanyard Connection To help prevent possible loss of the PICkit Serial Analyzer a convenient lanyard connection is available 1 5 4 USB Port Connection The USB Port Connection is a USB mini B connector Connect the PICkit Serial Analyzer to the PC using the supplied cable 1 5 5 Pin 1 Marker The Pin 1 marker assists in aligning the PICkit Serial Analyzer with the target device Pin assignments are shown in Figure 1 3 1 5 6 Communication Connector The communication connector connects to the target device using an inexpensive 6 pin 0 100 pitch spacing 0 025 square pin header Pin assignments are shown in Figure 1 3 FIGURE 1 3 PICkit SERIAL ANALYZER PIN ASSIGNMENTS Pin 1 Indicator Pin Description PC SPI USART Microwire LIN gt E 1 CS TX CS TX 3 2 V V V V Hs 3 GND GND GND GND GND 4 SDA SDI SDI CS Wake 7 5
147. to the user to verify the required operating voltage of the target device CAUTION The USB port current limit is set to 100 mA If the target plus PICkit Serial Analyzer exceeds this current limit the USB port will turn off The target may be powered externally if more power is required 2007 Microchip Technology Inc CT Master Communications 2 COMM ICM RATE Select the desired 12 bus bit rate using the drop down box FIGURE 4 2 CT CONFIGURE COMMUNICATIONS MODE ADVANCED VIEW Configure Communications Mode 12C Master Evert Meters Advanced Options Save Changes 7 Enable Evert Makers C Abt Mac Ewe Disable LED2 Delaut Time Markers 11 Maco Loop Disable LED1 Cancel Enable Pulp C Mac Up 65536 C Enable Switch Test C Mac Lp Done ALKI State Timema 20 Timeout Tener AUX2 Delauk State Tmeou Tee AUXI Direction 3000 m POR 7 Status Ener Direction gt 5Vor T Adjust timeout for script Other S Stat B No need to press v Stop Ba Save Changer Restat B 50 Ack Nack TX Ack Nack Cosm 20M Rate C Wite Byte Read Byte 100 kHz v TX Enx v Status Eee Enable Al 120M Options SCRIPT TIMEOUT When sending scripts the software will wait maximum of Script Timeout ms to receive a script complete t
148. tores the data belonging to the register Hex format Use Large Data Array If the data in the register is larger than 8 bytes press this button to display a 256 byte array into which you may enter data Once the parameters are entered they can be saved as an 2 Slave Profile file pfl File gt Open Open an existing profile pfl File gt Save Save or replace a profile pfl Clear All Resets clears all registers PICkit SERIAL SLAVE ADDRESS In the groupbox Serial Analyzer Slave Address enter the hex representation of the slave address you want the PICkit Serial Analyzer to respond to then press the Apply button This writes the address into the Analyzer firmware MODE If you wish to run the slave profile from the PC GUI there is nothing more to do If you wish to run it from the PICkit Serial Analyzer press the appropriate radio button in the Mode groupbox Note If you are running the profile from the PICkit Serial Analyzer and you wish to change the profile you must press the Apply Profile button to load the changes into the firmware Note When running the profile from the PICkit Serial Analyzer instead of the PC you are limited to 255 data and configuration bytes profile length If you attempt to write too large of a profile to the PICkit Serial Analyzer an error message will be sent to the Transactions window telling you your profile length
149. ttons Unassigned Unassigned Unassigned Show Sent Script in Transaction Window EEE DS51647B page 60 2007 Microchip Technology Inc SPI and Microwire Master Communications NOTES I 2007 Microchip Technology Inc DS51647B page 61 PICkit Serial Analyzer User s Guide DS51647B page 62 2007 Microchip Technology Inc MICROCHIP PICkit SERIAL ANALYZER USER S GUIDE Chapter 8 USART Asynchronous Communications 8 1 INTRODUCTION This chapter describes the USART Asynchronous Communications mode USART Asynchronous data and commands can be entered using a Basic Communications window or by creating Script Commands It is assumed that the user is familiar with the USART Asynchronous protocol For more information see USART AUSART or EUSART chapter of the PIC microcontroller data sheet of interest USART Asynchronous Communications tutorial is available on the Microchip Technology web site Click on the links Support gt Getting Started gt PIC MCU Tutorials gt USART Using in Asynchronous Mode Several application notes are available on the Microchip Technology web site Click on links Design gt App Notes gt Function Communication gt USART 8 2 HIGHLIGHTS This chapter discusses PICkit Serial Pin Assignments Selecting Communications Mode Configuring USART Asynchronous Communications Mode Communications Basic Operations
150. tus Error 5 0 v Break TX Enable All USART BAUD USART Options Target Actual 1220 SCRIPT TIMEOUT When sending scripts the software will waita maximum of Script Timeout ms to receive a script complete tag before issuing an error If your hardware is slow to respond or you are transferring a lot of data you may need to increase the Script Timeout to avoid errors EVENT MARKERS Abrt Mac Exe Enable event marker abort macro execution Macro Loop Enable event marker top of macro loop Mac Lp 65536 Enable event marker loop count overflow i e 65536 Mac Lp Done Enable event marker macro loop iterations complete Timeout Timer1 Enable event marker Timer1 expired Timeout Timer2 Enable event marker Timer2 expired Status Error Enable event marker change in status byte Read Byte Enable event marker read byte Write Byte Enable event marker write byte Status Error Enable event marker change in USART status byte Break TX Enable event marker A Break has been transmitted ADVANCED OPTIONS Disable LED2 Default Disable default LED2 behavior LED2 Yellow Target LED Disable LED1 Default Disable default LED1 behavior LED1 Red Busy LED Enable Switch Test Enable low level switch test Switch Off not depressed blink LED1 LED2 off Switch ON depressed blink LED2 LED1 off AUX1 Defa
151. ueued in RAM buffer 1 CBUF1 Data returning from COMM is funneled through RAM buffer 2 CBUF2 The PICkit Serial Analyzer is designed to facilitate continuous spooling of data to from the external serial device Separate 255 byte circular buffers are maintained for both outgoing data scripts data and returning data The USB interface is not permitted to be a bottleneck in the PICkit Serial Analyzer operation EXEC processes each USB packet immediately If data is destined for a RAM buffer the host is responsible to insure adequate room is available in the buffer before the data is sent to avoid a fatal overrun error Returning data is queued in the appropriate circular buffer until retrieved by EXEC tagged and sent to the host It is possible to overrun the return buffer under some circumstances but should be rare EXEC can interleave EXEC data with COMM data as necessary The PICkit Serial Analyzer maintains fixed length blocks of data for CONTROL and STATUS The CONTROL BLOCK provides static configuration information The STATUS BLOCK is a snapshot of the PICkit Serial Analyzer operation Each block is divided into three sections corresponding to EXEC COMM common to all protocols and COMM specific to the active serial protocol TABLE 11 1 TAG BYTE TYPES TAG types Definition ECMD EXEC command interpreted by EXEC EDATA EXEC data TAG s generated by EXEC CCMD COMM command TAG
152. uired USART BAUD Enter the desired USART symbol rate Baud in the text box FIGURE 8 2 USART ASYNCHROUNOUS CONFIGURE COMMUNICATIONS MODE ADVANCED VIEW Configure Communications Mode USART Async Options Event Markers Advanced Options Save Changes v Enable Event Markers Abrt Mac Exe C Disable LED2 Default tats ire Meter LJ Macro Loop C Disable LED Default Mac Lp 65536 Enable Switch Test Mac Lp Done TT AUX1 Default State Script Timeout Voltage Timeout AUX2 Default State Serial will Ti ERE v imeout Timer2 AUX1 Direction 3000 Power device Status Error AUX Direction 5Vok Read Byte Adjust timeout for script Other 4 No need to press Write Byte Receive Disabled Save Changes Status Error 5 0 Break TX Enable All USART BAUD USART Options Target Actual 1220 lt lt lt lt lt SCRIPT TIMEOUT When sending scripts the software will wait maximum of Script Timeout ms to receive a script complete tag before issuing an error If your hardware is slow to respond or you are transferring a lot of data you may need to increase the Script Timeout to avoid errors EVENT MARKERS Abrt Mac Exe Enable event marker abort macro execution Macro Loop Enable
153. ult State AUX1 communication line default state 0 1 AUX2 Default State AUX2 communication line default state 0 1 AUX1 Direction AUX1 communication line direction 1 input 0 output AUX2 Direction AUX2 communication line direction 1 input 0 output Clock Polarity Checked means the polarity is inverted unchecked means it is not 2007 Microchip Technology Inc DS51647B page 75 PICkit Serial Analyzer User s Guide 9 6 COMMUNICATIONS BASIC OPERATIONS The USART Asynchronous Operations window can be opened by selecting Communications Basic Operations from the tool bar or Communications Basic Operations from the menu bar The USART Synchronous Master Basic Operations window is shown in Figure 9 3 There are two basic communications commands Read and Write Data can be transmitted to the target device as 7 bit ASCII or 8 bit byte 7 bit ASCII data is entered in the left hand window 8 bit byte is entered in the right hand column Both transmitted and received data is displayed in the transaction window Note The x indicates the value is a hexadecimal number Clicking on x will toggle it to a d indicating that the value is a decimal number The command will be logged in the Transactions window A listing of the command abbreviations is given in Table 9 2 FIGURE 9 3 USART SYNCHRONOUS MASTER BASIC OPERATIONS Basic Operations USART Sync Master ASCI
154. under that Act Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates It is your responsibility to ensure that your application meets with your specifications MICROCHIP MAKES REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED WRITTEN OR ORAL STATUTORY OR OTHERWISE RELATED TO THE INFORMATION INCLUDING BUT NOT LIMITED TO ITS CONDITION QUALITY PERFORMANCE MERCHANTABILITY OR FITNESS FOR PURPOSE Microchip disclaims all liability arising from this information and its use Use of Microchip devices in life support and or safety applications is entirely at the buyer s risk and the buyer agrees to defend indemnify and hold harmless Microchip from any and all damages claims suits or expenses resulting from such use No licenses are conveyed implicitly or otherwise under any Microchip intellectual property rights QUALITY MANAGEMENT SYSTEM CERTIFIED BY DNV ISO TS 16949 2002 Trademarks The Microchip name and logo the Microchip logo Accuron dsPIC KEELOQ KEELOQ logo microID MPLAB PIC PICmicro PICSTART PRO MATE PowerSmart rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U S A and other countries AmpLab FilterLab Linear Active Thermistor Migratable Memory MXDEV MXLAB PS logo SEEVAL SmartSensor and The Embedded Control Solutions Company are r
155. vent marker enable macro loop 65536 1 Event marker enable macro loop done 1 Event marker enable time out ABO 1 Event marker enable time out AB1 1 Event marker enable status error STATUS_BLOCK 04 0 1 Unassigned 1 Unassigned 11 N A 12 VSRC 8 bit setting 13 VSRC Fault Threshold 14 N A gt alala al 9 mw o 15 N A 2007 Microchip Technology Inc DS51647B page 95 PICkit Serial Analyzer User s Guide TABLE 11 14 COMM SCRIPT STATUS BLOCK Byte Bit Description COMM GENERAL COMM status error Time out ABO Time out AB1 COMM initialization error VSRC fault Data error e g unrecognized TAG missing data etc Output buffer overrun CBUF2 Output buffer overrun CBUF3 Composite error COMM status informational Controller busy Executing MACRO Executing MACRO infinite loop Executing WAIT instruction EN ce A e SN NN NT NIN gt sl sl al sl sl d a son End of Script TAG encountered 6 COMM mode 7 VSRC Measurement 0 255 8 9 10 11 11 6 ICM COMMUNICATIONS 2 refers to the Master mode of the PC protocol See the 2 specification for proto col details In this mode the PICkit Serial Analyzer will master the 12 bus only It will n
156. w or by creating Script Commands It is assumed that the user is familiar with the SPI protocol For more information see An SPI tutorial is available on the Microchip Technology web site Click on the links Support gt Getting Started gt PIC MCU Tutorials gt SPI PlCmicro Serial Peripheral Interface Several application notes are available on the Microchip Technology web site Click on links Design gt App Notes gt Function Communications gt SPI 7 2 HIGHLIGHTS This chapter discusses PICkit Serial Analyzer Pin Assignments Selecting Communications Mode Configurating SPI Communications Mode Communications Basic Operations Script Builder Script Execute 7 3 PICkit SERIAL ANALYZER PIN ASSIGNMENTS The PICkit Serial Analyzer pin assignments for SPI Master mode are TABLE 7 1 PIN ASSIGNMENTS Pin Label Type Description 1 cs Output Chip Select Active Low 2 V Power Target Power 3 GND Power Ground 4 SDI Input Serial Data In with respect to the PICkit Serial Analyzer SCK Output Serial Clock 6 SDO Output Serial Data Out with respect to the PICkit Serial Analyzer 7 4 SELECTING COMMUNICATIONS MODE The SPI Master Communications mode is selected from the Configuration Wizard or menu bar Configuration Wizard Select P Ckit Serial Analyzer gt Run Configuration Wizard from the menu bar 2007 Microchip Technology Inc DS51647B page 49
157. x82 1 STOP Issue 12 Stop 0 TAG 0x83 1 RESTART Issue 2 Restart 0 0 84 N 2 I CM WRITE BYTES Write bytes 0 TAG 1 byte count N 2 data byte N 1 data byte 0x85 2 2 READ BYTES Read bytes ACK all bytes 0 TAG 1 byte count N 0x86 1 READ BLOCK Read block ACK all bytes 0 TAG 0x87 2 BIT RATE Set I2C bit rate 0 TAG 1 bit rate 0x88 1 RESET Reset MSSP module 0 TAG 0x89 2 I2CM READ BYTES NLB Read bytes NACK last byte 0 TAG 1 byte count N Ox8A 1 127CM_READ_BLOCK_NLB_ Read block NACK last byte 0 TAG 0x90 1 CM AUX1 RST AUX1 0 0 TAG 0x91 1 12CM_AUX1_SET AUX1 1 0 TAG 0x92 1 1 OUT AUX1 direction OUTPUT 0 TAG 0x93 1 12CM_AUX1_IN AUX1 direction INPUT 0 TAG 0x94 1 12CM_AUX1_WAIT_O wait AUX1 0 0 TAG 2007 Microchip Technology Inc DS51647B page 99 PICkit Serial Analyzer User s Guide TABLE 11 18 2 CMD TAG BYTES CONTINUED X wal 0 95 1 12CM_AUX1_WAIT_1 it AUX1 0 x 29 SH 0x96 1 12CM_AUX2_RST AUX2 0 0 X 0 97 1 I2CM_AUX2 SET AUX2 1 0 X Irection 0 98 1 12CM_AUX2_OUT AUX2 direction OUTPUT 0 x E 0 99 1 12CM_AUX2_IN AUX2 direction INPUT 0 x YA wai Ox9A 1 12CM_AUX2_WAIT_O it AUX2 0 x wai 1 0x9B 1 12CM_AUX2_WAIT_1
158. ye Status Address Address Ad ress R Count b Execute x x RS P x x n 4 7 SCRIPT BUILDER 2 commands can be combined into scripts saved and used over again The Script Builder window is opened by selecting Communications gt Script gt Script Builder from the menu bar The Script Builder is shown in Figures 4 4 The Script Builder window is divided into four columns as shown in Figures 4 4 through 4 8 FIGURE 4 4 CT SCRIPT BUILDER Example 120M Scnpts Script Name ResdadkAB a WiteAddhAs WinteBlockAd amp A8 M ReatBlockAdhAB led Save Script RecervesddeAS Execute Script X Clear Script Del User Scripts Show 4 7 1 Script Commands The left most column contains the Script Commands as shown in Figures 4 5 Script Name Enter the name of the script Save Script Saves the script Execute Script Executes performs the script displayed in the Script Detail column Clear Script Clears the Script Detail column Del User Scripts Deletes scripts from the User Scripts column Show Array Displays a spreadsheet like table in which large amounts of data 1 2007 Microchip Technology Inc DS51647B page 31 PICkit Serial Analyzer User s Guide may be entered This data can be included in the script by right clicking in a Script Detail cell and choo
159. ystal connected to Timer1 Low power Oscillator Four LEDs DS1 through DS4 connected to RBO through RB3 Potentiometer RP 1 connected to RAO ANO Push button SW1 connected to RE3 MCLR For more information about the 28 Pin Demo Board hardware see the 28 Pin Demo Board User s Guide DS41301 B 4 FIRMWARE The demo program source code and hex file can be found on the PICkit Serial CD ROM at D 28 pin Demo Board Firmware The firmware is structured as multiple modules representing functional components Each module contains at minimum an initialization routine MODULE INIT and a service routine MODULE_SVC Each initialization routine is called from MAIN once on Reset Each Interrupt Service Routine is called sequentially and continuously from the MAIN Idle loop Interrupt Service Routine is provided for the 2 module only All other modules are serviced in turn from the MAIN Idle loop 2007 Microchip Technology Inc DS51647B page 135 PICkit Serial Analyzer User s Guide B 5 TABLE B 1 FIRMWARE MODULES MODULE DESCRIPTION adc asm ADC service measuring channel ANO connected to potentiometer RP1 and post results to register in shared memory device asm Basic device microcontroller configuration ee util asm EEPROM Read Write routines exec asm Executive feature set provides functionality for test and demon stration of PICkit Serial Analyzer and 28 Pin Demo B
Download Pdf Manuals
Related Search
Related Contents
PerfectDraft HD3600 SERVICE MANUAL - Bradford White Whirlpool CMT061SG User's Manual NEBELMASCHINE Special Driving Situations - Registry of Motor Vehicles tousimis® SAMDRI®-PVT-3D Hatco 3CS2 User's Manual POWERDRIVE - Leroy Somer User manual - Al Ghandi Electronics Français - Biocompatibles Copyright © All rights reserved.
Failed to retrieve file