Getting Started with pic kit 3

    Call for Price

    Programmers and EmulatorsAn overview of the PICkit 3 programmer/debugger system is given.PICkit 3 Programmer/Debugger Defined,How the PICkit 3 Programmer/Debugger Helps You,PICkit 3 Programmer/Debugger Components,Device and Feature Support

    SKU: pic kit3

    Description

    GETTING STARTED

    Introduction

    An overview of the PICkit 3 programmer/debugger system is given.

    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.20 or greater) software on a Windows® platform. The PICkit 3 programmer/debugger is an integral part of the development engineer’s toolsuite. The application usage can vary from software development to hardware integration.

    The PICkit 3 programmer/debugger is a debugger system used for hardware and software development of Microchip PIC® microcontrollers (MCUs) and dsPIC® Digital Signal Controllers (DSCs) that are based on In-Circuit Serial Programming™ (ICSP™) and Enhanced In-Circuit Serial Programming 2-wire serial interfaces. In addition to debugger functions, the PICkit 3 programmer/debugger system also may be used as a development programmer.

    The debugger system executes code like an actual device because it uses a device with built-in emulation circuitry, instead of a special debugger chip, for emulation. All available features of a given device are accessible interactively, and can be set and modified by the MPLAB IDE interface.

    The PICkit 3 debugger was developed for emulating embedded processors with debug facilities. The PICkit 3 features include:

    ☞Full-speed USB support using Windows standard drivers

    ☞Real-time execution

    ☞Processors run at maximum speeds

    ☞Built-in over-voltage/short circuit monitor

    ☞Low voltage to 5V (1.8-5V range)

    ☞Diagnostic LEDs (power, active, status)

    ☞Read/write program and data memory of microcontroller

    ☞Erase of all memory types (EEPROM, ID, configuration and program) with verification

    ☞Peripheral freeze at breakpoint

    1-1: PICkit™ 3 MCU PROGRAMMER/DEBUGGER

    FIGURE 1-1: PICkit™ 3 MCU PROGRAMMER/DEBUGGER

    Lanyard Connection

    A convenient lanyard connection is available on the programmer.

    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.

    Pin 1 Marker

    This marker designates the location of pin 1 for proper connector alignment.

    Programming Connector

    The programming connector is a 6-pin header (0.100″ spacing) that connects to the target device. See the pinout specification in Figure 1-2.

     PICKIT™ 3 PROGRAMMER CONNECTOR PINOUT

    FIGURE 1-2: PICKIT™ 3 PROGRAMMER CONNECTOR PINOUT

    Status LEDs

    The Status LEDs indicate the status of the PICkit 3.

    1. Power (green) – Power is supplied to the PICkit 3 via the USB port.

    2. Active (blue) – The PICkit 3 has connection to the PC USB port and the communication link is active.

    3. Status: Busy (yellow) – The PICkit 3is busy with a function in progress, such as programming. Error (red) – The PICkit 3 has encountered an error.

    How the PICkit 3 programmer/debugger Helps You

    The PICkit 3 programmer/debugger allows you to:

    ☞Debug your application on your own hardware in real time

    ☞Debug with hardware breakpoints

    ☞Set breakpoints based on internal events

    ☞Monitor internal file registers

    ☞Emulate at full speed

    ☞Program your device

    PICkit 3 programmer/debugger Components

    The components of the PICkit 3 programmer/debugger system are:

    PICkit 3 with indicator lights for power, activity and status.

    ☞USB cable to provide communications between the debugger and a PC and to provide power to the debugger.

    ☞CD-ROM with MPLAB IDE software and on-line documentation.

     BASIC DEBUGGER SYSTEM

    FIGURE 1-3: BASIC DEBUGGER SYSTEM

    Additional hardware that may be ordered separately:

    PICkit 3 Debug Express Kit which includes: – a 44-pin demo board with a PIC18F45K20 MCU – free version of MPLAB C Compiler for PIC18 MCUs – easy-to-understand lessons and tutorials – other software utilities, examples with source code and full documentation

    ☞Transition socket

    ☞ICD headers

    ☞MPLAB IDE processor extension kits

    Device and Feature Support

    Table 1-1 and Table 1-2 show the support for devices and device features.

    TABLE 1-1: 16-BIT (DATA MEMORY) DEVICES

    Feature

    dsPIC33F, PIC24F/H

    dsPIC30F SMPS(1)

    dsPIC30F

    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(2)

    C

    C

    C

    Break on data fetch or write

    C

    C

    C

    Break on stack overflow

    N

    N

    N

    Stopwatch

    C

    C

    N

    Pass counter

    C

    C

    C

    WDT overflow

    C

    C

    N

    Standard speed communication

    C

    C

    C

    Processor Pak

    F

    F

    N

    Legend:

    C = Current support D = Support dependent on device F = No support now, but planned in the future N = Support not available

    Note 1: Current Switch Mode Power Supply (SMPS) devices: dsPIC30F1010/2020/2023. 2: This feature operates differently depending on the selected device.

    TABLE 1-2: 8-BIT (DATA MEMORY) DEVICES

    Feature

    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

    Legend:

    C = Current support F = No support now, but planned in the future N = Support not available Note 1: This feature operates differently depending on the selected device.

    THEORY OF OPERATION

    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.

    PICkit 3 vs. PICkit 2

    ☞Debugger to Target Communication

    ☞Communication Connections

    ☞Debugging

    ☞Requirements for Debugging

    ☞Programming

    ☞Resources Used by the Debugger

    PICkit 3VS. PICkit 2

    The PICkit 3 programmer/debugger system is similar in function to the PICkit 2 in-circuit debugger system. Similarities of the two debuggers include:

    ☞Powered via USB cable to PC

    ☞Provides a programmable voltage power supply The PICkit 3 differs from the PICkit 2 by providing:

    ☞Extended EE program image space (512 Kbytes)

    ☞True voltage reference

    ☞Increased voltage range (1.8-5V VDD; 1.8-14V VPP)

    Debugger to Target Communication

    The debugger system configurations are discussed in the following sections.

    CAUTION

    Do not change hardware connections while the PICkit 3 or target is powered.

    Standard ICSP Device Communication

    The debugger system can be configured to use standard ICSP communication for both programming and debugging functions. This 6-pin connection is the same one used by the PICkit 2 programmer/debugger.

    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.

    STANDARD DEBUGGER SYSTEM – DEVICE WITH ON-BOARD ICE CIRCUITRY

    FIGURE 2-1: STANDARD DEBUGGER SYSTEM – DEVICE WITH ON-BOARD ICE CIRCUITRY

    STANDARD DEBUGGER SYSTEM – ICE DEVICE

    FIGURE 2-2: STANDARD DEBUGGER SYSTEM – ICE DEVICE

    Communication Connections

    Communication Target Connections

    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: TARGET CONNECTOR PINOUT


    Feature

    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

    USING AN ADAPTER

    Use the AC164110 adapter between the PICkit 3 programmer/debugger and the target device with the modular interface (six conductor) cable. The pin numbering for the connector is shown from the bottom of the target PC board in Figure 2-3.

    Note:

    Cable connections at the debugger and target are mirror images of each other, i.e., pin 1 on one end of the cable is connected to pin 6 on the other end of the cable. See Section 10.6.2.3 “Modular Cable Specification”.

    USING AN ADAPTER

    FIGURE 2-3: STANDARD RJ-11 CONNECTION AT TARGET

    Target Connection Circuitry

    Figure 2-4 shows the interconnections of the PICkit 3 programmer/debugger to the connector on the target board. The diagram also shows the wiring from the connector to a device on the target PC board. A pull-up resistor (usually around 10 kO) is recommended to be connected from the VPP/MCLR line to VDD so that the line may be strobed low to reset the device.

    STANDARD CONNECTION TARGET CIRCUITRY

    FIGURE 2-4: STANDARD CONNECTION TARGET CIRCUITRY

    Target Powered

    operation: pins 1 (VPP/MCLR), 5 (PGC) and 4 (PGD). Pins 2 (VDD) and 3 (VSS) are shown on Figure 2-4 for completeness. PICkit 3 has two configurations for powering the target device: internal debugger and external target power.

    The recommended source of power is external and derived from the target application. In this configuration, target VDD is sensed by the debugger to allow level translation for the target low voltage operation. If the debugger does not sense voltage on its VDD line (pin 2 of the interface connector), it will not operate.

    Debugger Powered

    The internal debugger power is limited to 30 mA. This may be of benefit for very small applications that have the device VDD separated from the rest of the application circuit for independent programming, but is not recommended for general usage as it imposes more current demands from the USB power system derived from the PC.

    Not all devices have the AVDD and AVSS lines, but if they are present on the target device, all must be connected to the appropriate levels in order for the debugger to operate. They cannot be left floating.

    In general, it is recommended that all VDD/AVDD and VSS/AVSS lines be connected to the appropriate levels. Also, devices with a VCAP line (PIC18FXXJ for example) should be connected to the appropriate capacitor or level.

    Note:

    The interconnection is very simple. Any problems experienced are often caused by other connections or components on these critical lines that interfere with the operation of the PICkit 3 programmer/debugger, as discussed in the following section.

    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.

    IMPROPER CIRCUIT COMPONENTS

    FIGURE 2-5: IMPROPER CIRCUIT COMPONENTS

    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 kO pull-down resistors in the debugger.

    ☞Do not use capacitors on PGC/PGD – they will prevent fast transitions on data and clock lines during programming and debug communications.

    ☞Do not use capacitors on MCLR – they will prevent fast transitions of VPP. A simple pull-up resistor is generally sufficient.

    ☞Do not use diodes on PGC/PGD – they will prevent bidirectional communication between the debugger and the target device.

    Debugging

    1. Program the code into the target and activate special debug functions (see the next section for details).

    2. Use the debugger to set breakpoints and run.

    If the target device cannot be programmed correctly, the PICkit 3 programmer/debugger will not be able to debug.

    Figure 2-6 shows the basic interconnections required for programming. Note that this is the same as Figure 2-4, but for the sake of clarity, the VDD and VSS lines from the debugger are not shown.

    PROPER CONNECTIONS FOR PROGRAMMING

    FIGURE 2-6: PROPER CONNECTIONS FOR PROGRAMMING

    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. To verify that the part has been programmed correctly, clocks are sent to PGC and data is read back from PGD. This conforms to the ICSP protocol of the device under development.

    Requirements for Debugging

    To debug (set breakpoints, see registers, etc.) with the PICkit 3 programmer/debugger system, there are critical elements that must be working correctly:

    ☞The debugger must be connected to a PC. It must be powered by the PC via the USB cable, and it must be communicating with the MPLAB IDE software via the USB cable. See Chapter 3. “Installation” for details.

    ☞The debugger must be connected as shown to the VPP, PGC and PGD pins of the target device with the modular interface cable (or equivalent). VSS and VDD are also required to be connected between the debugger and target device.

    ☞The target device must have power and a functional, running oscillator. If the target device does not run, for any reason, the PICkit 3 programmer/debugger cannot debug.

    ☞The target device must have its configuration words programmed correctly: – The oscillator Configuration bits should correspond to RC, XT, etc., depending upon the target design. – For some devices, the Watchdog Timer is enabled by default and needs to be disabled. – The target device must not have code protection enabled. – The target device must not have table read protection enabled.

    ☞LVP should be disabled.Once the above conditions are met, you may proceed to the following:

    ☞Sequence of Operations Leading to Debugging

    ☞Debugging Details

    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.

    ☞When Debugger>Program is selected, the application code is programmed into the device’s memory via the ICSP protocol as described above.

    ☞A small “debug executive” program is loaded into the high area of program memory of the target device automatically by MPLAB IDE. Since the debug executive must reside in program memory, the application program must not use this reserved space. Some devices have special memory areas dedicated to the debug executive. Check your device data sheet for details.

    ☞Special “in-circuit debug” registers in the target device are enabled. These allow the debug executive to be activated by the debugger.

    ☞The target device is held in reset by keeping the VPP/MCLR line low.

    Debugging Details

    Figure 2-7 illustrates the PICkit 3 programmer/debugger system when it is ready for debugging.

    PICkit™ 3 DEBUGGER READY FOR DEBUGGING

    FIGURE 2-7: PICkit™ 3 DEBUGGER READY FOR DEBUGGING

    Typically, in order to find out if an application program will run correctly, a breakpoint is set early in the program code. When a breakpoint is set from the user interface of MPLAB IDE, the address of the breakpoint is stored in the special internal debug registers of the target device. Commands on PGC and PGD communicate directly to these registers to set the breakpoint address.

    Next, the Debugger>Run function or the Run icon (forward arrow) is usually pressed from MPLAB IDE. The debugger will then tell the debug executive to run. The target will start from the reset vector and execute until the Program Counter reaches the breakpoint address previously stored in the internal debug registers.

    After the instruction at the breakpoint address is executed, the in-circuit debug mechanism of the target device “fires” and transfers the device’s Program Counter to the debug executive (much like an interrupt) and the user’s application is effectively 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. It uses some locations on the stack for its temporary variables. If the device does not run, for whatever reason, such as no oscillator, a faulty power supply connection, shorts on the target board, etc., then the debug executive cannot communicate to the PICkit 3 programmer/debugger and MPLAB IDE will issue an error message.

    Another way to get a breakpoint is to press the MPLAB IDE’s Halt button (the “pause” symbol to the right of the Run arrow). This toggles the PGC and PGD lines so that the in-circuit debug mechanism of the target device switches the Program Counter from the user’s code in program memory to the debug executive. Again, the target application program is effectively halted, and MPLAB IDE uses the debugger communications with the debug executive to interrogate the state of the target device.

    Programming

    Use the PICkit 3 programmer/debugger as a programmer to program an actual (non -ICE/-ICD) device, i.e., a device not on a header board. Select “PICkit 3” from Programmer>Select Programmer and compile/assemble your application code with the “Build Configuration” list box on the MPLAB IDE toolbar set to “Release”. Also, it may be set by selecting Project>Build Configuration>Release.

    All debug features are turned off or removed when the debugger is used as a programmer. When using the Programmer>Program selection to program a device, MPLAB IDE will disable the in-circuit debug registers so the PICkit 3 programmer/debugger will program only the target application code and the Configuration bits (and EEPROM data, if available and selected) into the target device. The debug executive will not be loaded. As a programmer, the debugger can only toggle the MCLR line to reset and start the target. A breakpoint cannot be set, and register contents cannot be seen or altered.

    The PICkit 3 programmer/debugger

    Additional information

    Weight0.000000 kg

    Reviews

    There are no reviews yet.

    Be the first to review “Getting Started with pic kit 3”

    Your email address will not be published. Required fields are marked *

    five × four =

    This site uses Akismet to reduce spam. Learn how your comment data is processed.