Microchip Technology PICkit™ Serial Analyzer User’s Guide

PICkit
Serial Analyzer
USER’S GUIDE
© 2007 Microchip Technology Inc. DS51647A
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, require using the Microchip products in a 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 Digit al Millennium Copyright Act. If suc h a c t s allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device applications and t he lik e is provided only for your convenience and may be su perseded by upda t es . It is y our responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO 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 supp ort and/or safety ap plications is entir ely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless M icrochip from any and all dama ges, claims, suits, or expenses re sulting from such use. No licens es are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron, dsPIC, K
EELOQ, 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, MX DEV, MXLAB, PS logo, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered 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 Se rial Program ming, ICSP, ICEPIC, Mindi, MiWi , MPASM, MPLAB Certified logo, MPLIB, MPLINK, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel, Total Endurance, UNI/O, WiperLock and ZENA are trademarks of Microchip Technology In corporated 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, Pr inted in the U.S.A., All Rights Reserved.
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 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.
®
code hopping devices, Serial
DS51647A-page ii © 2007 Microchip Technology Inc.
®
PICkit™ SERIAL ANALYZER
USER’S GUIDE
Table of Contents
Preface ... ............... .............. .............. ............ ............... .............. ............... .. 1
Chapter 1. PICkit™ Serial Analyzer Overview
1.1 Introduction ..................................................................................... 5
1.2 Highlights ........................................................................................ 5
1.3 PICkit™ Serial Analyzer Contents ..................................................5
1.4 PICkit™ Serial Analyzer Development System .............................. 5
1.5 PICkit™ Serial Analyzer Hardware .................................................6
1.6 PICkit™ Serial Analyzer Software ..................................................8
Chapter 2. Getting Started
2.1 Introduction ..................................................................................... 9
2.2 Highlights ........................................................................................ 9
2.3 Installing the PICkit™ 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 I2C™ Demonstration Program ...........11
2
2.8 I
2.9 28-Pin Demo I
C™ Communications – Basic Operations ..................................14
2
C™ Source Code and Firmware ..........................15
Chapter 3. PICkit™ Serial Analyzer PC Program
3.1 Introduction ................................................................................... 17
3.2 Highlights ...................................................................................... 17
3.3 Installing the PICkit™ Serial Analyzer Software ...........................17
3.4 Starting the Program .....................................................................17
3.5 Configuration Wizard ....................................................................18
3.6 Main Window ................................................................................21
3.7 Serial Communications Modes .....................................................25
© 2007 Microchip Technology Inc. DS51647A-page iii
PICkit™ Serial Analyzer User’s Guide
Chapter 4. I2C™ Master Communications
4.1 Introduction ...................................................................................27
4.2 Highlights ......................................................................................27
4.3 PICkit Serial Pin Assignments .......................................................27
4.4 Selecting Communications Mode ..................................................27
4.5 Configuring I2C Communications Mode ........................................28
4.6 Communications: Basic Operations ..............................................30
4.7 Script Builder .................................................................................31
4.8 Script Execute ...............................................................................35
Chapter 5. SPI Master Communications
5.1 Introduction ...................................................................................37
5.2 Highlights ......................................................................................37
5.3 PICkit™ Serial Analyzer Pin Assignments ....................................37
5.4 Selecting Communications Mode ..................................................37
5.5 Configurating SPI Communications Mode ....................................38
5.6 Communications: Basic Operations ..............................................40
5.7 Script Builder .................................................................................42
5.8 Script Execute ...............................................................................46
Chapter 6. USART Asynchronous Communications
6.1 Introduction ...................................................................................49
6.2 Highlights ......................................................................................49
6.3 PICkit Serial Pin Assignments .......................................................49
6.4 Selecting Communications Mode ..................................................50
6.5 Configuring USART Asynchronous Communications Mode .........50
6.6 Communications: Basic Operations ..............................................52
6.7 Script Builder .................................................................................52
6.8 Script Execute ...............................................................................57
Chapter 7. USART Master Synchronous Communications
7.1 Introduction ...................................................................................59
7.2 Highlights ......................................................................................59
DS51647A-page iv © 2007 Microchip Technology Inc.
PICkit™ SERIAL ANALYZER
Table of Contents
7.3 PICkit Serial Pin Assignments ......................................................59
7.4 Selecting Communications Mode ................................................. 59
7.5 Configuring USART Synchronous Master Communications
Mode .............................................................................................60
7.6 Communications: Basic Operations ..............................................62
7.7 Script Builder ................................................................................62
7.8 Script Execute ...............................................................................67
Chapter 8. User Defined Templates
8.1 Introduction ................................................................................... 69
8.2 Highlights ...................................................................................... 69
USER’S GUIDE
8.3 Create Templates .........................................................................69
8.4 My Templates ...............................................................................71
Chapter 9. PICkit™ Serial Analyzer Firmware
9.1 Introduction ................................................................................... 73
9.2 Highlights ...................................................................................... 73
9.3 Overview ....................................................................................... 73
9.4 EXEC ............................................................................................ 75
9.5 COMM ..........................................................................................78
9.6 I2CM Communications ..................................................................82
9.7 SPI Communications ....................................................................87
9.8 USART Communications .................................. ..... ..... .... ..... ......... 90
Chapter 10. PICkit™ Serial Analyzer DLL
10.1 Introduction ................................................................................... 95
10.2 Highlights ...................................................................................... 95
10.3 Summary of Functions ..................................................................95
10.4 Programming Example ....................... ..... ..... ................................99
© 2007 Microchip Technology Inc. DS51647A-page v
PICkit™ Serial Analyzer User’s Guide
Chapter 11. Troubleshooting
11.1 Introduction .................................................................................101
11.2 Frequently Asked Questions .......................................................101
Appendix A. PICkit Serial Analyzer Schematics ...............................103
A.1 Introduction .................................................................................103
Appendix B. 28-Pin Demo Board I2C™ Demonstration Firmwa r e...107
B.1 Introduction .................................................................................107
B.2 Highlights ....................................................................................107
B.3 Hardware .....................................................................................107
B.4 Firmware .....................................................................................107
B.5 I2C Communications ...................................................................108
B.6 Slave Devices .............................................................................109
B.7 Functions .....................................................................................112
Worldwide Sal e s a nd Se r vi c e .............................................. .................114
DS51647A-page vi © 2007 Microchip Technology Inc.
PICkit™ SERIAL ANALYZER
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 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 Select the Help menu, and then Topics to open a list of available on-line help files.
®
IDE on-line help.
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: I
• 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
2
C™ Master Communications
© 2007 Microchip Technology Inc. DS51647A-page 1
PICkit™ Serial Analyzer User’s Guide
• Chapter 11: Troubleshooting
• Appendix A: Hardware Schematics
• Appendix B: 28-Pin Demo Board I
CONVENTIONS USED IN THIS GUIDE
This manual uses the following docum entat io n conven tion s:
DOCUMENTATION CONVENTIONS
Description Represents Examples
Arial font:
Italic characters Referenced books MPLAB
Initial caps A window the Output window
Quotes A field name in a window or
Underlined, italic text with right angle bracket
Bold characters A dialog button Click OK
N‘Rnnnn A number in verilog format,
Text in angle brackets < > A key on the keyboard Press <Enter>, <F1>
Courier New font:
Plain Courier New Sam ple source code #define START
Italic Courier New A variable argument file.o, where file can be
Square brackets [ ] Optional arguments mcc18 [options] file
Curly brackets and pipe character: { | }
Ellipses... Replaces r epeated text var_name [,
Emphasized text ...is the only comp ile r...
A dialog the Settings dialog A menu selection select Enable Programmer
dialog A menu path File>Save
A tab Click the Power tab
where N is the tota l number of digits, R is th e radi x and n is a digit.
Filenames autoexec.bat File paths c:\mcc18\h Keywords _asm, _endasm, static Command-line options -Opa+, -Opa- Bit values 0, 1 Constants 0xFF, ‘A’
Choice of mutually exclusive arguments; an OR selection
Represents code supplied by user
2
C™ Demo Firmware
®
IDE User’s Guide
“Save project before build”
4‘b0010, 2‘hF1
any valid filename
[options] errorlevel {0|1}
var_name...] void main (void)
{ ... }
DS51647A-page 2 © 2007 Microchip Technology Inc.
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 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
Preface
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 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.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 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. DS51647A-page 3
®
IDE – The latest information on Microchip MPLAB IDE, the Windows®
®
C18 and MPLAB C30 C compilers; MPASM™
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 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)
®
II device programmers and the PICSTART®
• Initial release of this document.
DS51647A-page 4 © 2007 Microchip Technology Inc.

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
I
C™, 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 I

