Beruflich Dokumente
Kultur Dokumente
Microcontroller Programmer
USER’S GUIDE
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the 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.
Table of Contents
Preface ........................................................................................................................... 1
Chapter 1. PICkit™ 2 Overview
1.1 Introduction ..................................................................................................... 5
1.2 Highlights ........................................................................................................ 5
1.3 PICkit™ 2 Microcontroller Programmer Contents .......................................... 5
1.4 Introducing the PICkit™ 2 Microcontroller Programmer ................................. 5
1.5 PICkit™ 2 Microcontroller Programmer Overview .......................................... 6
1.6 Programming Software ................................................................................... 8
Chapter 2. Getting Started
2.1 Introduction ................................................................................................... 11
2.2 Installing the PICkit 2 Programming Software .............................................. 11
2.3 Using the PICkit 2 Programming Software ................................................... 11
Chapter 3. PICkit™ 2 and ICSP™
3.1 Introduction ................................................................................................... 17
3.2 Isolate VPP/MCLR/Port Pin ........................................................................... 18
3.3 Isolate ICSPCLK or PGC and ICSPDAT or PGD pins ................................. 18
3.4 VDD ............................................................................................................... 19
3.5 VSS ............................................................................................................... 20
3.6 Other Considerations ................................................................................... 20
Chapter 4. Updating the PICkit™ 2 Operating System
4.1 Introduction ................................................................................................... 21
4.2 Updating the PICkit 2 Microcontroller Programmer ...................................... 21
Chapter 5. Troubleshooting
5.1 Introduction ................................................................................................... 23
5.2 Frequently Asked Questions ........................................................................ 23
Appendix 6. Hardware Schematics
6.1 Introduction ................................................................................................... 25
Worldwide Sales and Service .................................................................................... 28
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 on-line help.
Select the Help menu, and then Topics to open a list of available on-line help files.
INTRODUCTION
This chapter contains general information about this user’s guide and customer support
that will be useful prior to using the PICkit™ 2 Microcontroller Programmer. Items
discussed in this chapter include:
• Document Layout
• Conventions Used in this Guide
• Warranty Registration
• Recommended Reading
• The Microchip Web Site
• Development Systems Customer Change Notification Service
• Customer Support
• Document Revision History
• Troubleshooting
DOCUMENT LAYOUT
This document describes how to use the PICkit™ 2 Microcontroller Programmer. The
manual layout is as follows:
• Chapter 1. PICkit™ 2 Overview – An overview of the PICkit™ 2 Microcontroller
Programmer.
• Chapter 2. Getting Started – Provides instruction on how to get started using the
PICkit™ 2 Microcontroller Programmer to program Flash-based PICmicro®
microcontroller units (MCU).
• Chapter 3: PICkit™ 2 and ICSP™ – Provides instruction on programming with
the PICkit™ 2 Microcontroller Programmer using In-Circuit Serial Programming™
(ICSP™).
• Chapter 4: Updating the PICkit™ 2 Operating System – Provides instruction on
how to update your PICkit™ 2 Microcontroller Programmer’s Operating System.
DOCUMENTATION CONVENTIONS
Description Represents Examples
Code (Courier font):
Plain characters Sample code #define START
Filenames and paths c:\autoexec.bat
Angle brackets: < > Variables <label>, <exp>
Square brackets [ ] Optional arguments MPASMWIN [main.asm]
Curly brackets and pipe Choice of mutually exclusive argu- errorlevel {0|1}
character: { | } ments; An OR selection
Lowercase characters in Type of data "filename"
quotes
Ellipses... Used to imply (but not show) addi- list
tional text that is not relevant to the ["list_option...,
example "list_option"]
0xnnn A hexadecimal number where n is a 0xFFFF, 0x007A
hexadecimal digit
Italic characters A variable argument; it can be either a char isascii (char,
type of data (in lowercase characters) ch);
or a specific example (in uppercase
characters).
Interface (Arial font):
Underlined, italic text A menu selection from the menu bar File > Save
with right arrow
Bold characters A window or dialog button to click OK, Cancel
Characters in angle A key on the keyboard <Tab>, <Ctrl-C>
brackets < >
Documents (Arial font):
Italic characters Referenced books MPLAB® IDE User’s Guide
WARRANTY REGISTRATION
Please complete the enclosed Warranty Registration Card and mail it promptly.
Sending in the Warranty Registration Card entitles users to receive new product
updates. Interim software releases are available at the Microchip web site.
RECOMMENDED READING
It is recommended that you become familiar with the documents listed below, prior to
using the PICkit™ 2 Microcontroller Programmer.
PICkit 2 Low Pin Count Demo Board User’s Guide (DSXXXXX)
Consult this document for instructions on how to use Microchip Technology’s Low Pin
Count devices (8-pin, 14-pin and 20-pin). This document includes a series of tutorials.
MPLAB® IDE, Simulator, Editor User’s Guide (DS51025)
Consult this document for more information pertaining to the installation and features
of the MPLAB Integrated Development Environment (IDE) Software.
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
• Development Systems Information Line
Customers should contact their distributor, representative or field application engineer
(FAE) for support. Local sales offices are also available to help customers. A listing of
sales offices and locations is included in the back of this document.
Technical support is available through the web site at: http://support.microchip.com
In addition, there is a Development Systems Information Line which lists the latest ver-
sions of Microchip’s development systems software products. This line also provides
information on how customers can receive currently available upgrade kits.
The Development Systems Information Line numbers are:
1-800-755-2345 – United States and most of Canada
1-480-792-7302 – Other International Locations
TROUBLESHOOTING
• See Chapter 5 for information on common problems.
1.2 HIGHLIGHTS
This chapter discusses:
• The PICkit™ 2 Contents
• The PICkit™ 2 Overview
• PICkit™ 2 Programming Software
6 5
Legend:
1 – Status LEDs 3 – Lanyard Connection 5 – Pin 1 Marker
2 – Push Button 4 – USB Port Connection 6 – Programming Connector
Pin Descriptions
1 – VPP/MCLR
1 2 – VDD Target
2
3 3 – VSS (Ground)
4
5 4 – ICSPDAT/PGD
6 5 – ICSPCLK/PGC
6 – Auxiliary
Note: The connector is a 6-pin header with 0.100" spacing and can accept
0.025" square pins.
Menu Bar
Device Configuration
Status Bar
Progress Bar
Program Memory
DEVICE FAMILY
Baseline (12-bit Core) – Configures the programming software for baseline Flash
devices
Mid-range (14-bit Core) – Configure the programming software for mid-range
Flash devices
PIC18 – Configures the programming software for PIC18F Flash devices (future
feature, presently grayed out)
PIC18J – Configures the programming software for PIC18FXXJXX Flash devices
(future feature, presently grayed out)
dsPIC – Configures the programming software for dsPIC Flash devices (future
feature, presently grayed out)
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 software.
Erase – Performs a bulk erase of the target MCU. OSCCAL and band gap values
are preserved (PIC12F629/675 and PIC16F630/676 only).
Blank Check – Performs a blank check of program memory, data EEPROM
memory, ID locations and configuration bits.
Full Erase (OSCCAL and BG erased) – Performs a bulk erase including the
OSCCAL and Band Gap (BG) values (PIC12F629/675 and PIC16F630/676 only).
Regenerate OSCCAL – Regenerates the OSCCAL value (only for
PIC12F629/675 and PIC16F630/676). The AUX line must be connected to the
RA4/T1G pin.
Set Band Gap Calibration Value – Sets the band gap value (only for
PIC12F629/675 and PIC16F630/676).
TOOLS
Code-Protect Device – Enables code protection features of the microcontroller on
future write operations.
Target Power – Power target from PICkit™ 2 Microcontroller Programmer.
Check Board – Verifies communication with the PICkit™ 2 Microcontroller
Programmer and reads the device ID of the target MCU.
Download PICkit 2 Operating System – Performs a download of the PICkit™ 2
Microcontroller Programmer firmware operating system.
ABOUT
This displays a dialog box indicating the version and date.
If the Baseline (12-bit core) Flash device family is selected, the user must select the
specific device from the device drop down box as shown in Figure 2-4.
CAUTION
Ensure that the correct Baseline Flash device has been selected. These devices do not
contain a device ID to confirm device selection. Choosing the wrong Baseline Flash
device may cause an erasing of the OSCCAL value stored in the last memory location.
Note: When starting the PICkit 2 Microcontroller Program, target power defaults
to off.
CAUTION
The USB port current limit is set to 100 mA. If the target plus PICkit 2 Microcontroller
Programmer exceed this current limit, the USB port will turn off. The target may be
powered externally if more power is required.
2.3.5 Write
After a device family has been selected and a hex file has been imported, the target
PICmicro MCU can be programmed by clicking on the Write button. The PICmicro
MCU will be erased and programmed with the hex code previously imported. The
status of the Write operation is displayed in the status bar located under the Device
Configuration window.
Note: The device will be erased prior to programming. The PICkit 2 Microcontroller
Programmer uses the bulk erase method that requires VDD voltage between
4.5 to 5.5V
If the write is successful, the status bar turns green and displays “Write Successful”, as
shown in Figure 2-7.
If the write fails, the status bar turns red and displays “Verify failed”, as shown in
Figure 2-8. 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.
2.3.7 Verify
The Verify function verifies the device program to the imported hex file. It compares all
areas of memory including program memory, data EEPROM memory, ID and configu-
ration bits.
To verify the code, import the hex file and click the Verify button. If the code is the
same, the status bar turns green and displays “Device Verified”. If a discrepancy is
found, the status bar turns red and displays where the error is located: “Error in
Program Memory, Data EEPROM Memory, or Configuration Bits”.
2.3.8 Read
To view the code written to the PICmicro MCU, click the Read button. The code is
displayed in the Program and Data EEPROM Memory windows for your review. If all
zeros are displayed, it is possible that the device is code-protected.
Note: If the device is read after it has been code-protected, Program Memory and
Data EEPROM Memory windows will display all zeros.
2.3.10 Erase
The Erase function erases the program memory, data EEPROM memory, ID and
configuration bits. However, this function is not normally needed since the Write
function performs an erase operation prior to programming the PICmicro MCU.
To erase the device, click the Erase button.
Note: The PICkit 2 Microcontroller Programmer uses the bulk erase method that
requires VDD voltage between 4.5 to 5.5V.
Note: For details on how a specific device is programmed, refer to the device
programming specification available from the Microchip web site at
www.microchip.com.
Isolation Circuitry:
Resistor or Schottky-type diode
PICkit™ 2
Programming
+5V Header
1 VPP/MCLR
2 VDD
3 VSS
4 ICSPDAT/PGD
5 ICSPCLK/PGC
6 AUX
+5V
* Typical Values
3.4 VDD
During ICSP programming, the PICmicro MCU needs to be powered in accordance
with the device specification. Typically, the PICmicro MCU supply voltage is connected
to the application circuit supply voltage. The application circuit can be powered by the
PICkit 2 Microcontroller Programmer or externally. There are a few precautions that
need to be observed.
CAUTION
The PICkit 2 Microcontroller Programmer supply voltage (VDD) is +5V.
CAUTION
The USB port current limit is set to 100 mA. If the target plus PICkit 2 Microcontroller
Programmer exceeds this current limit, the USB port will turn off. The target may be
powered externally if more power is required.
CAUTION
The PICkit 2 Microcontroller Programmer supply voltage (VDD) is +5V.
3.5 VSS
The power supply ground reference, Vss, must be at the same potential as the
application circuit.
Step 3. Browse to the directory where the latest Operating System code was
saved as shown in Figure 4-2.
Step 4. Select the PK2*.hex file and click on the Open button.
The progress of the OS update will be displayed in the status bar of the programming
software and the Busy LED on the PICkit 2 Microcontroller Programmer will flash.
When the update completes successfully, the status bar will display “Operating System
Verified” and the Busy LED will go out. The operating system update is then complete.
Chapter 5. Troubleshooting
5.1 INTRODUCTION
This chapter describes questions and answers to common problems associated with
using the PICkit™ 2 Microcontroller Programmer and how to resolve them.
3 J1 R2 R3 R1
C1 4 TM 470Ω
ICSP 470Ω 470Ω
0.1 μF 5
FIGURE 6-1:
6
U1 NC
PIC18F2550/SO SW1 BUSY DS1 TARGET DS3 POWER DS2
PROGRAM YELLOW GREEN
2 RED
RA0/AN0 VPP FEEDBACK
20 3
VDD RA1/AN1 VDD TGT FB
4
RA2/AN2/VREF-/CVREF ICSPDAT
5
RA3/AN3/VREF+ ICSPCLK
6
RA4/T0CKI/C1OUT/RCV AUX
7
RA5/AN4/SS/HLVDIN/C2OUT MCLR TGT
1
MCLR/VPP/RE3 R33
21 33Ω
RB0/AN12/INT0/FLT0/SDI/SDA SDA
22
C2 RB1/AN10/INT1/SCK/SCL SCL
22 pF X1 23
20 MHz RB2/AN8/INT2/VM0 VPP ON
9 24
OSC1/CLKI RB3/AN9/CCP2/VP0 VDD TGT N
25
RB4/AN11/KBI0 VDD TGT P
26
RB5/KBI1/PGM
27 +5V_USB
10 RB6/KBI2/PGC
OSC2/CLKO/RA6 28
RB7/KBI3/PGD
C3
22 pF 11 +5V_USB
RC0/T1OSO/TI3CKI
12 C5
RC1/T1OSI/CCP2/UOE VPP PUMP C6 +
13 VDD_TGT_ADJ 10 μF
RC2/CCP1 0.1 μF
14 C4 16V
VUEB 0.1 μF
15
RC4/D-/VM C7
8 16 5 U2
VSS RC5/D+/VP 0.47 μF R4
19 17 MCP6001U Q1
VSS RC6/TX/CK WP 10 KΩ 3 - IRLM6402
18
RC7/RX/DT/SDO 4 G S
+
C8 1 R31
+5V_USB 0.1 μF 100Ω +V_TGT
2 D
Appendix 6. Hardware Schematics
+5V_USB +5V_USB
1
+5V_USB 2 R5
J2 R6 10 KΩ
C9 C10 3 R7
USB 10 KΩ 10 KΩ
0.1 μF 0.1 μF 4 Mini-B
NC
PICkit 2 SCHEMATIC DIAGRAM (PAGE 1 OF 2)
5
+5V_USB R8 R9
U3 U4 2.7 KΩ 2.7 KΩ
24LC512 24LC512
1 A0 VCC 8 1 A0 VCC 8
2 7 2 WP 7
A1 WP WP A1 WP
3 6 3 6
A2 SCL SCL A2 SCL SCL
4 5 4 5
VSS SDA SDA VSS SDA SDA
2^1 2^0
This appendix contains PICkit™ 2 Microcontroller Programmer schematic diagrams.
PICkitTM 2 USER’S GUIDE
DS51553A-page 25
DS51553A-page 26
+V_TGT 10Ω 33Ω
VDD TGT FB R10 R11
AUX
+ C11 Q2
C12 MMBT3906
10 μF R26
0.1 μF
16V 4.7 KΩ
FIGURE 6-2:
U5
FDC6420C
R12 R13
10 KΩ Q1(N) 1 KΩ
D 6
PICkitTM 2 User’s Guide
1 G S 5
VDD TGT N
10Ω 33Ω
2 S
R14 R15
ICSPCLK
D4
R30 BAT54
2.7 KΩ 3 G D 4 Q3
VDD TGT P MMBT3906
Q2(P) MMBD4148
+V_TGT High turns on N D1 R17
R16 Low turns on P 820Ω
10 KΩ
VDD_TGT
+5V_USB
C13 C14 +
10 μF 10Ω 33Ω
0.1 μF
16V L1 R19 R20
680 μH ICSPDAT
D3
BAT54 Q5
MMBT3906
J3
R21
10 KΩ ICSPTM
Q4 + C15
VPP PUMP R22 R23 6
MMBT3904 4.7 KΩ 47 μF AUX
25V 100 KΩ 5 ICSPCLK
Q6 4 ICSPDAT
MMBT3906 3 GND
VPP FEEDBACK 2 VDD_TGT
1 VPP
R24
R25 VPP
2.7 KΩ
10 KΩ
PICkit 2 SCHEMATIC DIAGRAM (PAGE 2 OF 2)
R27
10 KΩ
VPP ON Q7 R28
MMBT3904 100Ω
R29
10 KΩ
MCLR TGT Q8
MMBT3904
04/20/05