PICkit 2 FAQ
A: MPLAB IDE: PK2Error0028: Unable to Enter Debug Mode
B: MPLAB IDE: PK2Error0009 when selecting PICkit 2 as Debugger or Programmer
C: Where do I find documentation on using PICkit 2 as a Debugger?
D: The Debugger / Programmer option for PICkit 2 is grayed out in MPLAB
E: Windows Error: Unrecognized USB Device
F: Pushbutton doesn't work with Low Pin Count (LPC) or 28-Pin Demo Boards
G: The MPLAB IDE and PICkit 2 Programmer application keep downloading different Operating Systems (Firmware)
H: Configuration Verification Fails, then I can't program/read the Device
I: The PICkit 2 Programmer Application keeps reporting a "VDD Error"
J: When Debugging I see "R" for some Program Memory and File Register locations
K: PICkit 2 won't program my PIC10F part in the Low Pin Count Demo Board
L: What HEX file format does PICkit 2 use?
M: What's the AUX pin for? How do I connect it?
N: The PICkit 2 Programmer software GUI sometimes "locks up" while programming or reading.
O: MPLAB IDE: Debugging is very slow! A: MPLAB IDE: PK2Error0028: Unable to Enter Debug Mode
There are many reasons this error may be encountered. Some things to check are:
- The part may require an ICD Header for debugging. See the Header Specification (available in the Downloads section of the PICkit 2 webpage) for information on which parts need headers and which header to get. Note that to connect PICkit 2 to a debug header, an RJ-11 to ICSP adapter is required.
- If the part does not have an internal oscillator, or an external oscillator is selected in the Configuration bits, it must be connected to a working oscillator in order to debug the part. If there is no oscillator, the part cannot execute code and won't enter Debug Mode.
- Make sure to select Debugger > Program in MPLAB before trying to run or step your code. The part won't run without code programmed into it.
- Also check to be sure your code is not trying to use reserved areas of program memory or the File Registers. See section 4.1.2 of the most recent revision of the PICkit 2 User's Guide. (available in the Downloads section of the PICkit 2 webpage)
- 4.7k Ohm pulldown resistors are required on the ICSPx/PGx signal lines for reliable operation. If your PICkit 2 has a black pushbutton (R3 or older), these resistors need to be added (See this thread for more information). If your PICkit 2 has a red pushbutton (R4 or newer), these resistors are already connected internally to the PICkit 2 so nothing need be done.
Finally, it may be helpful to go through the Debug Express Tutorial in Chapter 4 of the PICkit 2 User's Guide. Make sure to download the most recent revision of this document from the Downloads section of the PICkit 2 webpage
. B: MPLAB IDE: PK2Error0009 when selecting PICkit 2 as Debugger or Programmer
When encountered jsut after selecting PICkit 2 as a debugger or programmer in the MPLAB IDE, or opening a Workspace where it is selected, this usually means MPLAB is unable to find and connect to the PICkit 2. Check that the PICkit 2 is properly connected to a USB port and the green "Power" LED is on. If the PICkit 2 is connected through a USB hub to the PC, try connecting it directly to a PC USB port. Some hubs can cause operation problems. C: Where do I find documentation on using PICkit 2 as a Debugger?
See "Chapter 4" of the latest version of the PICkit 2 User's Guide, available in the Downloads section of the PICkit 2 webpage
. This provides information on debugger usage as well as a tutorial. D: The Debugger / Programmer option for PICkit 2 is grayed out in MPLAB
PICkit 2 device support in the MPLAB IDE is different from (a subset of) the devices supported by the PICkit 2 Programmer Application. For devices supported by the latest version of the MPLAB IDE, see the PICkit 2 Device Support List
For a list of supported devices in a particular installed version of the MPLAB IDE, see the Readme for PICkit 2
in the “Readmes” subdirectory of “MPLAB IDE.” (Typically C:\Program Files\Microchip\MPLAB IDE\Readmes) E: Windows Error: Unrecognized USB Device
This error could occur in PICkit 2 units with a black
pushbutton (R3 or older). There is a hardware fix for this issue; see this thread
for more information.
This error may also occur with any unit if it is connected to a target board when plugged into USB, expecially if the target board is powered. Always connect the PICkit 2 unit to USB before connecting to a target board. F: Pushbutton doesn't work with Low Pin Count (LPC) or 28-Pin Demo Boards
The pushbutton cannot be used on these demo boards when debugging or programming and powering them from the MPLAB IDE. The pushbutton switch is connected to the input pin that is shared with the nMCLR/VPP pin. When Debugging, this pin must be used as nMCLR and cannot be used as an input pin. When programming and leaving the PICkit 2 connected to the Demo Board to power it, the MPLAB IDE always maintains a valid output state on a programmer's nMCLR/VPP pin which prevents the switch from changing the signal value. Use the PICkit 2 Programmer software to allow the switch to be used. G: The MPLAB IDE and PICkit 2 Programmer application keep downloading different Operating Systems (Firmware)
The MPLAB IDE and PICkit 2 Programmer have different release schedules so may use different firmware versions. You can prevent the MPLAB IDE from changing the firmware version by copying the following file:
C:\Program Files\Microchip\PICkit 2 v2\PK2V021000.hex
C:\Program Files\Microchip\MPLAB IDE\PICkit 2\
NOTE: This is valid for v2.40 of the PICkit 2 Programmer Application. See Help > Readme
in the application and check the Release Notes for other versions. H: Configuration Verification Fails, then I can't program/read the Device
Try selecting Tools > Use VPP First Program Entry
. (Only applies to some device families; for others, this menu option won't be available. Also, this option is only in v2.40 or later.)
See the Readme file under Help > Readme
in the PICkit 2 Programmer application for more details on this feature. I: The PICkit 2 Programmer Application keeps reporting a "VDD Error"
See this forum thread
. J: When Debugging I see "R" for some Program Memory and File Register locations
Microchip's In Circuit Debugging reserves some chip resources to enable debugging. This usually includes some code space at the end of Program Memory, a few file registers, and 1 level of the stack. Note that if your code also attempts to use these locations it as well as the debug connection may get corrupted. See section 4.1.2 of the current PICkit 2 User's Guide from the Downloads section of the PICkit 2 webpage
. K: PICkit 2 won't program my PIC10F part in the Low Pin Count Demo Board
PIC10F parts cannot be programmed in the LPC Demo Board. Even though they are available in 8DIP packages, PIC10F parts are considered "6-pin" parts (2 DIP pins are NC) and have a different pinout from standard 8-pin PIC parts. PIC10F Adapter Boards
compatible with PICkit 2 are available. L: What HEX file format does PICkit 2 use?
PICkit 2 uses the Intel Hex 32 format
, sometimes referred to as INHX32. However, it does not support record types 03 and 05. Least significant bytes are at lower addresses (little Endian). M: What's the AUX pin for? How do I connect it?
The PICkit 2 AUX pin is not used for programming PIC microcontrollers, and should be left unconnected. It is only used when programming some Serial EEPROMs. The Readme file under Help > Readme
in PICkit 2 Programmer v2.40 provides serial EEPROM connection information under section 3. "Release notes V2.40.00" N: The PICkit 2 Programmer software GUI sometimes "locks up" while programming or reading.
There may be occasions where the software truly locks up, but usually this isn't case. If it seems to get "fixed" by clicking the "X" close window box, then re-opening the application it probably isn't locking up at all.
What is happening here is that when the Windows operation system focus has just returned to the PICkit 2 window, or another window is brought into focus during programming, Windows may stop updating the PICkit 2 application window as it is not a multi-threaded application. When the programming operation is complete Windows will start updating the PICkit 2 window again with the results of the programming operation.
If this is happening, be patient and allow the programming operation time to complete before closing the window or killing it in the Task Manager. Note that for large memory parts, programming can take a few minutes. If this happens programming 8-bit parts, wait 2 minutes for the operation to complete before concluding that the application has locked up. With 16-bit parts, try waiting 5 minutes for the operation to complete. Situations where it does truly lock up - usually happens on a READ or VERIFY.
Unfortunately, PICkit 2 has problems with some USB controller chipsets that seem to be more common in laptops. We're not sure what the problem is, and the Microchip USB stack has passed all the USB compliance test software we've run it with.
However, some users have had luck resolving this issue by putting a USB hub between the laptop and PICkit 2. I'd suggest a hub that has its own power supply, especially if you'll be using PICkit 2 to power a target.
Another user resolved the issue by connecting the PICkit 2 to a Belkin DX-UC202 USB / Cardbus adapter in the laptop instead of the built-in ports. O: MPLAB IDE: Debugging is very slow!
The following may the source of slow debug issues: File Registers Window
is open. With this window open, all file registers must be read from and written to the PIC MCU during each debugging operation. This can really slow things down! Close this window and watch only needed registers and variables using a Watch Window
instead. Special Function Registers Window
is open. With this window open, all SFRs must be read from and written to the PIC MCU during each debugging operation. This can really slow things down! Close this window and watch only the needed SFRs using a Watch Window
instead. Slow MCU Oscillator
results in slow debugging as the oscillator speed directly affects the debugger communications speed. Using a 32kHz clock can really slow things down!
post edited by PICkit2Dev - 2009/01/01 21:41:46