1.2 HIGHLIGHTS

This chapter discusses:
• PICkit™ Serial Analyzer Contents
• PICkit™ Serial Analyzer Development System
• PICkit™ Serial Analyzer Hardware
• PICkit™ Serial Analyzer PC Software
PICkit™ SERIAL ANALYZER
USER’S GUIDE
2
C serial protocol.

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. PICkit™ 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 Analyzer connects to the PC using a USB cable. Finally, the PICkit™ Serial Analyzer interface s t o t h e t a r g et de vi ce us in g a 6- pin header. Figu r e1-1 illustrates t he PIC ki t ™ Serial Analyzer embedded serial communications development system.
®
Windows® compatible computers with a USB port. The PICkit™ Serial
© 2007 Microchip Technology Inc. DS51647A-page 5
PICkit™ Serial Analyzer User’s Guide

FIGURE 1-1: PICkit™ SERIAL ANALYZER DEVELOPMENT SYSTEM

PC
Target
Device
USB
PICkit™ Serial Analyzer

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

2
1
I2C™
SPI
USART
3
4
6
Legend:
1 – Status LEDs 3 – Lanyard Connection 5 – Pin 1 Marker 2 – Push Button 4 – USB Port Connection 6 – Communications Connector
DS51647A-page 6 © 2007 Microchip Technology Inc.
5
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
2
C™ SPI USART
I
1 2 3 4 5 6
1— CS 2+V +V +V 3 GND GND GND 4SDASDI — 5SCLSCK— 6— SDORX
TX
Note: The 6-pin header (0.100" spacing) accepts 0.025" square pins.
© 2007 Microchip Technology Inc. DS51647A-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 comm unica te to th e target dev ice . Data and c omma nds can be entered using basic or scr ipting 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 communica­tions modes and their operation.
1.6.2 Dynamically Linked Library (DLL)
The PICkit™ Serial Analyzer DLL is explained in Chapter 10. “PICkit™ Serial Analyzer DLL”.
1.6.3 Firmware
The PICkit™ Serial Analyzer firmware is explained in Chapter 9. “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 PICkit Serial Analyzer > Download PICkit 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.

FIGURE 1-4: FIRMWARE DOWNLOAD WINDOW

DS51647A-page 8 © 2007 Microchip Technology Inc.

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 I
2
the I
C Master and the 28-Pin Demo Board will be the I2C Slave device. The 28-Pin
Demo board is programmed to emulate an I For more information about the 28-Pin Demo Board hardware, see the 28-Pin Demo
Board User’s Guide (DS41 3 01). For more information about the 28-Pin Demo Board I
Appendix B. “28-Pin Demo Board I
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
• Connecting the PICkit Serial Analyzer to the 28-Pin Demo Board
• Starting the PICkit Serial Analyzer Program
• Running The 28-Pin Demo I
2
•I
C Communications – Basic Operations
• 28-Pin Demo I
PICkit™ SERIAL ANALYZER

Chapter 2. Getting Started

2
C serial protocol. The PICkit™ Serial Analyzer will be
2
C real-time clock and Serial EEPROM.
2
2
C™ Demonstration Firmware”.
.
2
C™ Demonstration Program
2
C™ Source Code and Firmware
C™ demo firmware, see
USER’S GUIDE

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
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.
®
.NET
®
.NET

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. DS51647A-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 and 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: A, D, C
• 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>All Pr ograms>Microchip>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 I mode. For more information about using the I Master Communications.”
2
C Master mode, see Chapter 4. “I2C™
2
C Master
DS51647A-page 10 © 2007 Microchip Technology Inc.
Getting Started

FIGURE 2-2: PICkit™ SERIAL ANALYZER MAIN WINDOW

2.7 RUNNING THE 28-PIN DEMO I2C™ DEMONSTRATION PROGRAM

Select the 28-Pin Demo I2C demonstration by clicking on Demo Boards > 28 Pin Demo I2C from the menu bar. The 28-Pin Demo I2C 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 I
2
I
C commands are very similar to the commands used in these devices. The 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.
2
C clock-calendar device. The
© 2007 Microchip Technology Inc. DS51647A-page 11
PICkit™ Serial Analyzer User’s Guide

FIGURE 2-3: 28-PIN DEMO I2C™ – RTC

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 I 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 emulated serial EEPROM.
2
C EEPROM device such as a 24LC02. The I2C commands are
DS51647A-page 12 © 2007 Microchip Technology Inc.

FIGURE 2-4: 28-PIN DEMO I2C™ – EEPROM

Getting Started
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 I
2
C™ – ADC
© 2007 Microchip Technology Inc. DS51647A-page 13
PICkit™ Serial Analyzer User’s Guide

2.8 I2C™ COMMUNICATIONS – BASIC OPERATIONS

Individua l I2C commands and data can 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 I figuration Wizard from the menu bar and selecting I2C Master.
2
C Master mode by selecting PICkit Serial Analyzer > Run Con-
Note: The 28-Pin Demo I
opened at the same time. When the 28-Pin Demo I the Basic Operations window will automatically close.
FIGURE 2-6: I
2
C™ BASIC OPERATIONS
2
C window and the Basic Operations window cannot be
2
C window is opened,
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
DS51647A-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 Address[W] block in the Read section of the Basic
Operations window (top half 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
2
The I
C 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

2.8.2 EEPROM
The Slave address for the emulated Serial EEPROM on the 28-Pin Demo Board is hexadecimal A8 (0xA8). The Word Address selects one of 256 8-bit memory locations:
TABLE 2-2: WORD ADDRESS CONTENTS
Word Address Contents
0x00 Memory Contents … … 0xFF Memory Contents
2.8.3 ADC
The Slave address for the ADC on the 28-Pin Demo Board is hexadecimal AA (0xAA). 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\
.
© 2007 Microchip Technology Inc. DS51647A-page 15
PICkit™ Serial Analyzer User’s Guide
NOTES:
DS51647A-page 16 © 2007 Microchip Technology Inc.
PICkit™ SERIAL ANALYZER
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
Framework Version 2.0.

3.4 STARTING THE PROGRAM

You can start the program by
• Clicking on the desktop icon, or
• Navigating to Start>All Pr ograms>Microchip>PICkit Serial Analyzer After a few moments, the program will start and display the main window as shown in
Figure 3-1.
®
.NET
© 2007 Microchip Technology Inc. DS51647A-page 17
PICkit™ Serial Analyzer User’s Guide

FIGURE 3-1: PICkit™ SERIAL ANALYZER MAIN WINDOW

3.5 CONFIGURATION WIZARD

If it is the first time that the PICkit Serial Analyzer program is run, the Configuration Wiz­ard will run automatically . The Configuration Wizard can be manually invoked by select­ing PICkit Serial Analyzer > Run Configuration Wizard
The Configuration Wizard will guide you through the basic steps to configure the PICkit Serial Analyzer program for a specific communications mode (I Advanced configuration can be done from the Configuration Window by selecting PIC- 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 I mode. Refer to the specific communications chapter for detailed information on the Configuration Wizard for that communications 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.
from the menu bar.
2
C, SPI, USART).
2
C Master
DS51647A-page 18 © 2007 Microchip Technology Inc.
PICkit™ Serial Analyzer PC Program

FIGURE 3-2: CONFIGURATION WIZARD – WELCOME

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

In this example, I
2
C 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 PICkit Serial Analyzer > Configure Communications Mode
© 2007 Microchip Technology Inc. DS51647A-page 19
from the menu bar.
PICkit™ Serial Analyzer User’s Guide

FIGURE 3-4: CONFIGURATION WIZARD – PAGE 2 OF 4

2
C bus requires pull-up resistors. The PICkit Serial Analyzer has the ability to
The I enable internal 2.2 kΩ 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

The PICkit Serial Analyzer can power the target device from 0 to 5 V 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.
DC at a combined
CAUTION
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.
DS51647A-page 20 © 2007 Microchip Technology Inc.
PICkit™ Serial Analyzer PC Program

FIGURE 3-6: CONFIGURATION WIZARD – PAGE 4 OF 4

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 – Y OU’RE DONE!

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
© 2007 Microchip Technology Inc. DS51647A-page 21
PICkit™ Serial Analyzer User’s Guide
COMMUNICATIONS The Communications menu selections display operation windows to enter data and
commands to communicate with the target device.
• Basic Operations mode selected (see PICkit Serial Analyzer -> Select Communications Mode)
•Script
PICkit™ SERIAL ANALYZER The PICkit Serial Analyzer menu selection commands the PICkit Serial Analyzer
hardware.
• Select Communications Mode
• Configure Communications Mode
• Download PICkit Serial Analyzer Firmwa re
• Run Configuration Wizard
• Perform Syste m Reset
• Reset PICkit Serial Analyzer
• PICkit Serial Analyzer No.
>
- Script Builder
- Script Execute
2
-I
C Master – Puts the PICkit Serial Anal yzer in I2C Master Communications
mode
-SPI Master
mode
- USART Asynchronous
nous Communications mode
- USART Synchronous Master
Synchronous Master Communications mode
Mode window for the communications mode selected (see PICkit Serial Analyzer
-> Select Communications Mode)
window. Firmware updates are available from the Microchip Technology web site.
PICkit Serial Analyzer
condition is present
from the PC software. The number is assigned to the hardware as it enumerates on the USB bus.
– Displays the Basic Operations window for the communications
– Displays the Script Builder window
– Displays the Script Execute window
>
– Puts the PICkit Serial Analyzer in SPI Master Communications
– Puts the PICkit Serial Analyzer in USART Asynchro-
– Puts the PICkit Serial Analyzer in USART
– Displays the Configuration Communications
– Displays the Firmware Download
– Displays the Configurat ion Wizard
– Closes and then reinitializes USB communications to the
– Resets the PICkit Serial Analyzer if an error
– Up to four PICkit Serial Analyzers can be controlled
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 demonstr ation.
•28
-Pin Demo I2C – Displays the 28-Pin Demo Board I2C demo graphical user interface. For more informati on se e Appendix B. “28-Pin Demo Board I Firmware.”
USER DEFINED TEMPLATES
• Create Template
•My Templates VIEW
•Basic
DS51647A-page 22 © 2007 Microchip Technology Inc.
– The PICkit Serial Analyzer program will display basic commands and
status view
– Displays the Parameter Template creation window
– Selects and displays template windows created by the user
2
C™
PICkit™ Serial Analyzer PC Program
• Advanced – The PICkit Serial Analyzer program will display advanced commands and status view
WINDOW
• New Transaction Window transaction windows can be opened as needed for logging communications.
•Close All
• Cascade
• Tile Horizontally
• Tile Vertically
HELP
• About
• Show PICkit Serial Analyzer Connections communications mode
• Show Even t By tes
– Closes all windows – Cascade windows
– Tile windows horizontally
– Tile windows vertically
– Displays program version information
– Displays Event Marker code for current communication mode
– Opens new or additional transaction window. Multiple
– Displays pinout for current
3.6.2 Tool Bar

FIGURE 3-9: TOOL BAR

Tool Bar
The Tool Bar gives quick access to often used commands. These commands are also available from the Menu Bar.
•View: Basic
• Reset
• Basic Communications communications mode selected
/Advanced – toggles between Basic and Advanced views
– Resets the PICkit Serial Analyzer if an error condition is present
– Displays the Basic Operations window for the
3.6.3 Status Col umn
The Status Column displays status information for the selected serial communications mode. In Ba sic V iew m ode, a simpl ified st atus i s disp layed a s show n in Fi gure 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 (I status window for the particular serial communications mode.
2
C, SPI, USART). The following chapters give more detailed explanation of the
© 2007 Microchip Technology Inc. DS51647A-page 23
PICkit™ Serial Analyzer User’s Guide

FIGURE 3-10: STATUS COLUMN (BASIC VIEW)

FIGURE 3-11: STATUS COLUMN (ADVANCED VIEW)

Status Column
Status Column
3.6.4 Tr ansactions 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>Save to a *.txt or *.rtf file. The file can later be retrieved (File>Open Transactions window.
Additional Transactions windows can be displayed. From the PICkit Serial Analyzer menu bar , sel ect Window > New Transaction Window will log the current commands and data.
DS51647A-page 24 © 2007 Microchip Technology Inc.
. The active Transactions window
) and displayed in the
)
Loading...
+ 90 hidden pages