• AVR Freaks

[FAQ]PICkit 2 FAQ

Page: 12345 > Showing page 1 of 5
Author
PICkit2Dev
Super Member
  • Total Posts : 994
  • Reward points : 0
  • Joined: 2006/09/27 08:41:47
  • Location: 0
  • Status: offline
2007/07/23 15:12:18 (permalink)
0

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:
  1. 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.
  2. 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.
  3. 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.
  4. 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)
  5. 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
into:
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
#1

93 Replies Related Threads

    maxmicro
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2006/03/09 03:36:50
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/04 07:06:57 (permalink)
    0

    I use PIC16F648A. In order to debug with PicKit2 I thought it was just a matter of wiring MCLR, VDD, VSS, PGC, PGB and I did but it doesn'e enter the debug mode. I understand I have to use a header. What kind of circuitry does this header contain? Can I build a header on my own or must I buy it?
     
    #2
    PICkit2Dev
    Super Member
    • Total Posts : 994
    • Reward points : 0
    • Joined: 2006/09/27 08:41:47
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/04 08:29:08 (permalink)
    0
    maxmicro,
     
    As indicated above, please see the Header Specification (available in the Downloads section of the PICkit 2 webpage) for more information.
    #3
    Ahmad_k
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2007/09/09 12:07:21
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/09 12:18:21 (permalink)
    0
    Hello i'm new in this forum but i'm not new to microchip products wink .

    I have one question to PICkit2Dev. I'm a microcontroller teacher in my institute. I have built a PICKIT2 programmer for my students, but i think why using two eeprom 24C512 in the design? I have programmed some PIC without any EEPROM inserted in there socket and all was ok. What is role of these EEPROM   
    post edited by Ahmad_k - 2007/09/09 12:19:38
    #4
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/09 16:15:41 (permalink)
    0
    I believe it is for future functionality.
    #5
    Ahmad_k
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2007/09/09 12:07:21
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/09 23:39:18 (permalink)
    0
    Please I need good explication for my students, if it is for future functionality, please i need an aknowledge from PICkit2Dev
    #6
    PICkit2Dev
    Super Member
    • Total Posts : 994
    • Reward points : 0
    • Joined: 2006/09/27 08:41:47
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/10 08:35:36 (permalink)
    0
    Ahmad_k,
     
    I'm not entirely sure why the EEPROM was included in the original design.  I think there were some ideas at the time for using it, but none have ever come to light.  At the very least, it's there as a resource for "do-it-yourself" projects;  I believe there was a Master's class last year that used it.
     
    Regards,
     
    #7
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/10 16:25:45 (permalink)
    0
    When PICkit 2 first came out, we were also guessing the function of these two EEProms. One potential function is to store the downloaded hex file in the EEprom and thus PICkit 2 can be used to program the target by pressing the button. Kind of pseudo standalone programming even though the USB cable is always necessary with the current firmware to provide the power to PICkit 2 and target Vdd/Vpp.

    The other potential use is to program an interpretter (eg BASIC or even simple Python) inside PICKit 2 and use the EEproms to store the program, something like BasicStamp.

    They can also be used to store the USB serial number and caliberation efficicents by modifying the current firmware.

    I think the original developers (Dan Butler and Steve Bible) have done a good job to design the PICkit 2.

      USB_Links and libusb
    #8
    FunnyNYPD
    Super Member
    • Total Posts : 1553
    • Reward points : 0
    • Joined: 2007/09/28 20:06:59
    • Location: USA & Canada
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/29 11:40:46 (permalink)
    0
    oh, man, too many choice just kill the the designer. My pointer of view: the simpler, the better. Funny NYPD
    #9
    JunkMe
    Starting Member
    • Total Posts : 47
    • Reward points : 0
    • Joined: 2007/09/29 17:03:22
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/29 18:17:42 (permalink)
    0
    ORIGINAL: xiaofan

    I believe it is for future functionality.

    Future Function? What Function?

    Junk Me, Proud to be Africa American.
    #10
    JunkMe
    Starting Member
    • Total Posts : 47
    • Reward points : 0
    • Joined: 2007/09/29 17:03:22
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/09/29 18:20:31 (permalink)
    0
    ORIGINAL: PICkit2Dev

    Ahmad_k,

    I'm not entirely sure why the EEPROM was included in the original design.  I think there were some ideas at the time for using it, but none have ever come to light.  At the very least, it's there as a resource for "do-it-yourself" projects;  I believe there was a Master's class last year that used it.

    Regards,


    Those EEPROM was designed for DIY??? not for debugging? and In-circuit programming? WOW.
    post edited by JunkMe - 2007/09/29 18:22:30

    Junk Me, Proud to be Africa American.
    #11
    FunnyNYPD
    Super Member
    • Total Posts : 1553
    • Reward points : 0
    • Joined: 2007/09/28 20:06:59
    • Location: USA & Canada
    • Status: offline
    RE: PICkit 2 FAQ 2007/11/13 12:27:06 (permalink)
    0
    For those chips (such as 12F508, etc.) with Factory calibrated oscillator, an oscillator calibration constant has been pre-programmed into the
    device’s program memory. however the 12F508 device datasheet expressed as (page 43/100):
     
    "Erasing the device will also erase the pre-programmed internal calibration value for the internal oscillator. The calibration value must be read prior to erasing the part so it can be reprogrammed correctly later."
     
    I got questions here:
    If I use PICkit2 or ICD2 "erase the target device memory" from MPLAB without doing anything else, will this constant be erased or not?
    Does PICKit2 have a way to keep this calibrated data safe?
    Thanks,
    Funny N.
    #12
    PICkit2Dev
    Super Member
    • Total Posts : 994
    • Reward points : 0
    • Joined: 2006/09/27 08:41:47
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/11/13 13:50:30 (permalink)
    0
    Yes, ICD 2 and PICkit 2 preserve those values on erases and writes.
    #13
    maruko
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2007/11/21 18:54:51
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/11/21 19:09:02 (permalink)
    0
    Hi,
    I have been using de PICKit2 since version 1.2x as a programmer, and all worked fine, but some days ago I have had a lot of problems with my PICKit2; these problems only apears on my nx6120 laptop:

    -When a I try to load a program into a PIC18F4620 the PICKit2 application v2.40 starts to write the program and it seems to work fine until the application tries to verify de PIC, here is when the application *freezes*; I have tried to program the same PIC with the same HEX file using my desktop and it works fine.

    -The same problem apears when I simply try to read de program memory, the application *freezes* in the middle of the reading process using my laptop, but on my desktop it does not.

    I hope you can help me with this problem as soon as you can, because I am a firmware engineer an I´m going to travel to Nicaragua to solve some firmware problems and I have to use my PICKit2 to upgrade those firmwares but my PICKit2 dosen't work on this #$%&#$& laptop,sorry
    #14
    PICkit2Dev
    Super Member
    • Total Posts : 994
    • Reward points : 0
    • Joined: 2006/09/27 08:41:47
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/11/21 19:59:34 (permalink)
    0
    maruko,
     
    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.
     
    I hope one of these will work out for you.
    #15
    maruko
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2007/11/21 18:54:51
    • Location: 0
    • Status: offline
    RE: PICkit 2 FAQ 2007/11/22 15:48:14 (permalink)
    0
    Hi, I want to thank for the help, today I bought a mini USB HUB, and the PICKit2 it's working on my laptop after I put the hub between it,thanks once again :)
    #16
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: PICkit 2 FAQ 2007/11/22 17:09:10 (permalink)
    0
    ORIGINAL: PICkit2Dev

    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.

    I hope one of these will work out for you.

     
    Most likely this is due to some inrush current issues. Some of the USB root hubs on laptops are not able to provide enough current.
     
    And passing the USB compliance test does not necessary means it passes the other tests. There are extra tests (including electrical tests) to run for USB IF compliance test if you want to put a USB logo on PICKit 2.
    http://www.usb.org/developers/compliance/
     
     
    #17
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: PICkit 2 FAQ 2007/11/22 17:13:35 (permalink)
    0
    ORIGINAL: PICkit2Dev

    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.

     
    By the way, I believe the V1.2 USB stack does not solve all the problems mentioned in the thread here.
    http://forum.microchip.com/tm.aspx?m=275422&mpage=2
    http://forum.microchip.com/tm.aspx?m=261192
    http://forum.microchip.com/tm.aspx?m=243771
    #18
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: PICkit 2 FAQ 2008/01/22 07:40:42 (permalink)
    0
    Some more FAQs.

    1. One more FAQ about how to understand the Hardware design of PICkit 2.
    http://forum.microchip.com/tm.aspx?m=283929

    2. An interesting discussion on the hardware design, in paticular why PICkit 2 has no problem with 3.3V PICs.
    http://groups.google.com/group/pickit-devel/browse_thread/thread/2dd07bed3164d97c/7c076ab1e6e79583

    3. The boost converter design is the same as PICkit 1. The design of PICKit 1 is discussed in Microchip AN258.
    http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en012103
    4. There are some changes after the initial design:
    http://forum.microchip.com/tm.aspx?m=245280

    5. Olin points out some shortcomings of PICkit 2 here. Olin's USBprog corrects some problem of PICkit 2. http://forum.microchip.com/tm.aspx?m=283491
    http://www.embedinc.com/products/eusb2/index.htm
    But actually shorting the PICkit 2 pins indefinitely to 0-6V should not cause problems, and the diode blowing problem was fixed quite some time ago. Still the USB Vdd variation can cause some problems with some PICs. In that case, an external power supply is necessary.

    6. PICkit 2 faqs and what is the reason to put the two EEPROMs:
    http://forum.microchip.com/tm.aspx?m=270347

    7. PICkit 2 versus MPLAB ICD2:
    http://forum.microchip.com/tm.aspx?m=282776
    http://forum.microchip.com/tm.aspx?m=355232

    8. PICkit 2 website and links to the source codes download for firmware (in C18) and host software (V1.x in Borland C++ Builder 6.0, V2.x in Visual C# 2005, PK2CMD in Visual C++).
    http://www.microchip.com/pickit2

    Edit on 20-April-2008 (add more links)

    9. PICkit 2 versus PICkit Serial Analyzer
    http://forum.microchip.com/tm.aspx?m=326886

    10. PICkit 2 Starter Kit versus PICkit 2 Debug Express
    http://forum.microchip.com/tm.aspx?m=323919

    11. Differences between production and development programmers
    http://forum.microchip.com/tm.aspx?m=312541

    12. ZIF with PICkit 2
    http://forum.microchip.com/tm.aspx?m=270017

    13. In Circuit Debugger (MPLAB ICD2 and PICKit 2) versus an emulator
    http://forum.microchip.com/tm.aspx?m=332883

    14. PICKit 2 ICSP interface to target PCB
    http://forum.microchip.com/tm.aspx?m=353866
    post edited by xiaofan - 2008/07/30 22:22:40

      USB_Links and libusb
    #19
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: PICkit 2 FAQ 2008/01/23 05:19:53 (permalink)
    0

    ORIGINAL: PICkit2Dev
    Unfortunately, PICkit 2 has problems with some USB controller chipsets that seem to be more common in laptops.


    Not so sure if this is related: http://forum.microchip.com/tm.aspx?m=309093. Maybe not.

      USB_Links and libusb
    #20
    Page: 12345 > Showing page 1 of 5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5