Problem proramming PIC 16F886 with PICKIT2?


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default Problem proramming PIC 16F886 with PICKIT2?

    Have been using my PICKIT2 for years to program PBP into PIC chips on my board apps via ICSP connection. Has always worked great. Especially when using the FineLine IDE.
    However in last few days for somereason I am seeing some anomalies. Had to manually select the chip via PICKIT2 user interface even though FLide was telling it the chip type. Then it appeared that it wrote my PBP code to the 16F886 OK when I used the "Auto Import HEX +write device" button on the PICKIT2. I say it looked OK because the program memory window displayed by the PICKIT2 appeared like it had my code.

    However, when I try to READ the device with the PICKIT2 GUI READ button, I see all zeros in all the memory addresses and in the EEPROM addresses. I notice also under the Configuration: label on the GUI a message is being displayed in RED color saying "All protect". I have never seen this before. Can anyone tell me what it means and how I can resolve this??

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Problem proramming PIC 16F886 with PICKIT2?

    I don't have the PICKit2 but it sounds as if the code protection feature of the device is ON. The code most likely IS programmed into the chip, you just can't read it due to thr protection being turned on. Check the device configuration.

  3. #3
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Problem proramming PIC 16F886 with PICKIT2?

    Henrick, you are partially correct. I checked the settings under Tools menu before the READ and the Enable Protects were not checked on either the Program or EPPROM. However, I notice after I click the READ button it appear to go thru the read process, but only shows zeros in both Program and EEPROM memory, the RED colored "All protect" warning appears, and now when I check the Enable Protect settings under the Tools menu they are both selected but grayed out and it is not possible to manually unselect them. I have to exit the PICKIT2 GUI and start over to see them unselected. But then same thing happens.

    Hopefully someone who has a PICKIT2 can read this post and tell me what is going on. I can no longer do either a program Write or a Read of program or EEPROM memory and am out of business!

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Problem proramming PIC 16F886 with PICKIT2?

    Hi,
    You need to check the configuration bits before programming the chip.

    The whole idea behind them is protect the code from being read out so if you were able to change them in the PICKit2 program AFTER they where written they'd be kind of useless.

    Load you .hex file into the software THEN verify that the protect bits aren't set, reprogram the chip - now you should be able to read it back.

    /Henrik.

    EDIT: If you can't reprogram the chip either, try a full erase first - that should clear the protection bits. I'm not sure if there's a setting or not for that though, my PK3 seems to ALWAYS do an erase before write.
    Last edited by HenrikOlsson; - 6th January 2012 at 16:08.

  5. #5
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default Re: Problem proramming PIC 16F886 with PICKIT2?

    Just in case you suspect the Pickit2 is out of whack, there is an option in the pk2 user interface(my version is 2.61.00). Tools->"Download Pickit2 OS". Try this if you're out of options.

  6. #6
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Problem proramming PIC 16F886 with PICKIT2?

    I just downloaded & installed Application version 2.61.00 and Device File Version 1.62.14. After doing this I tried to used the PICKIT2 and I get a continuous message of "No Device detected" in a yellow window on the PICKIT2 application GUI.
    I also tried your suggestion to use the Tools->"Download Pickit2 OS" feature in the GUI, but it doesn't work on my PICKIT2 application software. The menu does list it but when I click on it, it doesn't go to the internet to look for an update, it just opens Explorer window to look for the file locally in my computer. This doesn't help since the OS update file isn't in my local computer yet.
    What I need to know is how to find the latest OS version for PICKIT2 on the web and how to download and install it in my PICKIT2. Can anyone advise me or point me to a tutorial.

  7. #7
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Problem proramming PIC 16F886 with PICKIT2?

    Henrick: After downloading/installing updates to the Application software to v2.61.00 and Device File v1.62.14 I tried to reprogram the chip. At least now the "All Protect" warning is gone and the Enable Protect menu selection in Tools are operable and unselected, indicating the protection bits were cleared. However chip will not program or erase and displays continuous "No device detected" message in yellow window.
    Any other suggestions?

  8. #8


    Did you find this post helpful? Yes | No

    Default Re: Problem proramming PIC 16F886 with PICKIT2?

    Hi, Check all the connections from Pickit2 to your board. Anything loose or broken, especially ICSP Data and ICSP Clk, will produce that message.

  9. #9
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default Re: Problem proramming PIC 16F886 with PICKIT2?

    Jellis00

    You can point explorer to the hex file in ProgramFiles\Microchip\Pickkit2 v2 or similar. That is what it is looking for.

    as for the yellow box telling you no device found, it is very likely you are connecting the pickit2 to an unpowered board which may be loading the pickit2 resulting in this message. You may also get the ding-dong of USB device disconnection. If this is happening, I advise you should try to program an isolated PIC. No other components on the board. Another way is to power up your board and then try programming with the pickit2. It automatically senses that the board is powered and makes adjustments to its power conditions.

    Hope that helps

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts