PICkit™ 3 Programmer/Debugger User’s Guide © 2009 Microchip Technology Inc.
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.
PICkit™ 3 USER’S GUIDE Table of Contents Preface ........................................................................................................................... 1 Chapter 1. Overview 1.1 Introduction ..................................................................................................... 9 1.2 PICkit 3 Programmer/Debugger Defined ........................................................ 9 1.3 How the PICkit 3 Programmer/Debugger Helps You ................................... 11 1.
PICkit™ 3 User’s Guide Chapter 6. Troubleshooting First Steps 6.1 Introduction ................................................................................................... 35 6.2 The 5 Questions to Answer First .................................................................. 35 6.3 Top 10 Reasons Why You Can’t Debug ...................................................... 35 6.4 Other Things to Consider ............................................................................. 36 Chapter 7.
PICkit™ 3 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.
PICkit™ 3 User’s Guide DOCUMENT LAYOUT This document describes how to use the PICkit 2as a development tool to emulate and debug firmware on a target board. The manual layout is as follows: • Chapter 1. Overview – An overview of the PICkit 3 programmer/debugger. • Chapter 2. Theory of Operation – A simplified description of how the PICkit 3 programmer/debugger works. • Chapter 3. Installation – How to install the PICkit 3 programmer/debugger. • Chapter 4.
Preface CONVENTIONS USED IN THIS GUIDE The following conventions may appear in this documentation: DOCUMENTATION CONVENTIONS Description Represents Examples Arial font: Italic Initial caps Referenced books MPLAB® IDE User’s Guide Emphasized text ...is the only compiler...
PICkit™ 3 User’s Guide 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 PICkit 2. Other useful documents are listed below. The following Microchip documents are available and recommended as supplemental reference resources.
Preface 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.
PICkit™ 3 User’s Guide 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.
PICkit™ 3 USER’S GUIDE Part 1 – Getting Started Chapter 1. Overview....................................................................................................... 9 Chapter 2. Theory of Operation .................................................................................. 15 Chapter 3. Installation.................................................................................................. 23 Chapter 4. General Setup ........................................................................
PICkit™ 3 User’s Guide NOTES: DS51795A-page 8 © 2009 Microchip Technology Inc.
PICkit™ 3 USER’S GUIDE Chapter 1. Overview 1.1 INTRODUCTION An overview of the PICkit 3 programmer/debugger system is given. • • • • 1.2 PICkit 3 Programmer/Debugger Defined How the PICkit 3 Programmer/Debugger Helps You PICkit 3 Programmer/Debugger Components Device and Feature Support PICKIT 3 PROGRAMMER/DEBUGGER DEFINED The PICkit 3 programmer/debugger (see Figure 1-1) is a simple, low-cost in-circuit debugger that is controlled by a PC running MPLAB IDE (v8.
PICkit™ 3 User’s Guide FIGURE 1-1: PICkit™ 3 MCU PROGRAMMER/DEBUGGER 2 1 Legend: 1 – Lanyard Connection 2 – USB Port Connection 3 – Pin 1 Marker 4 – Programming Connector 5 – Status LEDs 6 – Push Button (future use) 6 5 3 4 1.2.1 Lanyard Connection A convenient lanyard connection is available on the programmer. 1.2.2 USB Port Connection The USB port connection is a USB mini-B connector. Connect the PICkit 3 to the PC using the supplied USB cable. 1.2.
Overview FIGURE 1-2: PICKIT™ 3 PROGRAMMER CONNECTOR PINOUT Pin 1 Indicator Pin Description* 1 2 3 4 5 6 1 = VPP/MCLR 2 = VDD Target 3 = VSS (ground) 4 = ICSPDAT/PGD 5 = ICSPCLK/PGC 6 = LVP * Note: 1.2.5 The 6-pin header (0.100" spacing) accepts 0.025" square pins. The programming connector pin functions are different for programming Serial EEPROMS and HCS devices. See the ReadMe file for the PICkit 3 (Help>Readme) included with the MPLAB IDE software for these pinouts.
PICkit™ 3 User’s Guide 1.4 PICKIT 3 PROGRAMMER/DEBUGGER COMPONENTS The components of the PICkit 3 programmer/debugger system are: 1. PICkit 3 with indicator lights for power, activity and status. 2. USB cable to provide communications between the debugger and a PC and to provide power to the debugger. 3. CD-ROM with MPLAB IDE software and on-line documentation.
Overview 1.5 DEVICE AND FEATURE SUPPORT Table 1-1 and Table 1-2 show the support for devices and device features.
PICkit™ 3 User’s Guide TABLE 1-2: 8-BIT (DATA MEMORY) DEVICES PIC18FXXJ PIC18F, PIC18F Enh, PIC18FXXK PIC12F, PIC16F Reset application C C C Run, Halt C C C Single step C C C Animate C C C Full-speed emulation C C C Hardware breakpoints C C C Peripheral freeze(1) C C C Break on data fetch or write C C N Break on stack overflow C C N Stopwatch C N N Pass counter C C N WDT overflow C N N Standard speed communication C C C Processor Pak F F F Feature
PICkit™ 3 USER’S GUIDE Chapter 2. Theory of Operation 2.1 INTRODUCTION A simplified description of how the PICkit 3 programmer/debugger system works is provided here. It is intended to provide enough information so a target board can be designed that is compatible with the debugger for both emulation and programming operations. The basic theory of in-circuit emulation and programming is described so that problems, if encountered, are quickly resolved. • • • • • • • 2.2 PICkit 3 vs.
PICkit™ 3 User’s Guide The modular cable can be either (1) inserted into a matching socket at the target, where the target device is on the target board (Figure 2-1), or (2) inserted into a standard adapter/header board combo (available as a Processor Pak), which in then plugged into the target board (Figure 2-2). Note: Older header boards used a 6-pin (RJ-11) connector instead of an 8-pin connector, so these headers may be connected to the debugger with the AC164110 ICSP adapter.
Theory of Operation 2.4 COMMUNICATION CONNECTIONS 2.4.1 Communication Target Connections 2.4.1.1 USING SINGLE IN-LINE CONNECTOR Use the 6-pin in-line connector between the PICkit 3 programmer/debugger and the target board connector. See Figure 2-1. Also see Table 2-1 and Section 10.6 “Standard Communication Hardware”. TABLE 2-1: 2.4.1.
PICkit™ 3 User’s Guide FIGURE 2-4: STANDARD CONNECTION TARGET CIRCUITRY User Reset Application PC Board VDD Device 4.7K-10K VPP/MCLR 1 PGC 5 PGD 4 VSS 3 AVDD AVSS 2.4.3 2 Interface Connector Target Powered In the following descriptions, only three lines are active and relevant to core debugger operation: pins 1 (VPP/MCLR), 5 (PGC) and 4 (PGD). Pins 2 (VDD) and 3 (VSS) are shown on Figure 2-4 for completeness.
Theory of Operation 2.4.5 Circuits That Will Prevent the Debugger From Functioning Figure 2-5 shows the active debugger lines with some components that will prevent the PICkit 3 debugger system from functioning. FIGURE 2-5: IMPROPER CIRCUIT COMPONENTS 1 VPP/MCLR No! No! No! 5 PGC 4 PGD No! Interface Connector Specifically, these guidelines must be followed: • Do not use pull-ups on PGC/PGD – they will disrupt the voltage levels, since these lines have 4.7 kΩ pull-down resistors in the debugger.
PICkit™ 3 User’s Guide FIGURE 2-6: PROPER CONNECTIONS FOR PROGRAMMING VDD Programming Voltage +5V 1 Internal Circuits 4.7 kΩ 5 4 VPP/MCLR PGC PGD 4.7 kΩ VSS A simplified diagram of some of the internal interface circuitry of the PICkit 3 programmer/debugger is shown. For programming, no clock is needed on the target device, but power must be supplied. When programming, the debugger puts programming levels on VPP/MCLR, sends clock pulses on PGC and serial data via PGD.
Theory of Operation 2.6.1 Sequence of Operations Leading to Debugging Given that the requirements for debugging (see previous section) are met, these actions can be performed when the PICkit 3 programmer/debugger is set as the current debugger from the MPLAB IDE menu (Debugger>Select Tool>PICkit 3): • The application code is compiled/assembled by selecting Project>Build Configuration>Debug.
PICkit™ 3 User’s Guide halted. The debugger communicates with the debug executive via PGC and PGD, gets the breakpoint status information and sends it back to MPLAB IDE. MPLAB IDE then sends a series of queries to the debugger to get information about the target device, such as file register contents and the state of the CPU. These queries are ultimately performed by the debug executive. The debug executive runs just like an application in program memory.
PICkit™ 3 USER’S GUIDE Chapter 3. Installation 3.1 INTRODUCTION How to install the PICkit 3 programmer/debugger system is discussed. • • • • 3.2 Installing the Software Connecting the Target Setting Up the Target Board Setting Up MPLAB IDE INSTALLING THE SOFTWARE To install the MPLAB IDE software, first acquire the latest MPLAB IDE installation executable (MPxxxxx.exe, where xxxxx represents the version of MPLAB IDE) from either the Microchip web site (www.microchip.
PICkit™ 3 User’s Guide 3.4 SETTING UP THE TARGET BOARD 3.4.1 Using Production Devices For production devices, the debugger may be connected directly to the target board. The device on the target board must have built-in debug circuitry in order for the PICkit 3 programmer/debugger to perform emulation with it. Consult the device data sheet to see if the device has the needed debug circuitry, i.e., it should have a “Background Debugger Enable” Configuration bit.
Installation FIGURE 3-2: USING AN ICD HEADER BOARD Many Mid-Range PIC microcontrollers and all PIC18 and 16-bit PIC microcontroller devices do not require an ICD header and can be debugged directly through the ICSP programming connections. 3.4.4 Powering the Target These are configuration essentials: • When using the USB connection, PICkit 3 can be powered from the PC but it can only provide a limited amount of current, up to 30 mA, at VDD from 1.8-5V to a small target board.
PICkit™ 3 User’s Guide NOTES: DS51795A-page 26 © 2009 Microchip Technology Inc.
PICkit™ 3 USER’S GUIDE Chapter 4. General Setup 4.1 INTRODUCTION How to get started using the PICkit 3 programmer/debugger is discussed. • • • • • • • 4.2 Starting the MPLAB IDE Software Creating a Project Viewing the Project Building the Project Setting Configuration Bits Setting the Debugger or Programmer Debugger/Programmer Limitations STARTING THE MPLAB IDE SOFTWARE After installing the MPLAB IDE software (Section 3.
PICkit™ 3 User’s Guide 4.4 VIEWING THE PROJECT After the Project Wizard has created a project, the project and its associated files are visible in the Project window. Right click on any line in the project window tree to pop up a menu with additional options for adding and removing files. See MPLAB IDE documentation for more detail on using the Project window. 4.5 BUILDING THE PROJECT After the project is created, the application needs to be built.
General Setup 4.8 DEBUGGER/PROGRAMMER LIMITATIONS For a complete list of debugger limitations for your device, please see the PICkit 3 on-line help file in MPLAB IDE by selecting Help>Topics>PICkit 3 and click OK. © 2009 Microchip Technology Inc.
PICkit™ 3 User’s Guide NOTES: DS51795A-page 30 © 2009 Microchip Technology Inc.
PICkit™ 3 USER’S GUIDE Chapter 5. PICkit 3 Debug Express 5.1 INTRODUCTION The PICkit 3 Debug Express kit works in conjunction with the MPLAB IDE application to run, stop and single-step through programs. One or more breakpoints can be set and the processor can be reset. Once the processor is stopped, the register’s contents can be examined and modified. For more information on how to use MPLAB IDE, reference the following documentation: • MPLAB® IDE User’s Guide (DS51519) • MPLAB® IDE On-line Help 5.
PICkit™ 3 User’s Guide FIGURE 5-1: 5.3.3 CONNECTING THE DEMO BOARD TO THE PICkit™ 3 Configuration Bits and Debug Express PIC microcontroller devices that do not require an ICD Header and may be debugged directly contain a DEBUG bit in the Configuration Word(s) that enables and disables the debug mode on the PIC microcontroller. This bit is automatically set appropriately by the MPLAB IDE when using PICkit 3 Debug Express and should not be specified in source code configuration settings.
PICkit™ 3 USER’S GUIDE Part 2 – Troubleshooting Chapter 6. Troubleshooting First Steps ..................................................................... 35 Chapter 7. Frequently Asked Questions (FAQs) ....................................................... 37 Chapter 8. Error Messages.......................................................................................... 41 © 2009 Microchip Technology Inc.
PICkit™ 3 User’s Guide NOTES: DS51795A-page 34 © 2009 Microchip Technology Inc.
PICkit™ 3 USER’S GUIDE Chapter 6. Troubleshooting First Steps 6.1 INTRODUCTION If you are having problems with PICkit 3 programmer/debugger operation, start here. • The 5 Questions to Answer First • Top 10 Reasons Why You Can’t Debug • Other Things to Consider 6.2 THE 5 QUESTIONS TO ANSWER FIRST 1. What device are you working with? Often an upgrade to a newer version of MPLAB IDE is required to support newer devices. That is, yellow light = untested support. 2.
PICkit™ 3 User’s Guide 6.4 OTHER THINGS TO CONSIDER 1. It is possible the error was a one-time glitch. Try the operation again. 2. There may be a problem programming in general. As a test, switch to programmer mode and program the target with the simplest application possible (e.g., a program to blink an LED). If the program will not run, then you know that something is wrong with the target setup. 3. It is possible that the target device has been damaged in some way (e.g., over current.
PICkit™ 3 USER’S GUIDE Chapter 7. Frequently Asked Questions (FAQs) 7.1 INTRODUCTION Look here for answers to frequently asked questions about the PICkit 3 programmer/debugger system. • How Does It Work • What’s Wrong 7.2 HOW DOES IT WORK • What's in the silicon that allows it to communicate with the PICkit 3 programmer/debugger? PICkit 3 programmer/debugger can communicate with Flash silicon via the ICSP interface. It uses the debug executive downloaded into program or test memory.
PICkit™ 3 User’s Guide • Will the PICkit 3 slow down the running of the program? No, the device will run at any device speed as specified in the data sheet. • Is it possible to debug a dsPIC DSC running at any speed? The PICkit 3 is capable of debugging at any device speed as specified in the device’s data sheet. • What is the function of pin 6, the LVP pin? Pin 6 is reserved for the LVP (Low-Voltage Programming) connection. 7.
Frequently Asked Questions (FAQs) • I have finished debugging my code. Now I’ve programmed my part, but it won’t run. What’s wrong? Some things to consider are: - Have you selected the debugger as a programmer and then tried to program a header board? A header board contains an -ICE/-ICD version of the device and may not function like the actual device. Only program regular devices with the debugger as a programmer.
PICkit™ 3 User’s Guide NOTES: DS51795A-page 40 © 2009 Microchip Technology Inc.
PICkit™ 3 USER’S GUIDE Chapter 8. Error Messages 8.1 INTRODUCTION The PICkit 3 programmer/debugger produces many different error messages; some are specific and others can be resolved with general corrective actions. • Specific Error Messages • General Corrective Actions 8.2 SPECIFIC ERROR MESSAGES PICkit 3 programmer/debugger error messages are listed below in numeric order. Note: Numbers may not yet appear in displayed messages.
PICkit™ 3 User’s Guide PK3Err0012: Download debug exec failed If you receive this error while attempting to program from the Debugger menu: 1. 2. 3. 4. Deselect the debugger as the debug tool. Close your project and then close MPLAB IDE. Restart MPLAB IDE and re-open your project. Reselect the debugger as your debug tool and attempt to program your target device again. If this does not work, see Section 8.3.4 “Corrupted Installation Actions”. PK3Err0013: NMMR register write failed.
Error Messages PK3Err0029: Communication failure. Unexpected command echo response %x received from PICkit 3. See Section 8.3.3 “Debugger-to-PC Communication Error Actions”. PK3Err0030: Unable to read/find firmware File %s. If the Hex file exists: • Reconnect and try again. • If this does not work, the file may be corrupted. Reinstall MPLAB IDE. If the Hex file does not exist: • Reinstall MPLAB IDE. PK3Err0031: Failed to get PC. PK3Err0032: Failed to set PC. See Section 8.3.
PICkit™ 3 User’s Guide See Section 8.3.2 “Debugger-to-Target Communication Error Actions”. PK3Err0047: Bootloader download failed. See Section 8.3.3 “Debugger-to-PC Communication Error Actions”. PK3Err0052: The current PICkit 3 hardware version %x, is out of date. This version of MPLAB IDE will support only version %x or higher. Did you click Cancel when asked to download the latest firmware? If so, you will need to download it now. Select Debugger>Settings, Configuration tab, and click Manual Download.
Error Messages 8.3.1 Read/Write Error Actions If you receive a read or write error: 1. Did you hit Abort? This may produce read/write errors. 2. Try the action again. It may be a one-time error. 3. Ensure that the target is powered and at the correct voltage levels for the device. See the device data sheet for required device voltage levels. 4. Ensure that the debugger-to-target connection is correct (PGC and PGD are connected.) 5.
PICkit™ 3 User’s Guide 8.3.7 Internal Error Actions Internal errors are unexpected and should not happen. They are primarily used for internal Microchip development. The most likely cause is a corrupted installation (Section 8.3.4 “Corrupted Installation Actions”). Another likely cause is exhausted system resources. 1. Try rebooting your system to free up memory. 2. Make sure you have a reasonable amount of free space on your hard drive (and that it is not overly fragmented.
PICkit™ 3 USER’S GUIDE Part 3 – Reference Chapter 9. Debugger Function Summary .................................................................. 49 Chapter 10. Hardware Specification ........................................................................... 59 © 2009 Microchip Technology Inc.
PICkit™ 3 User’s Guide NOTES: DS51795A-page 48 © 2009 Microchip Technology Inc.
PICkit™ 3 USER’S GUIDE Chapter 9. Debugger Function Summary 9.1 INTRODUCTION A summary of the PICkit 3 programmer/debugger functions on menus, in windows and on dialogs is listed here. • • • • 9.
PICkit™ 3 User’s Guide For C code, this command executes one line of C code, which may mean the execution of one or more assembly instruction, and then halts. After execution, all the windows are updated. Note: Do not step into a SLEEP instruction. Step Over F8 Execute the instruction at the current program counter location. At a CALL instruction, Step Over executes the called subroutine and halts at the address following the CALL. If the Step Over is too long or appears to “hang”, click Halt.
Debugger Function Summary 9.2.2 Right Mouse Button Debugger Menu These debugger menu options will appear on the right mouse menus in code displays, such as program memory and source code files. Descriptions of other menu options not listed here can be found in the MPLAB IDE Help or the MPLAB Editor Help. Set Breakpoint Set or remove a breakpoint at the currently selected line. Breakpoints Remove, enable or disable all breakpoints. Run To Cursor Run the program to the current cursor location.
PICkit™ 3 User’s Guide 9.3.1.1 BREAKPOINT DIALOG WINDOW Information about each breakpoint is visible in this window.
Debugger Function Summary 9.3.2 Set Breakpoint Dialog Click Add Breakpoint in the Breakpoints Dialog to display this dialog. Select a breakpoint for the Breakpoints dialog here. 9.3.2.1 PROGRAM MEMORY TAB Set up a program memory breakpoint here. TABLE 9-3: PROGRAM MEMORY BREAKPOINT Control Function Address Location of breakpoint in hex Breakpoint Type The type of program memory breakpoint. See the device data sheet for more information on table reads/writes.
PICkit™ 3 User’s Guide 9.3.3 Stopwatch Dialog Click Stopwatch in the Breakpoints Dialog to display the Stopwatch Setup dialog. Use the stopwatch with breakpoints to time code execution. The stopwatch allows timing from one breakpoint/trigger condition to the next. The stopwatch value is in decimal. TABLE 9-5: STOPWATCH SETUP Control Function Start Condition Select an available breakpoint or trigger condition to start the stopwatch.
Debugger Function Summary 9.4 PROGRAMMING FUNCTIONS When you select the PICkit 3 programmer/debugger from the Programmer menu, program items will be added to the following MPLAB IDE functions: • Programmer Menu • Toolbars/Status Bar 9.4.1 Programmer Menu Program Program specified memory areas: program memory, Configuration bits, ID locations and/or EEPROM data. See the Settings dialog for programming options.
PICkit™ 3 User’s Guide 9.5 SETTINGS DIALOG Select either Debugger>Settings or Programmer>Settings to open the Settings dialog and set up the PICkit 3 programmer/debugger. Note: • • • • • • • • • Tabs displayed will depend on the selected device.
Debugger Function Summary TABLE 9-6: PROGRAM MEMORY OPTIONS (CONTINUED) Automatically Program after successful build After the application code successfully builds, program this code into the device. Run after successful program After the application code is successfully programmed into the target device, run the code. 9.5.2 Settings Dialog, Configuration Tab Configure debugger operation on this tab. TABLE 9-7: CONFIGURATION ITEMS Download Firmware Set up firmware download options.
PICkit™ 3 User’s Guide 9.5.5 Settings Dialog, Clock Tab The debug clock mode is selected on this tab. Check the box for “FRC in debug mode” to use the fast RC clock while debugging. Device emulation occurs at the speed of the processor. If it is running at low frequency (for example 32kHz), all operations such as stepping, refreshing the watch window, etc. are slow. However, some processors have a built-in Fast RC oscillator.
PICkit™ 3 USER’S GUIDE Chapter 10. Hardware Specification 10.1 INTRODUCTION The hardware and electrical specifications of the PICkit 3 programmer/debugger system are detailed. 10.2 HIGHLIGHTS This chapter discusses: • • • • • 10.3 Declaration of Conformity USB Port/Power PICkit 3 Programmer/Debugger Standard Communication Hardware Target Board Considerations DECLARATION OF CONFORMITY We Microchip Technology, Inc. 2355 W. Chandler Blvd.
PICkit™ 3 User’s Guide 10.4 USB PORT/POWER The PICkit 3 programmer/debugger is connected to the host PC via a mini Universal Serial Bus (USB) port, version 2.0 compliant. The USB connector is located on the top of the pod. The system is capable of reloading the firmware via the USB interface. System power is derived from the USB interface.
Hardware Specification 10.6 STANDARD COMMUNICATION HARDWARE For standard debugger communication with a target (Section 2.3 “Debugger to Target Communication”, “Standard ICSP Device Communication“), use an adapter with an RJ-11 connector. To use this type of communication with a header board, you may need a device-specific Processor Pak, which includes an 8-pin connector header board containing the desired ICE/ICD device and a standard adapter board.
PICkit™ 3 User’s Guide 10.6.2 Modular Cable and Connector For standard communications, a modular cable connects the debugger and the target application. The specifications for this cable and its connectors are listed below. 10.6.2.1 MODULAR CONNECTOR SPECIFICATION • Manufacturer, Part Number – AMP Incorporated, 555165-1 • Distributor, Part Number – Digi-Key, A9031ND The table within Figure 10-2 shows how the modular connector pins on an application correspond to the microcontroller pins.
Hardware Specification 10.6.2.3 MODULAR CABLE SPECIFICATION • Manufacturer, Part Number – Microchip Technology, 07-00024 10.7 TARGET BOARD CONSIDERATIONS The target board should be powered according to the requirements of the selected device (1.8V-5.0V) and the application. Depending on the type of debugger-to-target communications used, there will be some considerations for target board circuitry: • Section 2.4.2 “Target Connection Circuitry” • Section 2.4.
PICkit™ 3 User’s Guide NOTES: DS51795A-page 64 © 2009 Microchip Technology Inc.
PICkit™ 3 USER’S GUIDE Appendix A. PICkit 3 Schematics PICkit 3 Development Programmer/Debugger schematic diagrams are shown here. Demo board schematics are found in their respective user’s guides. FIGURE A-1: PICKIT™ 3 SCHEMATIC DIAGRAM (PAGE 1 OF 2) © 2009 Microchip Technology Inc.
PICkit™ 3 User’s Guide PICKIT™ 3 SCHEMATIC DIAGRAM (PAGE 2 OF 2) USE FIGURE A-2: DS51795A-page 66 © 2009 Microchip Technology Inc.
PICkit™ 3 USER’S GUIDE Appendix B.
PICkit™ 3 User’s Guide Additionally, MCLR is also used as either a high voltage programming signal or as an attention indicator to the device. In order to have trouble free in-circuit debugging, careful planning must be done by the designer to avoid any problems during the application development or production phase of the product. RECOMMENDED CONFIGURATION The signals PGC and PGD are active bidirectional signals driven by the PICkit 3 and target emulation device.
Operational Advisory peripherals and pins which are common to the default PGC/PGD pins, you must select a different channel and make provisions for the required ICSP connections. Likewise, when using MPLAB IDE to communicate with the target using this new channel pin assignment, you must ensure that the Configuration bits in MPLAB IDE match the connection channel in your target. GROUNDING AND AC APPLICATIONS PICkit 3 connects to earth ground from the USB connector interface through the PC.
PICkit™ 3 User’s Guide CORRECTING CROSSTALK In some cases a crosstalk problem may exist when the device is being programmed. Due to the locations of the PGC and PGD pins, crosstalk may degrade the signal and cause the PICkit 3 to fail programming of the target device. To correct this, try the following: • Construct a RJ12 modular cable. Keep the length as short as possible, preferably under 6 inches.
PICkit™ 3 USER’S GUIDE Glossary Absolute Section A section with a fixed (absolute) address that cannot be changed by the linker. Access Memory (PIC18 Only) Special registers on PIC18 devices that allow access regardless of the setting of the Bank Select Register (BSR). Access Entry Points Access entry points provide a way to transfer control across segments to a function which may not be defined at link time. They support the separate linking of boot and secure application segments.
PICkit™ 3 User’s Guide Archive A collection of relocatable object modules. It is created by assembling multiple source files to object files, and then using the archiver to combine the object files into one library file. A library can be linked with object modules and other libraries to create executable code. Archiver A tool that creates and manipulates libraries. ASCII American Standard Code for Information Interchange is a character set encoding that uses 7 binary digits to represent each character.
Glossary Calibration Memory A special function register or registers used to hold values for calibration of a PIC microcontroller on-board RC oscillator or other device peripherals. Central Processing Unit The part of a device that is responsible for fetching the correct instruction for execution, decoding that instruction, and then executing that instruction. When necessary, it works in conjunction with the arithmetic logic unit (ALU) to complete the execution of the instruction.
PICkit™ 3 User’s Guide Data Memory On Microchip MCU and DSC devices, data memory (RAM) is comprised of General Purpose Registers (GPRs) and Special Function Registers (SFRs). Some devices also have EEPROM data memory. Debugging Information Compiler and assembler options that, when selected, provide varying degrees of information used to debug application code. See compiler or assembler documentation for details on selecting debug options.
Glossary Emulation Memory Program memory contained within the debugger. Debugger Hardware that performs emulation. Debugger System The MPLAB ICE 2000 and MPLAB ICE 4000 debugger systems include the pod, processor module, device adapter, target board, cables, and MPLAB IDE software. The PICkit 3 system consists of a pod, a driver (and potentially a receiver) card, target board, cables, and MPLAB IDE software. Endianess The ordering of bytes in a multi-byte object.
PICkit™ 3 User’s Guide Extended Mode In Extended mode, the compiler will utilize the extended instructions (i.e., ADDFSR, ADDULNK, CALLW, MOVSF, MOVSS, PUSHL, SUBFSR and SUBULNK) and the indexed with literal offset addressing. External Label A label that has external linkage. External Linkage A function or variable has external linkage if it can be referenced from outside the module in which it is defined. External Symbol A symbol for an identifier which has external linkage.
Glossary Free-Standing An implementation that accepts any strictly conforming program that does not use complex types and in which the use of the features specified in the library clause (ANSI ‘89 standard clause 7) is confined to the contents of the standard headers , , , , , and . GPR General Purpose Register. The portion of device data memory (RAM) available for general use. Halt A stop of program execution.
PICkit™ 3 User’s Guide Initialized Data Data which is defined with an initial value. In C, int myVar=5; defines a variable which will reside in an initialized data section. Instruction Set The collection of machine language instructions that a particular processor understands. Instructions A sequence of bits that tells a central processing unit to perform a particular operation and can contain data to be used in the operation.
Glossary Librarian See Archiver. Library See Archive. Linker A language tool that combines object files and libraries to create executable code, resolving references from one module to another. Linker Script Files Linker script files are the command files of a linker. They define linker options and describe available memory on the target platform. Listing Directives Listing directives are those directives that control the assembler listing file format.
PICkit™ 3 User’s Guide With standard I/0 signaling, data storage is contingent upon the actual voltage level. Voltage level can be affected by wire length (longer wires increase resistance, which lowers voltage). But with LVDS, data storage is distinguished only by positive and negative voltage values, not the voltage level. Therefore, data can travel over greater lengths of wire while maintaining a clear and consistent data stream. Source: http://www.webopedia.com/TERM/L/LVDS.html.
Glossary Microprocessor Mode One of the possible program memory configurations of PIC17 and PIC18 microcontrollers. In microprocessor mode, the on-chip program memory is not used. The entire program memory is mapped externally. Mnemonics Text instructions that can be translated directly into machine code. Also referred to as opcodes. MPASM™ Assembler Microchip Technology’s relocatable macro assembler for PIC microcontroller devices, KeeLoq® devices and Microchip memory devices.
PICkit™ 3 User’s Guide MPLAB PM3 A device programmer from Microchip. Programs PIC18 microcontrollers and dsPIC digital signal controllers. Can be used with MPLAB IDE or stand-alone. Will obsolete PRO MATE II. MPLAB SIM Microchip’s simulator that works with MPLAB IDE in support of PIC MCU and dsPIC DSC devices. MPLIB™ Object Librarian Microchip’s librarian that can work with MPLAB IDE.
Glossary Octal The base 8 number system that only uses the digits 0-7. The rightmost digit counts ones, the next digit counts multiples of 8, then 82 = 64, etc. Off-Chip Memory Off-chip memory refers to the memory selection option for the PIC17 or PIC18 device where memory may reside on the target board, or where all program memory may be supplied by the debugger. The Memory tab accessed from Options>Development Mode provides the Off-Chip Memory selection dialog box.
PICkit™ 3 User’s Guide Plug-ins The MPLAB IDE has both built-in components and plug-in modules to configure the system for a variety of software and hardware tools. Several plug-in tools may be found under the Tools menu. Pod MPLAB REAL ICE system: The box that contains the emulation control circuitry for the ICE device on the header or target board. An ICE device can be a production device with built-in ICE circuitry or a special ICE version of a production device (i.e., device-ICE).
Glossary Prologue A portion of compiler-generated code that is responsible for allocating stack space, preserving registers and performing any other machine-specific requirement specified in the runtime model. This code executes before any user code for a given function. Prototype System A term referring to a user's target application, or target board. PWM Signals Pulse-Width Modulation Signals. Certain PIC MCU devices have a PWM peripheral.
PICkit™ 3 User’s Guide Relaxation The process of converting an instruction to an identical, but smaller instruction. This is useful for saving on code size. MPLAB ASM30 currently knows how to RELAX a CALL instruction into an RCALL instruction. This is done when the symbol that is being called is within +/- 32k instruction words from the current instruction. Relocatable An object whose address has not been assigned to a fixed location in memory.
Glossary Single Step This command steps though code, one instruction at a time. After each instruction, MPLAB IDE updates register windows, watch variables, and status displays so you can analyze and debug instruction execution. You can also single step C compiler source code, but instead of executing single instructions, MPLAB IDE will execute all assembly level instructions generated by the line of the high level C statement.
PICkit™ 3 User’s Guide Step Over Step Over allows you to debug code without stepping into subroutines. When stepping over a CALL instruction, the next breakpoint will be set at the instruction after the CALL. If for some reason the subroutine gets into an endless loop or does not return properly, the next breakpoint will never be reached. The Step Over command is the same as Single Step except for its handling of CALL instructions.
Glossary Trace An debugger or simulator function that logs program execution. The debugger logs program execution into its trace buffer which is uploaded to MPLAB IDE’s trace window. Trace Memory Trace memory contained within the debugger. Trace memory is sometimes called the trace buffer. Trace Macro A macro that will provide trace information from debugger data.
PICkit™ 3 User’s Guide Watch Window Watch windows contain a list of watch variables that are updated at each breakpoint. Watchdog Timer A timer on a PIC microcontroller that resets the processor after a selectable length of time. The WDT is enabled or disabled and set up using Configuration bits. WDT See Watchdog Timer. Workbook For MPLAB SIM stimulator, a setup for generation of SCL stimulus.
PICkit™ 3 USER’S GUIDE Index Numerics F 44-Pin Demo Board ................................................. 31 Feature Support ....................................................... 13 Firmware Downloads ............................................... 57 Freeze on Halt.......................................................... 38 A Abort Operation...................................................50, 55 Animate .................................................................... 49 AVdd ................
PICkit™ 3 User’s Guide PK3Err0020.............................................................. 42 PK3Err0021.............................................................. 42 PK3Err0022.............................................................. 42 PK3Err0023.............................................................. 42 PK3Err0024.............................................................. 42 PK3Err0025.............................................................. 42 PK3Err0026.......................
Index NOTES: © 2009 Microchip Technology Inc.
WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://support.microchip.com Web Address: www.microchip.