PICkit 3 Programmer Application User's Guide 50002158a
PICkit 3 Programmer Application User's Guide 50002158a
Programmer Application
Users Guide
DS50002158A
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 Microchips 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 Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
FlashFlex, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro,
PICSTART, PIC32 logo, rfPIC, SST, SST Logo, SuperFlash
and UNI/O are registered trademarks of Microchip Technology
Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MTP, SEEVAL and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of
Microchip Technology Inc. in other countries.
Analog-for-the-Digital Age, Application Maestro, BodyCom,
chipKIT, chipKIT logo, CodeGuard, dsPICDEM,
dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial
Programming, ICSP, Mindi, MiWi, MPASM, MPF, MPLAB
Certified logo, MPLIB, MPLINK, mTouch, Omniscient Code
Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit,
PICtail, REAL ICE, rfLAB, Select Mode, SQI, Serial Quad I/O,
Total Endurance, TSHARC, UniWinDriver, WiperLock, ZENA
and Z-Scale are trademarks of Microchip Technology
Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
GestIC and ULPP are registered trademarks of Microchip
Technology Germany II GmbH & Co. KG, a subsidiary of
Microchip Technology Inc., in other countries.
All other trademarks mentioned herein are property of their
respective companies.
2013, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
ISBN: 978-1-62077-170-9
== ISO/TS 16949 ==
DS50002158A-page 2
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Table of Contents
Preface ........................................................................................................................... 5
Chapter 1. Overview
1.1 Introduction ..................................................................................................... 9
1.2 PICkit 3 Programmer Application Defined ...................................................... 9
1.3 PICkit 3 Programmer Tool Defined .............................................................. 10
DS50002158A-page 3
Chapter 5. Troubleshooting
5.1 Introduction ................................................................................................... 35
5.2 Frequently Asked Questions ........................................................................ 35
DS50002158A-page 4
PICkit 3 PROGRAMMER
APPLICATION USERS 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 IDE online help.
Select the Help menu, and then Topics to open a list of available online help files.
INTRODUCTION
This chapter contains general information that will be useful to know before using
PICkit 3 Programmer Application. Items discussed include:
Document Layout
Conventions Used in this Guide
Recommended Reading
DOCUMENT LAYOUT
This document describes how to use the PICkit 3 Programmer Application with the
PICkit 3 unit as a development tool to program firmware on a target board. The manual
layout is as follows:
Chapter 1. Overview describes the PICkit 3 Programmer Application and how it
can help you develop your application.
Chapter 2. Getting Started Provides installation instructions and setup information.
Chapter 3. Using In-Circuit Serial Programming (ICSP) Explains using the
application with ICSP.
Chapter 4. PICkit 3 Programmer Application Describes how to use the
application.
Chapter 5. Troubleshooting Provides basic troubleshooting information.
Chapter 6. Updating and Reverting the PICkit 3 OS Explains how to update
or revert the operating system firmware.
Chapter 7. Logic Tool Provides information on using the Logic Tool.
Appendix A. Hardware Specification Provides information on conformity,
device support, USB power, communication, and target board considerations.
Appendix B. PICkit 3 Schematics Presents PICkit 3 schematics.
DS50002158A-page 5
Represents
Examples
Arial font:
MPLAB IDE Users Guide
Italic
Referenced books
Emphasized text
Initial caps
A window
A dialog
A menu selection
Quotes
A menu path
File>Save
Bold characters
A dialog button
Click OK
A tab
#define START
Filenames
autoexec.bat
File paths
c:\mcc18\h
Keywords
Command-line options
-Opa+, -Opa-
Bit values
0, 1
Constants
0xFF,A
Italic
A variable argument
Square brackets [ ]
Optional arguments
mpasmwin [options]
file [options]
errorlevel {0|1}
Ellipses...
var_name [,
var_name...]
DS50002158A-page 6
Preface
RECOMMENDED READING
This user's guide describes how to use the PICkit 3 Programmer Application with the
PICkit 3. Other useful documents are listed below. The following Microchip documents
are available and recommended as supplemental reference resources.
DS50002158A-page 7
DS50002158A-page 8
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Chapter 1. Overview
1.1
INTRODUCTION
Note:
1.2
DS50002158A-page 9
Support for new devices can be added by updating the programming software. The
latest software is available on Microchips web site page for the PICkit 3:
www.microchip.com/pickit3.
FIGURE 1-1:
PICkit 3 PROGRAMMER
2
Legend:
1 Lanyard Loop
2 USB Port Connection
3 Pin 1 Marker
4 Programming Connector
5 Status LEDs
6 Push Button
5
3
4
1.3.1
Lanyard Loop
The lanyard loop provides a point of attachment so that the PICkit 3 can be suspend
suspended or worn.
1.3.2
The USB port connection is a USB mini-B connector. Connect the PICkit 3 to the PC using
the supplied USB cable.
DS50002158A-page 10
Overview
1.3.3
Pin 1 Marker
This marker designates the location of pin 1 for proper connector alignment.
1.3.4
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.
FIGURE 1-2:
1 = VPP/MCLR
2 = VDD Target
3 = VSS (ground)
4 = PGD (ICSPDAT)
5 = PGC (ICSPCLK)
6 = PGM (LVP)
Note:
1.3.5
Indicator LEDs
1.3.6
Push Button
The push button may be used to initiate the Write Device programming function when
Programmer>Write on PICkit Button is checked on the PICkit 3 Programmer
Application menu (see item labeled 2 in Figure 1-1.)
The push button may also be used to put the PICkit 3 unit operating system firmware
into Bootloader mode. For more information on this feature, see Chapter 6. Updating
and Reverting the PICkit 3 OS.
When using the Logic Tool, the push button can be used to stop the analyzer from running. See Section 7.5.4.3 Running the Analyzer for more information on using the
push button with the logic tool.
2013 Microchip Technology Inc.
DS50002158A-page 11
DS50002158A-page 12
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Chapter 2. Getting Started
2.1
INTRODUCTION
This chapter gives instructions on how to get started using the PICkit 3 development
programmer to program Flash-based PIC microcontroller units.
For information on how to use the PICkit 3 with In-Circuit Serial Programming
(ICSP), refer to Chapter 3. Using In-Circuit Serial Programming (ICSP).
For information on how to update the PICkit 3 operating system (firmware), refer to
Chapter 6. Updating and Reverting the PICkit 3 OS.
2.2
DS50002158A-page 13
DS50002158A-page 14
Getting Started
2.4
IDENTIFY DEVICE
If the device on the target is not correctly identified, programming operations will not be
performed. Check the target power (Section 2.5 Selecting Target Power) and
device ICSP connections before attempting to reselect or change the device.
At any time, the device family may be selected to search for connectivity to a device in
that family. To connect to a device when the application is already running, select the
device family by clicking on the Device Family menu, as shown in Figure 2-3.
FIGURE 2-3:
DS50002158A-page 15
CAUTION
Ensure that the correct Baseline has been selected. These devices do not contain a
device ID to confirm device selection.
Choosing the wrong Baseline may cause the erasure of the OSCCAL value that
was stored in the last memory location.
FIGURE 2-4:
DS50002158A-page 16
Getting Started
2.5
2.5.1
If you are going to power the target board from the PICkit 3, do not attach a power supply to the target or the PICkit 3 will sense it and not give you the option to use PICkit 3
power. For a target board not connected to an external power supply, you will see the
message shown in Figure 2-5 and the power options displayed in Figure 2-6.
FIGURE 2-5:
FIGURE 2-6:
To enable PICkit 3 to power the target device, check the VDD Target Power On checkbox as shown. The default setting is off, i.e., the checkbox is cleared.
Note:
If a target power supply is not detected, the PICkit 3 will always supply
power to the target during programming, regardless of the Target Power
On checkbox state.
The voltage supplied to the target may be adjusted before or after enabling power by
adjusting the Target Power voltage box (Figure 2-6).
If a short or heavy current load is detected on the programmer-supplied VDD, then you
will receive an error and VDD will be automatically disabled.
CAUTION
When using bus-powered hubs, the maximum current supplied to the PICkit 3 is
100 mA. If the total of the target and the programmer exceeds this current limit, the
USB port might turn off. The target can be powered externally if more power is necessary.
To avoid heavy current load errors, target current consumption should be maintained
at a level that is lower 30 mA. In addition, to avoid slowing VDD rise time, large VDD
capacitances should not be permitted. Allowed VDD rise time is 500 s or less.
DS50002158A-page 17
The target device may also be powered externally. By default, the PICkit 3 will automatically detect an externally powered board. The heading VDD PICkit 3 will be changed
to VDD Target, the On checkbox will be replaced by a checkbox named Check, and
the detected VDD voltage is displayed in the grayed out voltage box, as shown in
Figure 2-7.
Clicking the Check checkbox will update the detected VDD voltage displayed in the
voltage box. If no VDD voltage is detected when the checkbox is clicked, then PICkit 3
will return to supplying VDD power to the target device.
Note:
The maximum external VDD that may be used with the PICkit 3 is 5.5 Volts.
The minimum external VDD that may be used with the PICkit 3 is 1.8 Volts.
FIGURE 2-7:
DS50002158A-page 18
Getting Started
2.6
2.7
If any Code Protect, Data Protect, Write Protect, or Read Protect configuration bits are currently set in the device, the Bulk Erase method must be
used prior to programming. The lower voltage row erase procedure will not
succeed.
The status of the Write operation is displayed in the status bar located under the Device
Configuration window. If the write is successful, the status bar turns green and displays
Programming Successful.
If the write fails, the status bar turns red and displays Programming Failed. This error
indicates that the data was corrupted during the programming sequence. If this error is
displayed, try writing the program to the device again. If the error continues, see
Chapter 5. Troubleshooting for assistance.
Other write issues may be displayed as warnings and will turn the status bar yellow. In
this case, the PICkit 3 and demo board have become disconnected.
DS50002158A-page 19
If a device has EEPROM data memory, the Enabled checkbox next to Program
Memory and EEPROM Data will become available.
The checkboxes select which memory regions programming operations will be
affected. Refer to Table 2-1 for a description of how programming operations are
affected by the checkboxes. Erase and Blank Check always operate on all memory
regions.
TABLE 2-1:
Program
Memory Enabled
Checked
EEPROM Data
Enabled
Checked
Checked
Checked
Write/Read/Verify
Erase/Blank Check
Program Memory
User IDS
Configuration
EEPROM only
Not Allowed
During a Write, regions that are unchecked will remain unchanged in the device.
For example, if Program Memory is unchecked while EEPROM Data is checked, then
a Write operation will only write EEPROM Data, while Program Memory, User IDs and
Configuration Words in the device will remain unchanged.
If Program Memory is checked while EEPROM Data is unchecked, then a Write
operation will program Program Memory, User IDs, and Configuration Words, while
EEPROM Data in the device will remain unchanged.
Due to programming constraints in some devices, the PICkit 3 Programmer Application
may read and re-write EEPROM data memory during a Write to preserve it.
Both memory regions cannot remain unchecked.
2.7.2
Prior to each Write, the imported hex file time stamp is compared to the version on the
drive. If the version on the drive is newer, it is reloaded. This comparison only occurs
when a hex file has been read from the drive.
The automatic reload feature ensures that the latest version built will be written to the
device. It can be used with the Tools>Program on PICkit Button feature to program the
latest MPLAB Integrated Development Environment (IDE) build, without switching to
the PICkit 3 Programmer software, simply by pressing the PICkit 3 unit push button.
2.8
DS50002158A-page 20
Getting Started
2.9
2.10
Note:
If the device is read after it has been protected, the protected memory
regions will display all zeros.
Unchecking Enable Code Protect will not allow you to read the region. You
must erase and reprogram all device memory before you can read that
memory region again.
DS50002158A-page 21
The PICkit 3 Erase function always uses the Bulk Erase method that
requires a minimum VDD, even on devices that support row erasing for the
Write function. You will be warned if VDD is below the minimum for the
connected device.
The Blank Check function will read the entire device to determine if Program Memory,
EEPROM Data memory, User IDs, and Configuration bits are erased. All memory
regions will be examined, regardless of the state of the Program Memory and EEPROM
Data Enabled checkboxes.
To Blank Check the device, click Blank Check.
2.12
2.12.1
AUTOMATING BUTTONS
This features allows the PICkit 3 Programmer Application to automatically import a hex
file and write it to a connected device when the hex file is updated; for example, on a
new firmware build.
To use this feature, click Auto Import Hex + Write Device. This will bring up an Import
Hex file dialog that defaults to the first hex file in the file history (under the File menu).
After selecting a file, it is written to the device. The PICkit 3 Programmer Application
then monitors the selected hex file for updates. When the file has been updated (has a
newer time stamp), the application automatically re-imports the hex file and writes to
the target device.
While this feature is enabled, other programming operations are disabled. The Auto
Import Hex + Write Device button remains pressed while this feature is active. To stop
using this feature, click Auto Import Hex + Write Device again.
If an error is encountered during hex file importing or device programming, the
application will automatically exit this feature mode.
2.12.2
When clicked, this button will read the target device and open an Export Hex File
dialog.
DS50002158A-page 22
Getting Started
2.13
PICKIT 3 UNIT ID
The PICkit 3 might be assigned (optionally) a Unit ID string to identify it uniquely.
Once assigned, the PICkit 3 Unit ID displays in the PICkit 3 Programmer software title
bar, and in the Status Window, when first connecting to the PICkit 3. An example is
shown in Figure 2-19 where the Unit ID is BUR102111707.
FIGURE 2-10:
UNIT ID
DS50002158A-page 23
DS50002158A-page 24
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Chapter 3. Using In-Circuit Serial Programming (ICSP)
3.1
INTRODUCTION
The PICkit 3 Programmer can program microcontroller devices that are installed in an
application circuit using In-Circuit Serial Programming (ICSP). ICSP requires five
signals:
VPP Programming Voltage; when applied, the device goes into Programming
mode.
ICSPCLK or PGC Programming Clock; a unidirectional synchronous serial clock
line from the programmer to the target.
ICSPDAT or PGD Programming Data; a bidirectional synchronous serial data line.
VDD Power Supply positive voltage.
VSS Power Supply ground reference.
However, the application circuit must be designed to allow all the programming signals
to be connected to the device without distorting the programming signals. Figure 3-1
shows a typical circuit as a starting point when designing an application circuit for ICSP.
For successful ICSP programming, the precautions in the following sections need to be
followed.
Note:
FIGURE 3-1:
Isolation Circuitry:
Resistor or Schottky-type diode
PICkit 3
Programming
Header
+5V
1
2
3
4
5
6
+5V
470 Ohm*
10k*
OR
0.1 F*
1
2
3
4
VSS 8
VDD
RA0/ICSPDAT 7
RA5
RA1/ICSPCLK 6
RA4
RA2 5
RA3/MCLR/VPP
VPP/MCLR
VDD
VSS
ICSPDAT/PGD
ICSPCLK/PGC
PGM/LVP
To Application
Circuit
Target Microcontroller
Device
Typical Values
DS50002158A-page 25
3.3
DS50002158A-page 26
VDD
During ICSP programming, the device needs to be powered in accordance with the
device specification. Typically, the device supply voltage is connected to the application
circuit supply voltage. The application circuit can be powered by the PICkit 3 or externally. There are a few precautions that need to be observed in the situations covered
in the following three sections.
3.4.1
The PICkit 3 supply voltage may set between the maximum and minimum voltages
allowed by the device programming specification, unless the minimum is below +2.5V.
Be sure to set the voltage box to the appropriate voltage before programming the
device or turning on VDD.
CAUTION
When using bus powered hubs, the maximum current supplied to the PICkit 3 is
100 mA. If the target plus programmer exceeds this current limit, the USB port may
turn off. The target may be powered externally if more powered is required.
Note:
3.4.2
The PICkit 3 may be used with application circuits powered externally between +5.5V
and +1.8V.
3.4.3
Some devices use a Bulk Erase function to erase program memory, data EEPROM
memory, ID locations, and Configuration bits. Typically, the Bulk Erase function
requires a supply voltage (VDD) of 4.5 to 5.5 Volts (refer to the device programming
specification for device specific requirements).
This voltage range can be a problem if the application circuit is designed to operate at
a different supply voltage range. In order to Bulk Erase the device, the application
circuit needs to take into consideration the Bulk Erase voltage requirement while
protecting any voltage sensitive circuitry.
If the application circuit VDD is below the minimum required for the Bulk Erase, a dialog
will warn the user before attempting to erase the device.
DS50002158A-page 27
VSS
The power supply ground reference, VSS, must be at the same potential as the
application circuit.
3.6
CABLE LENGTHS
Minimize the distance the ICSP signals must travel by placing the ICSP connector as
close to the application circuit device as possible. Minimize any cable length between
the PICkit 3 and application circuit device. The goal is to keep the ICSP signals within
the level and slew rate specifications for successful programming.
3.7
3.8
LOGIC TOOL
The PICkit 3 Logic Tool allows the PICkit 3 ICSP connector pins to be used for stimulating and probing digital signals in a target circuit, and collectively as a simple 3 channel logic analyzer. The Logic Tool is opened by selecting Tools>Logic Tool in the main
PICkit 3 Programmer Application window. See Chapter 7. Logic Tool for more
information.
DS50002158A-page 28
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Chapter 4. PICkit 3 Programmer Application
4.1
FIGURE 4-1:
Menu Bar
Device Configuration
Configuration Word
Editor
Status Window
Progress Bar
Device VDD
MCLR State
Memory Source
Program Memory
DS50002158A-page 29
4.2.1
File
Import Hex import a hex file for programming. The hex file format INHX32 is
supported.
Export Hex export a hex file read from a device. The hex file is created in the
INHX32 format.
Exit exit the program.
4.2.2
Device Family
Select a device family to search for a connected device in that family. Selecting the
device family of the current part will clear all device data.
Some families that cannot be auto-detected (such as Baseline) will open a drop-down
box so that supported devices can be selected.
4.2.3
Programmer
Read Device reads program memory, data EEPROM memory, ID locations and
Configuration bits.
Write Device writes program memory, data EEPROM memory, ID locations and
Configuration bits.
Verify verifies program memory, data EEPROM memory, ID locations and
Configuration bits read from the target MCU against the code stored in the
programming application.
Erase performs a Bulk Erase of the target MCU. OSCCAL and band gap values
are preserved on parts with these features.
Blank Check performs a Blank Check of program memory, data EEPROM
memory, ID locations and Configuration bits.
Verify on Write when checked, the device will be immediately verified after
programming on a Write (recommended). When unchecked, the device will be
programmed but not verified on a Write.
Clear Memory Buffers on Erase clears and resets the memory buffers on the target MCU when an erase command is performed.
Hold Device in Reset when checked, the MCLR (VPP) pin is held low (asserted).
When unchecked, the pin is released (tri-stated), allowing an external pull-up to
bring the device out of Reset.
Alert Sounds... opens the Alert Sounds dialog where you can enable and select
sound files to indicate success, warning or error.
Write on PICkit Button when checked, a Write operation will be initiated by
pressing the PICkit 3 push button.
Manual Device Select enables you to type a device to select.
DS50002158A-page 30
Tools
To disable code protect, all device memory must be erased and rewritten.
4.2.5
View
DS50002158A-page 31
Help
PICkit 3 Programmer Application Users Guide launches the users guide PDF
(Adobe Reader must be installed).
PICkit 3 ReadMe opens the PICkit 3 Readme.txt file.
PICkit 3 Programmer on the web opens the link to the PICkit 3 in the default web
browser.
About opens a dialog with the PICkit 3 Programmer Application version, device
file version and firmware version.
4.3
DEVICE CONFIGURATION
The Device Configuration window displays the device, User ID, Configuration, and
Checksum. It also displays OSCCAL and Band Gap for parts with those features.
For baseline (12-bit core) devices, serial EEPROM devices, and KEELOQ HCS devices,
you must select the device from the Device drop-down menu.
All other part family devices will be detected by their device ID and the part name will
be displayed on the Device line.
To edit the Configuration settings, click on Configuration: to open the Configuration
Word Editor dialog (Figure 4-2), where you can edit the bit settings.
FIGURE 4-2:
DS50002158A-page 32
STATUS WINDOW
The status window displays text status of the operations in progress. If an operation is
successful, the status window will display a green background. If an operation fails, the
status window will display red. If an operation alerts a caution, the status window will
display yellow.
4.5
PROGRESS BAR
The progress bar displays the progress of an operation.
4.6
DEVICE VDD
The PICkit 3 VDD may be turned on and off by clicking the checkbox On. The voltage
may be set in the box on the right either by typing it directly or using the up/down arrows
to adjust it a tenth of a volt at a time. The maximum and minimum allowed voltages will
vary depending on the target device.
If the On checkbox is unchecked, PICkit 3 will automatically turn on the VDD at the set
voltage during any requested programming operation.
FIGURE 4-3:
If the target device has its own power supply, then the PICkit 3 will display the detected
VDD voltage in the box on the right, which will be grayed out to prevent being changed.
The checkbox text changes to Check, and clicking on the checkbox will update the
detected VDD voltage value. If Target VDD>Auto-Detect is selected, clicking on the
checkbox will revert the VDD mode back to PICkit 3 supplied VDD if a target power
supply is no longer detected.
FIGURE 4-4:
4.7
If the target device allows the MCLR pin to be configured as an input port,
and it is configured as such, PICkit 3 will not be able to hold the device in
Reset.
DS50002158A-page 33
MEMORY SOURCE
The Source bar displays the source of the currently loaded device data. If read from a
hex file, it will display the hex file name. If read from a device, it will display the part
name. None (Empty/Erased) indicates the buffers are empty, and it will display
Edited once Program Memory or Data EEPROM Memory has been edited in the
window.
4.9
PROGRAM MEMORY
Program code can be loaded into the PICkit 3 Programmer Application by selecting
File>Import HEX to import a hex file or by clicking Read to read the device memory.
The origin of the code is displayed in the Source block. The Program Memory window
displays the program code in hexadecimal. The code may be edited in the window.
The checkbox next to the Program Memory window is only available on devices with
EEPROM data memory. If the box is checked, then Program Memory, User IDs, and
Configuration Words are written to, read from, and verified on the device. If the box is
unchecked, then Program Memory, User IDs, and Configuration Words will not be
erased or altered during a Write Device operation, and will not be read or verified. The
checkbox does not affect Erase Device or Blank Check operations. Both memory
window checkboxes cannot be cleared at the same time.
For supported serial EEPROM devices, the device contents are displayed in the Program Memory window, instead of the Data EEPROM Memory window, for easier
viewing in the larger display area.
4.10
4.11
DS50002158A-page 34
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Chapter 5. Troubleshooting
5.1
INTRODUCTION
This chapter provides questions and answers to common problems associated with
using the PICkit 3 Programmer Application.
5.2
DS50002158A-page 35
VDD/VPP Errors
Question
Why do I keep getting a VDD Error or VPP Error?
Answer
This error indicates that the PICkit 3 is not able to drive VDD or VPP to the intended voltage. Check the circuit board for shorts, for large current draw and verify that the target
device is connected to the PICkit 3 in accordance with Chapter 3. Using In-Circuit
Serial Programming (ICSP). Make sure that VDD capacitance is not reducing the VDD
rise time longer than 500 s.
Programming Errors
Question
Why am I able to program some parts but not others?
Answer
If some parts are configured for Low-Voltage Programming, a floating PGM pin can
interfere with programming. Use a resistor to pull this pin low when programming.
Some Mid-Range parts, such as the PIC16F72/73/74/76/77 family and
PIC16F737/747/767/777 family require a minimum programming VDD of +4.75V.
Depending on the USB voltage, the PICkit 3 may not be able to supply +4.75V on VDD.
Program these parts using an external +5.0V power supply.
Some PIC18F parts require significant bypass capacitance on VDD. Try increasing the
total bypass capacitance up to 10 F.
PIC18FXXJXX, PIC24X, and dsPIC30F/33F devices require a 4.7 F capacitor on the
VDDCORE/VCAP pin in order to function properly. If not using a separate regulator to supply VDDCORE, ensure that the ENVREG pin is tied to VDD.
DS50002158A-page 36
Troubleshooting
PICkit 3 Not Found
Question
I have my PICkit 3 plugged into USB, but the PICkit 3 Programmer Application keeps
saying PICkit 3 Not Found?
Answer
Please see the answer for Windows Error: Unrecognized USB Device.
DS50002158A-page 37
DS50002158A-page 38
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Chapter 6. Updating and Reverting the PICkit 3 OS
6.1
INTRODUCTION
Updating and reverting the operating system (firmware) for the PICkit 3 programmer
are discussed in this chapter. The differing operating systems are referred to as
scripting mode or MPLAB mode.
Note:
6.2
Do not have the MPLAB IDE open when updating the scripting mode OS or
reverting to the MPLAB mode OS.
FIGURE 6-1:
DS50002158A-page 41
6.3
2. Click OK to proceed.
This reverts the PICkit 3 to bootloader mode so MPLAB IDE can update the
PICkit 3 with MPLAB IDE compatible firmware.
3. When complete, a message stating the PICkit 3 has been converted to MPLAB
mode displays.
4. Click OK to exit the PICkit 3 Programmer Application.
DS50002158A-page 42
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Chapter 7. Logic Tool
7.1
INTRODUCTION
The PICkit 3 Logic Tool allows the PICkit 3 ICSP connector pins to be used for stimulating and probing digital signals in a target circuit, and collectively as a simple 3-channel logic analyzer. The Logic Tool is opened by selecting Tools > Logic Tool in the
main PICkit 3 Programmer Application window.
The Logic Tool has two operating modes. The Logic I/O mode is useful for triggering
inputs to a PIC microcontroller or other digital circuitry, and can monitor digital signals
to display their state. In essence, it provides an alternative for wiring buttons and LEDs
to pins or signals while debugging or developing I/O functions.
The Analyzer mode can display waveforms of up to three digital signals, and trigger on
specific events such as a rising edge on one signal when another signal is at a logic
high level. This may be very useful for debugging serial communication buses such as
UART, SPI and I2C. It is also very applicable to monitoring the behavior of general
microcontroller I/O.
Information in this guide covers:
DS50002158A-page 43
Note 1:
Pin
ICSP Function
VPP/MCLR
VDD
GND
PGD
PGC
PGM (LVP)
Digital Output
The PICkit 3 VDD pin must be connected to the target circuit VDD supply,
or set to provide a VDD output voltage in the main PICkit 3 application
form.
The voltage level at the VDD pin sets the output high voltage for pins 4, 5,
and 6 when used as outputs. For example, if using the PICkit 3 to provide
digital stimulus to a 3.3 Volt circuit, the VDD pin should be either set to or
connected to a 3.3 V supply to limit the output high voltage to 3.3 Volts.
Pin 1's output voltage swing is determined by the voltage on the VDD pin
when the Logic I/O is first enabled.
2:
DS50002158A-page 44
When used as inputs, pins 4 and 5 may be used to monitor signals down
to 2.5 Volt logic, as these are TTL input buffers. Pin 6, as an input, may
be used to monitor signals down to 3.6 Volt logic. It may not reliably report
high signal states for lower voltage logic signals, as the input buffer is a
Schmitt Trigger.
Logic Tool
7.3
FIGURE 7-1:
DS50002158A-page 45
Now that the pins of the PICkit 3 unit are enabled, the pin directions and output states
can be configured.
7.3.1
Pins 4, 5, and 6 may be configured as Outputs (output a digital signal from PICkit 3) or
Inputs (monitor a digital signal state connected to the pin). Pin 1 is only available as an
Output.
Click the radio buttons next to the Pin # to set the pin as an Output or Input. When the
pin is an Input, the connected signal state is displayed in the blue Inputs box, as
shown in Figure 7-3 and Figure 7-4.
FIGURE 7-3:
DS50002158A-page 46
Logic Tool
FIGURE 7-4:
Note:
Pin 4 and Pin 5 have a 4.7k Ohm pull-down resistor internal to the PICkit 3.
This resistor is necessary for the PICkit 3 debugger functions, but note that
this pull-down resistor will affect any digital signal it is connected to.
Generally, this is only an issue when using Pin 4 or Pin 5 as an input. See
the Appendix B. PICkit 3 Schematics for the pin circuit diagrams.
When a pin is selected as an Output, the pin will drive the logic level shown in the read
Output box. Toggle the output state by clicking on the Output state box. Alternatively,
a keyboard shortcut key can be used for each pin to toggle the output. The shortcut
keys are:
Pin
Shortcut Key
<A>
<S>
<D>
<F>
FIGURE 7-5:
FIGURE 7-6:
DS50002158A-page 47
7.4.1
The PICkit 3 ISCP connector pins 4, 5, and 6 are used as the inputs for the three logic
channels.
Pin
ICSP Function
VPP/MCLR
VDD
GND
PGD
Analyzer Channel 1
PGC
Analyzer Channel 2
PGM (LVP)
Analyzer Channel 3
For example, to monitor a SPI bus, the analyzer channel pins could be connected to
monitor the three main bus signals as follows:
Logic Analyzer Pin
DS50002158A-page 48
Analyzer Channel 1
SCK
Analyzer Channel 2
Analyzer Channel 3
Note 1:
The PICkit 3 VDD pin must be connected to the target circuit VDD supply,
or set to provide a VDD output voltage in the main PICkit 3 application
form.
Having the VDD pin connected is necessary as the PICkit 3 logic channel
pins are clamped to the VDD pin voltage. If no voltage is present on VDD,
the analyzer channel pins will be essentially clamped to ground!
It is possible to have PICkit 3 output a VDD voltage without connecting pin
2 to the circuit VDD, as long as the VDD level is greater than or equal to
the target circuit logic high voltage.
2:
Pin 4 and Pin 5 have a 4.7k Ohm pull-down resistor internal to the
PICkit 3. This resistor is necessary for the PICkit 3 debugger functions,
but note that this pull-down resistor will affect any digital signal these pins
are connected to. See the PICkit 3 schematic in the PICkit 3 Users Guide
appendix for the pin circuit diagrams.
3:
Logic Tool
7.5
FIGURE 7-7:
DS50002158A-page 49
The display section of the analyzer window allows the waveform to be viewed, zoomed,
measured, and saved as a bitmap file.
Figure 7-8 shows a SPI bus waveform capture of a 2-byte transmission, and details the
elements of the display window section.
FIGURE 7-8:
ANALYZER DISPLAY
7.5.1.1
TRIGGER
The trigger is a predefined event in the monitored signals that causes a capture of the
signal waveform. Triggering is discussed in detail in Section 7.5.3 The Analyzer
Trigger Section.
On the waveform display, the point where the trigger occurred is indicated by a vertical
red line. In Figure 7-8, the trigger was set to occur at the first rising edge of Channel 1,
the SPI SCLK clock signal.
7.5.1.2
TIME SCALE
Above left of the waveform display is the time scale. This is how much time each Division Line in the waveform represents. In Figure 7-8, each division is 50 microseconds
of time.
7.5.1.3
DIVISION LINE
A division line is a gray vertical line across the waveform display, which can be used to
give a time reference to the displayed waveform. In Figure 7-8, the first 8 clocks on
Channel 1 occupy about 3 divisions, so transmitting the first SPI byte took about 3 x 50
= 150 us.
Smaller hash marks at the top and bottom of the display subdivide each time division
into 5 smaller units. Since each time division in Figure 7-8 is 50 us, the smaller hash
marks represent 10 us of time.
7.5.1.4
WAVEFORM SCROLL
The captured waveform is longer than can be shown all at once effectively in the display, so the horizontal scroll bar allows the display to scroll for viewing the entire waveform.
DS50002158A-page 50
Logic Tool
7.5.1.5
The waveform Zoom allows four levels of zoom to be selected. Normally, at 1x zoom
each sample of a waveform is displayed as a pixel. A waveform is 1024 pixels, of which
500 can be displayed in the window. By selecting zoom level 0.5x, the waveform is
compressed so two samples are shown per pixel, which allows the entire waveform to
be view at once, but with a loss of detail.
Zoom levels 2x and 4x display the waveform with 2 pixels per sample and 4 pixels per
sample, respectively. This allows relative time details between the waveforms to be
more easily seen.
Figure 7-9 shows the SPI waveform at zoom levels of 0.5x, 1x, and 2x. Note that the
time scale changes as the zoom is changed.
FIGURE 7-9:
7.5.1.6
SAVE WAVEFORM
Click the Save button to save the current waveform display in a bitmap file. The time
scale will be added to the bottom of the display, as shown in Figure 7-9. If cursors are
active, the cursors and their times will also be saved with the display.
Note that the entire waveform is saved. In Figure 7-9, the 1x and 2x waveforms were
truncated after saving to only show the first portion.
DS50002158A-page 51
The display cursors are useful for making time and frequency measurements in the displayed waveform.
1. Click to check the Cursors checkbox and enable the cursors.
2. Place the X cursor by left-clicking in the waveform display.
3. Place the Y cursor by right-clicking in the waveform display.
It can be helpful to use Zoom for exact placement of the cursors. When zoomed, the
cursors will get wider as they are the width of a sample and the sample width grows
with increasing zoom.
Above the waveform display, the time difference between the Trigger and each cursor
is displayed, along with the difference between the triggers. The time period between
the cursor is also displayed as the related frequency.
In Figure 7-10, the cursors are used to measure the period (19 us) and frequency (53
kHz) of the SPI clock in channel 1. The X cursor sample is 116 us after the Trigger sample, and the Y cursor point is 135 us after the Trigger.
FIGURE 7-10:
DS50002158A-page 52
Logic Tool
7.5.3
The trigger is a user-defined set of events in the monitored signals that causes the
capture of a waveform.
Each channel can be assigned one of the following trigger events:
* (Dont Care)
1 (Logic High)
0 (Logic Low)
/ (Rising Edge)
\ (Rising Edge)
All trigger events on all channels must happen at once in order for the trigger to activate
data capture. For example, for Figure 7-8, the trigger was set to simply detect the first
rising edge on channel 1:
Figure 7-9 Trigger Conditions:
Ch 1 = /
(rising edge)
Ch 2 = *
(ignore)
Ch 3 = *
(ignore)
If the trigger conditions are changed as follows, where both a rising edge must be
detected on channel 1 at the same time channel 2 is at a logic high state, the trigger
will happen on the second clock instead, as shown in Figure 7-11. During first clocks
rising edge, channel 2 is logic low; so, this does not fully satisfy the trigger condition.
Figure 7-11 Trigger Conditions:
Ch 1 = /
(rising edge)
Ch 2 = 1
(logic high)
Ch 3 = *
(ignore)
FIGURE 7-11:
Finally, it is also possible to specify how many times the trigger condition must occur
before waveform capture is initiated, up to 256 times. For example, suppose we wanted
to capture the 16th byte of a long SPI transmission sequence. If we triggered on the
first clock edge of the first byte, we probably wouldnt be able to see the 16th byte, as
the analyzer would stop sampling before it occurred. However, we can set the analyzer
to pass up the first 15 bytes, by setting the trigger count to 15 bytes * 8 clocks + 1 = 121
times. This way, it will start counting clock edges on the first byte, but it wont trigger the
data capture until the 16th byte is transmitted.
DS50002158A-page 53
Now, well trigger on the 4th rising edge of channel 1 that occurs while channel 2 is logic
high. This will be the last clock of the first SPI byte, as shown in Figure 7-13.
FIGURE 7-13:
7.5.4
The Acquisition section of the analyzer window is used to set the waveform sample
rate, the position of the trigger relative to the captured waveform, and to start or run
the analyzer.
FIGURE 7-14:
DS50002158A-page 54
FIGURE 3-7:
ACQUISITION SETTINGS
Logic Tool
7.5.4.1
SAMPLE RATE
The sample rate is how often the analyzer channels are looked at. Each waveform capture is only 1024 samples long, so if we want to look at a longer period of time in the
waveform display, we have to sample less often.
The trade-off is that at higher sample rates, we can see more detail and faster signals
but only a small window of time. At lower sample rates, we can see a longer window of
elapsed time, but at less detail and we may miss fast pulses.
Generally, the sample rate should be set at least 10 times the highest frequency or 5
times the fastest pulse width to get a decent representation of the waveform. Any waveform that has frequency higher than half the sample rate may alias. Aliasing means that
waveform edges are missed, so the waveform can appear slower than it actually is.
Of course, the sample rate can always be set slower than these limits if the intention is
simply to get a general idea of whats going on in the circuit without much detail. For
example, the sample rate could be set much slower so it could be seen how many SPI
bytes are being sent. In Figure 7-15 we can see that 8 bytes are being sent on the SPI
bus. Now that we know how many bytes are sent, we could set the sample rate higher
and adjust the trigger count to see each byte in detail to figure out the byte value.
FIGURE 7-15:
In the PICkit 3 Logic Tool analyzer, the sample rate may be selected from those shown
in Table .
TABLE 7-1:
Sample Rate
Time Between
Samples
Captured Waveform
Length1
(1024 samples)
Maximum Frequency
(before aliasing)
1 MHz
1 us
1 ms
500 kHz
500 kHz
2 us
2 ms
250 kHz
250 kHz
4 us
4.1 ms
125 kHz
100 kHz
10 us
10.2 ms
50 kHz
50 kHz
20 us
20.5 ms
25 kHz
25 kHz
40 us
41 ms
12.5 kHz
10 kHz
100 us
102.4 ms
5 kHz
5 kHz
200 us
204.8 ms
2.5 kHz
Note:
DS50002158A-page 55
TRIGGER POSITION
Changing the trigger position allows more flexibility over how the captured data relates
to the trigger event. For example, we might be more interested in what happened
before the trigger, rather than after. There are six selectable trigger positions.
Start of Data Trigger Position
This is the trigger position used in all the prior Figure waveforms. All the waveform data,
except for one division, is captured after the trigger occurs. This is best used when all
the waveform data of interest happens after the trigger.
FIGURE 7-16:
DS50002158A-page 56
Logic Tool
Delay 1 Window Trigger Position
Delay 2 Windows Trigger Position
Delay 3 Windows Trigger Position
In these cases, the trigger position is considered Start of Data; but, the waveform capture is delayed 1000 samples (nearly one waveform display-width) after the trigger.
This allows a user to capture events that occur farther out than the display-width after
a trigger happens, without reducing the sample rate.
In other words, when Delay 1 Window is selected, the analyzer will wait 1000 samples
after the trigger event occurs before it begins recording waveform data. When Delay
2 Windows is selected, it will wait 2000 samples, etc.
Each waveform display is 1024 samples, so the 1000 sample delay increment gives a
small overlap between successive delay captures. Assuming that the data of interest
after the trigger is repeatable and consistent, this allows a total waveform of up to 4
times the sample-rate-window-width to be pieced together. For example, it would be
possible to collect 4 ms worth of waveform data after a trigger event at the 1 MHz
sample rate.
FIGURE 7-19:
DS50002158A-page 57
Once the trigger conditions, sample rate, and trigger position are set as desired, click
the RUN button to begin collecting waveform data and looking for trigger events.
When the analyzer is running, it will show the dialog in Figure 7-20 and the Busy LED
on the PICkit 3 unit will be lit.
FIGURE 7-20:
ANALYZER RUNNING
When the trigger condition is met, the Busy LED turns off, the Waiting for Trigger
dialog closes, and the analyzer waveform display updates with newly captured data.
If the analyzer is not triggering as expected; or if, for any other reason, it is necessary
to stop the analyzer from running, press the PICkit 3 unit push button. When an
analyzer run is canceled, the waveform display is not updated.
Note:
DS50002158A-page 58
When the analyzer is running, the PICkit 3 unit is unable to service USB
requests. The application will wait until the run completes at a trigger condition or is canceled by the push button. If the PICkit 3 unit is unplugged
from USB during a run, the PICkit 3 application may hang because it is
waiting for a response from the PICkit 3 unit.
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Appendix A. Hardware Specification
A.1
INTRODUCTION
The hardware and electrical specifications of the PICkit 3 programmer system are
detailed.
A.2
HIGHLIGHTS
This chapter discusses:
A.3
Declaration of Conformity
Device Support
USB Port/Power
PICkit 3 Programmer
Standard Communication Hardware
Target Board Considerations
DECLARATION OF CONFORMITY
We
Microchip Technology, Inc.
2355 W. Chandler Blvd.
Chandler, Arizona 85224-6199
USA
hereby declare that the product:
PICkit 3 programmer
complies with the following standards, provided that the restrictions stated in the operating manual are observed:
Standards: EN61010-1
Laboratory Equipment
Microchip Technology, Inc.
Date: January 2009
Important Information Concerning the Use of the PICkit 3 programmer
Due to the special nature of the PICkit 3 programmer, the user is advised that it can
generate higher than normal levels of electromagnetic radiation which can interfere
with the operation of all kinds of radio and other equipment.
To comply with the European Approval Regulations therefore, the following restrictions
must be observed:
1. The development system must be used only in an industrial (or comparable)
area.
2. The system must not be operated within 20 meters of any equipment which may
be affected by such emissions (radio receivers, TVs etc.).
DS50002158A-page 59
DEVICE SUPPORT
Refer to the PICkit 3 Readme for a list of supported devices.
Note:
The UNI/O (llLC) Serial EEPROM devices require the following PICkit 3
hardware consideration or change to work properly:
Application pull-up resistor needs to be 9.1k ohm or less
or
Remove R50 from the PICkit 3.
Note:
The I2C (24LC) Serial EEPROM devices require the following PICkit 3
hardware changes to work properly:
Remove TR3 from the PICkit 3.
Remove R50 from the PICkit 3.
A.5
USB PORT/POWER
The PICkit 3 programmer 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. The debugger is classified as a high
power system per the USB specification, and requires slightly more than 100 mA of
power from the USB to function in all operational modes (debugger/programmer).
Note:
The PICkit 3 programmer is powered through its USB connection. The target board is powered from its own supply. Alternatively, the PICkit 3 can
power it only if the target consumes less than 30 mA.
Cable Length The PC-to-debugger cable length for proper operation is shipped in
the debugger kit.
Powered Hubs If you are going to use a USB hub, make sure it is self-powered. Also,
USB ports on PC keyboards do not have enough power for the debugger to operate.
PC Hibernate/Power-Down Modes Disable the hibernate or other power saver
modes on your PC to ensure proper USB communications with the debugger.
DS50002158A-page 60
Hardware Specification
A.6
PICKIT 3 PROGRAMMER
The debugger consists of a main board enclosed in the casing with a USB connector
and a single in-line connector. On the debugger enclosure are indicator lights (LEDs).
A.6.1
Main Board
This component has the interface processor with integrated USB 2.0 interface capable
an SPI, serial EE for programming into the emulation device on-board Flash and LED
indicators.
A.6.2
Color
Description
Power
Green
Active
Blue
Status
Green
Yellow
Red
DS50002158A-page 61
For more on available header boards, see the Header Board Specification
(DS51292).
A.7.1
Standard Communication
The standard communication is the main interface to the target processor. It contains
the connections to the high voltage (VPP), VDD sense lines, and clock and data connections required for programming and connecting with the target devices.
The VPP high-voltage lines can produce a variable voltage that can swing from 1.8 to
14 volts to satisfy the voltage requirements for the specific emulation processor.
The VDD sense connection draws current from the target processor.
The clock and data connections are interfaces with the following characteristics:
Clock and data signals are in high-impedance mode (even when no power is
applied to the PICkit 3 programmer system)
Clock and data signals are protected from high voltages caused by faulty targets
systems, or improper connections
Clock and data signals are protected from high current caused from electrical
shorts in prototype or target systems
FIGURE A-1:
Standard Socket
2
1
3 5
Bottom of
Target Board
MCLR/VPP
VDD_TGT
GND
PGD (ICSPDAT)
PGC (ICSPCLK)
LVP
Function
Power
Power on target
Ground
Standard Com Data
Standard Com Clock
Low Voltage Programming
Target Device
or PIM
Target Board
DS50002158A-page 62
4 6
1
2
3
4
5
6
Name
Hardware Specification
A.7.2
For standard communications, a modular cable connects the debugger and the target
application. The specifications for this cable and its connectors are listed below.
A.7.2.1
Modular
Connector Pin
Microcontroller
Pin
LVP
RB6
RB7
Ground
VDD Target
VPP
AC164110
Adapter
Mini-USB
cable
to PC
PICkit 3
Device-ICE
Power
Header
Transition Socket
Target Board
DS50002158A-page 63
A.8
DS50002158A-page 64
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Appendix B. PICkit 3 Schematics
PICkit 3 Development Programmer schematic diagrams are shown here. Demo board
schematics are found in their respective users guides.
FIGURE B-1:
DS50002158A-page 65
USE
FIGURE B-2:
DS50002158A-page 66
PICkit 3 PROGRAMMER
APPLICATION USERS 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.
Address
Value that identifies a location in memory.
Alphabetic Character
Alphabetic characters are those characters that are letters of the arabic alphabet
(a, b, , z, A, B, , Z).
Alphanumeric
Alphanumeric characters are comprised of alphabetic characters and decimal digits
(0,1, , 9).
ANDed Breakpoints
Set up an ANDed condition for breaking, i.e., breakpoint 1 AND breakpoint 2 must
occur at the same time before a program halt. This can only be accomplished if a data
breakpoint and a program memory breakpoint occur at the same time.
Anonymous Structure
C30 An unnamed structure.
C18 An unnamed structure that is a member of a C union. The members of an anonymous structure may be accessed as if they were members of the enclosing union. For
example, in the following code, hi and lo are members of an anonymous structure
inside the union caster.
union castaway
int intval;
struct {
char lo; //accessible as caster.lo
char hi; //accessible as caster.hi
};
} caster;
ANSI
American National Standards Institute is an organization responsible for formulating
and approving standards in the United States.
Application
A set of software and hardware that may be controlled by a PIC microcontroller.
DS50002158A-page 67
DS50002158A-page 68
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. It controls the program memory address bus, the data memory address
bus, and accesses to the stack.
Clean
Under the MPLAB IDE Project menu, Clean removes all intermediary project files, such
as object, hex and debug files, for the active project. These files are recreated from
other files when a project is built.
COFF
Common Object File Format. An object file of this format contains machine code,
debugging and other information.
Command Line Interface
A means of communication between a program and its user based solely on textual
input and output.
Compiler
A program that translates a source file written in a high-level language into machine
code.
Conditional Assembly
Assembly language code that is included or omitted based on the assembly-time value
of a specified expression.
Conditional Compilation
The act of compiling a program fragment only if a certain constant expression, specified
by a preprocessor directive, is true.
Configuration Bits
Special-purpose bits programmed to set PIC microcontroller modes of operation. A
Configuration bit may or may not be preprogrammed.
Control Directives
Directives in assembly language code that cause code to be included or omitted based
on the assembly-time value of a specified expression.
CPU
See Central Processing Unit.
Cross Reference File
A file that references a table of symbols and a list of files that references the symbol. If
the symbol is defined, the first file listed is the location of the definition. The remaining
files contain references to the symbol.
Data Directives
Data directives are those that control the assemblers allocation of program or data
memory and provide a way to refer to data items symbolically; that is, by meaningful
names.
DS50002158A-page 69
DS50002158A-page 70
Glossary
ELF
Executable and Linking Format. An object file of this format contains machine code.
Debugging and other information is specified in with DWARF. ELF/DWARF provide
better debugging of optimized code than COFF.
Emulation
The process of executing software loaded into emulation memory as if it were firmware
residing on a microcontroller device.
Emulation Memory
Program memory contained within the emulator.
Emulator
Hardware that performs emulation.
Emulator System
The MPLAB ICE 2000 and MPLAB ICE 4000 emulator systems include the pod, processor module, device adapter, target board, cables, and MPLAB IDE software. The
MPLAB REAL ICE system consists of a pod, a driver (and potentially a receiver) card,
target board, cables, and MPLAB IDE software.
Endianness
The ordering of bytes in a multi-byte object.
Environment
IDE The particular layout of the desktop for application development.
MPLAB PM3 A folder containing files on how to program a device. This folder can be
transferred to a SD/MMC card.
Epilogue
A portion of compiler-generated code that is responsible for deallocating stack space,
restoring registers and performing any other machine-specific requirement specified in
the runtime model. This code executes after any user code for a given function,
immediately prior to the function return.
EPROM
Erasable Programmable Read Only Memory. A programmable read-only memory that
can be erased usually by exposure to ultraviolet radiation.
Error File
A file containing error messages and diagnostics generated by a language tool.
Errors
Errors report problems that make it impossible to continue processing your program.
When possible, errors identify the source file name and line number where the problem
is apparent.
Event
A description of a bus cycle which may include address, data, pass count, external
input, cycle type (fetch, R/W), and time stamp. Events are used to describe triggers,
breakpoints and interrupts.
Executable Code
Software that is ready to be loaded for execution.
Export
Send data out of the MPLAB IDE in a standardized format.
DS50002158A-page 71
DS50002158A-page 72
Glossary
Frame Pointer
A pointer that references the location on the stack that separates the stack-based
arguments from the stack-based local variables. Provides a convenient base from
which to access local variables and other values for the current function.
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 <float.h>,
<iso646.h>, <limits.h>, <stdarg.h>, <stdbool.h>, <stddef.h> and
<stdint.h>.
GPR
General Purpose Register. The portion of device data memory (RAM) available for
general use.
Halt
A stop of program execution. Executing Halt is the same as stopping at a breakpoint.
Heap
An area of memory used for dynamic memory allocation where blocks of memory are
allocated and freed in an arbitrary order determined at runtime.
Hex Code
Executable instructions stored in a hexadecimal format code. Hex code is contained in
a hex file.
Hex File
An ASCII file containing hexadecimal addresses and values (hex code) suitable for
programming a device.
Hexadecimal
The base 16 numbering system that uses the digits 0-9 plus the letters A-F (or a-f). The
digits A-F represent hexadecimal digits with values of (decimal) 10 to 15. The rightmost
digit counts ones, the next counts multiples of 16, then 162 = 256, etc.
High Level Language
A language for writing programs that is further removed from the processor than
assembly.
ICD
In-Circuit Debugger. MPLAB ICD and PICkit (with Debug Express), are Microchips
in-circuit debuggers.
ICE
In-Circuit Emulator. MPLAB ICE 2000 and MPLAB ICE 4000 system are Microchips
classic in-circuit emulators. MPLAB REAL ICE system is Microchips next-generation
in-circuit emulator.
ICSP
In-Circuit Serial Programming. A method of programming Microchip embedded
devices using serial communication and a minimum number of device pins.
IDE
Integrated Development Environment. MPLAB IDE is Microchips integrated
development environment.
Identifier
A function or variable name.
DS50002158A-page 73
DS50002158A-page 74
Glossary
L-value
An expression that refers to an object that can be examined and/or modified. An l-value
expression is used on the left-hand side of an assignment.
Latency
The time between an event and its response.
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. They
allow the specification of titles, pagination and other listing control.
Listing File
A listing file is an ASCII text file that shows the machine code generated for each C
source statement, assembly instruction, assembler directive, or macro encountered in
a source file.
Little Endian
A data ordering scheme for multibyte data whereby the least significant byte is stored
at the lower addresses.
Local Label
A local label is one that is defined inside a macro with the LOCAL directive. These
labels are particular to a given instance of a macros instantiation. In other words, the
symbols and labels that are declared as local are no longer accessible after the ENDM
macro is encountered.
Logic Probes
Up to 14 logic probes can be connected to some Microchip emulators. The logic probes
provide external trace inputs, trigger output signal, +5V, and a common ground.
Loop-Back Test Board
Used to test the functionality of the MPLAB REAL ICE in-circuit emulator.
LVDS
Low Voltage Differential Signaling. A low noise, low-power, low amplitude method for
high-speed (gigabits per second) data transmission over copper wire.
LVDS differs from normal input/output (I/O) in a few ways:
Normal digital I/O works with 5 volts as a high (binary 1) and 0 volts as a low (binary
0). When you use a differential, you add a third option (-5 volts), which provides an
extra level with which to encode, and results in a higher maximum data transfer rate.
A higher data transfer rate means fewer wires are required, as in UW (Ultra Wide) and
UW-2/3 SCSI hard disks, which use only 68 wires. These devices require a high transfer rate over short distances. Using standard I/O transfer, SCSI hard drives would
require a lot more than 68 wires.
DS50002158A-page 75
DS50002158A-page 76
Glossary
Microprocessor Mode
One of the possible program memory configurations of 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 Technologys relocatable macro assembler for PIC microcontroller devices,
KEELOQ devices and Microchip memory devices.
MPLAB Language Tool for Device
Microchips C compilers, assemblers and linkers for specified devices. Select the type
of language tool based on the device you will be using for your application, e.g., if you
will be creating C code on a PIC18 MCU, select the MPLAB C Compiler for PIC18
MCUs.
MPLAB ICD
Microchips in-circuit debuggers that works with MPLAB IDE. The ICDs supports Flash
devices with built-in debug circuitry. The main component of each ICD is the pod. A
complete system consists of a pod, header board (with a device-ICD), target board,
cables, and MPLAB IDE software.
MPLAB ICE 2000/4000
Not recommended for new designs. See the MPLAB REAL ICE in-circuit
emulator.
Microchips classic in-circuit emulators that work with MPLAB IDE. MPLAB ICE 2000
supports 8-bit PIC MCUs. MPLAB ICE 4000 supports PIC18F and PIC24 MCUs and
dsPIC DSCs. The main component of each ICE is the pod. A complete system consists
of a pod, processor module, cables, and MPLAB IDE software.
MPLAB IDE
Microchips Integrated Development Environment. MPLAB IDE comes with an editor,
project manager and simulator.
MPLAB PM3
A device programmer from Microchip. Programs PIC18 microcontrollers and dsPIC
digital signal controllers. Can be used with MPLAB IDE or stand-alone. Replaces
PRO MATE II.
MPLAB REAL ICE In-Circuit Emulator
Microchips next-generation in-circuit emulators that works with MPLAB IDE. The
MPLAB REAL ICE emulator supports PIC MCUs and dsPIC DSCs. The main component of each ICE is the pod. A complete system consists of a pod, a driver (and potentially a receiver) card, cables, and MPLAB IDE software.
MPLAB SIM
Microchips simulator that works with MPLAB IDE in support of PIC MCU and dsPIC
DSC devices.
MPLIB Object Librarian
Microchips librarian that can work with MPLAB IDE. MPLIB librarian is an object librarian for use with COFF object modules created using either MPASM assembler (mpasm
or mpasmwin v2.0) or MPLAB C18 C compiler.
DS50002158A-page 77
DS50002158A-page 78
Glossary
One-to-One Project-Workspace Model
The most common configuration for application development in MPLAB IDE to is have
one project in one workspace. Select Configure>Settings, Projects tab and check Use
one-to-one project-workspace model.
Opcodes
Operational Codes. See Mnemonics.
Operators
Symbols, like the plus sign + and the minus sign -, that are used when forming
well-defined expressions. Each operator has an assigned precedence that is used to
determine order of evaluation.
OTP
One Time Programmable. EPROM devices that are not in windowed packages. Since
EPROM needs ultraviolet light to erase its memory, only windowed devices are erasable.
Pass Counter
A counter that decrements each time an event (such as the execution of an instruction
at a particular address) occurs. When the pass count value reaches zero, the event is
satisfied. You can assign the Pass Counter to break and trace logic, and to any
sequential event in the complex trigger dialog.
PC
Personal Computer or Program Counter.
PC Host
Any PC running a supported Windows operating system.
Persistent Data
Data that is never cleared or initialized. Its intended use is so that an application can
preserve data across a device Reset.
Phantom Byte
An unimplemented byte in the dsPIC architecture that is used when treating the 24-bit
instruction word as if it were a 32-bit instruction word. Phantom bytes appear in dsPIC
hex files.
PIC MCUs
PIC microcontrollers (MCUs) refers to all Microchip microcontroller families.
PICkit 1, 2, and 3
Microchips developmental device programmers with debug capability through Debug
Express. See the Readme files for each tool to see which devices are supported.
PICSTART Plus
A developmental device programmer from Microchip. Programs 8-, 14-, 28-, and 40-pin
PIC microcontrollers. Must be used with MPLAB IDE software.
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.
DS50002158A-page 79
DS50002158A-page 80
Glossary
Program Memory
IDE The memory area in a device where instructions are stored. Also, the memory in
the emulator or simulator containing the downloaded target application firmware.
ALU30, C30 The memory area in a device where instructions are stored.
Project
A project contains the files needed to build an application (source code, linker script
files, etc.) along with their associations to various build tools and build options.
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.
Qualifier
An address or an address range used by the Pass Counter or as an event before
another operation in a complex trigger.
Radix
The number base, hex, or decimal, used in specifying an address.
RAM
Random Access Memory (Data Memory). Memory in which information can be
accessed in any order.
Raw Data
The binary representation of code or data associated with a section.
Read Only Memory
Memory hardware that allows fast access to permanently stored data but prevents
addition to or modification of the data.
Real Time
When an in-circuit emulator or debugger is released from the halt state, the processor
runs in Real Time mode and behaves exactly as the normal chip would behave. In Real
Time mode, the real time trace buffer of an emulator is enabled and constantly captures
all selected cycles, and all break logic is enabled. In an in-circuit emulator or debugger,
the processor executes in real time until a valid breakpoint causes a halt, or until the
user halts the execution.
In the simulator, real time simply means execution of the microcontroller instructions as
fast as they can be simulated by the host CPU.
Real-Time Watch
A Watch window where the variables change in real-time as the application is run. See
individual tool documentation to determine how to set up a real-time watch. Not all tools
support real-time watches.
Recursive Calls
A function that calls itself, either directly or indirectly.
DS50002158A-page 81
DS50002158A-page 82
Glossary
Shell
The MPASM assembler shell is a prompted input interface to the macro assembler.
There are two MPASM assembler shells: one for the DOS version and one for the
Windows version.
Simulator
A software program that models the operation of devices.
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.
Skew
The information associated with the execution of an instruction appears on the processor bus at different times. For example, the executed opcodes appears on the bus as
a fetch during the execution of the previous instruction, the source data address and
value and the destination data address appear when the opcodes is actually executed,
and the destination data value appears when the next instruction is executed. The trace
buffer captures the information that is on the bus at one instance. Therefore, one trace
buffer entry will contain execution information for three instructions. The number of captured cycles from one piece of information to another for a single instruction execution
is referred to as the skew.
Skid
When a hardware breakpoint is used to halt the processor, one or more additional
instructions may be executed before the processor halts. The number of extra
instructions executed after the intended breakpoint is referred to as the skid.
Source Code
The form in which a computer program is written by the programmer. Source code is
written in a formal programming language which can be translated into machine code
or executed by an interpreter.
Source File
An ASCII text file containing source code.
Special Function Registers
The portion of data memory (RAM) dedicated to registers that control I/O processor
functions, I/O status, timers or other modes or peripherals.
SQTP
See Serialized Quick Turn Programming.
Stack, Hardware
Locations in PIC microcontroller where the return address is stored when a function call
is made.
Stack, Software
Memory used by an application for storing return addresses, function parameters, and
local variables. This memory is typically managed by the compiler when developing
code in a high-level language.
MPLAB Starter Kit for Device
Microchips starter kits contains everything needed to begin exploring the specified
device. View a working application and then debug and program you own changes.
DS50002158A-page 83
DS50002158A-page 84
Glossary
Target Application
Software residing on the target board.
Target Board
The circuitry and programmable device that makes up the target application.
Target Processor
The microcontroller device on the target application board.
Template
Lines of text that you build for inserting into your files at a later time. The MPLAB Editor
stores templates in template files.
Tool Bar
A row or column of icons that you can click on to execute MPLAB IDE functions.
Trace
An emulator or simulator function that logs program execution. The emulator logs program execution into its trace buffer which is uploaded to MPLAB IDEs trace window.
Trace Memory
Trace memory contained within the emulator. Trace memory is sometimes called the
trace buffer.
Trace Macro
A macro that will provide trace information from emulator data. Since this is a software
trace, the macro must be added to code, the code must be recompiled or reassembled,
and the target device must be programmed with this code before trace will work.
Trigger Output
Trigger output refers to an emulator output signal that can be generated at any address
or address range, and is independent of the trace and breakpoint settings. Any number
of trigger output points can be set.
Trigraphs
Three-character sequences, all starting with ??, that are defined by ISO C as
replacements for single characters.
Unassigned Section
A section which has not been assigned to a specific target memory block in the linker
command file. The linker must find a target memory block in which to allocate an
unassigned section.
Uninitialized Data
Data which is defined without an initial value. In C,
int myVar;
defines a variable which will reside in an uninitialized data section.
Upload
The Upload function transfers data from a tool, such as an emulator or programmer, to
the host PC or from the target board to the emulator.
USB
Universal Serial Bus. An external peripheral interface standard for communication
between a computer and external peripherals over a cable using bi-serial transmission.
USB 1.0/1.1 supports data transfer rates of 12 Mbps. Also referred to as high-speed
USB, USB 2.0 supports data rates up to 480 Mbps.
DS50002158A-page 85
DS50002158A-page 86
PICkit 3 PROGRAMMER
APPLICATION USERS GUIDE
Index
A
Cable Length............................................................ 28
Cables
Length ..........................................................60, 64
Calibrate VDD & Set Unit ID .................................... 31
Check Communication ............................................. 31
Code Protect .......................................................21, 31
Connector, 6-Pin ...................................................... 11
D
Data EEPROM Memory ........................................... 34
Device Selection .................................................15, 32
Documentation
Conventions ........................................................ 6
Layout ................................................................. 5
Download PICkit 3 Programmer Operating System. 31
Driver Board
Standard ........................................................... 62
Durability, Card Guide.............................................. 60
P
PC, Power Down...................................................... 60
PGC/PGD................................................................. 26
PICkit 3 Defined ......................................................... 9
Power-Down mode................................................... 60
Program Memory ..................................................... 34
Programmer Application........................................... 29
R
Read......................................................................... 21
Read Device............................................................. 30
Read Device + Export Hex File ................................ 22
Reading, Recommended ........................................... 7
Readme...................................................................... 7
Target Power............................................................ 17
Target Vdd Source ................................................... 31
Troubleshooting ....................................................... 35
Standard Communication
Driver Board...................................................... 62
Update Firmware...................................................... 41
Update Operating System ........................................ 41
USB.................................................................... 60, 85
Hubs.................................................................. 60
USB Port .................................................................. 10
Use VPP First Program Entry .................................. 31
ICSP....................................................................25, 62
ICSPCLK.................................................................. 62
ICSPCLK/ICSPDAT ................................................. 26
ICSPDAT ................................................................. 62
Import Hex ............................................................... 30
Import Hex File......................................................... 19
Indicator Lights......................................................... 60
DS50002158A-page 87
DS50002158A-page 88
Index
NOTES:
DS50002158A-page 89
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://www.microchip.com/
support
Web Address:
www.microchip.com
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Japan - Osaka
Tel: 81-6-6152-7160
Fax: 81-6-6152-9310
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Indianapolis
Noblesville, IN
Tel: 317-773-8323
Fax: 317-773-5453
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Santa Clara
Santa Clara, CA
Tel: 408-961-6444
Fax: 408-961-6445
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
China - Hangzhou
Tel: 86-571-2819-3187
Fax: 86-571-2819-3189
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8864-2200
Fax: 86-755-8203-1760
Taiwan - Kaohsiung
Tel: 886-7-213-7828
Fax: 886-7-330-9305
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Taipei
Tel: 886-2-2508-8600
Fax: 886-2-2508-0102
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
DS50002158A-page 90
Japan - Tokyo
Tel: 81-3-6880- 3770
Fax: 81-3-6880-3771
11/29/12