+ Reply to Thread
Page 1 of 2
1 2 Last
Results 1 to 15 of 17

Thread: Programming a PIC with PICkit2 Error

  1. #1
    hugoender Newbie
    Join Date
    May 2008
    Location
    Miami, FL
    Posts
    155

    Unhappy Programming a PIC with PICkit2 Error

    I am having a problem reprogramming my PIC with my PICkit2.

    I get the following error:

    PK2Error0027: Failed verify (Address = 0x0 - Expected Value 0x25 - Value Read 0xBE0)

    This happened to me once before and I am not quite sure how I fixed it (since all I did was click a bunch of buttons until it worked). Now that it has happened a second time, I think it is time to figure out why. I searched the forums but the other people that have this same problem just posted "nm, figured it out" but don't post what they did to fix it

    If anyone can help me out with this that would be great.


  2. #2
    eng1 Excellent eng1 Excellent eng1 Excellent eng1 Excellent eng1 Excellent
    Join Date
    Apr 2006
    Location
    Italy
    Posts
    938

    Default

    Quote Originally Posted by hugoender View Post
    I am having a problem reprogramming my PIC with my PICkit2.

    I get the following error:

    PK2Error0027: Failed verify (Address = 0x0 - Expected Value 0x25 - Value Read 0xBE0)

    This happened to me once before and I am not quite sure how I fixed it (since all I did was click a bunch of buttons until it worked). Now that it has happened a second time, I think it is time to figure out why. I searched the forums but the other people that have this same problem just posted "nm, figured it out" but don't post what they did to fix it

    If anyone can help me out with this that would be great.
    Is the PIC powered by the PICkit2? If that's the case, what Vdd output do you have on the PICkit2? If it is too low (Vdd<4.5 V), that might cause the PIC not to erase properly.
    Last edited by eng1; 28th June 2008 at 09:08 PM.

  3. #3
    Thunderchild Good Thunderchild Good Thunderchild Good Thunderchild Good
    Join Date
    Jul 2005
    Location
    UK
    Posts
    2,010

    Default

    erm do you mean that you program the pic once and it works and then when you try to program it again it won't recognise the pic ?

    if thats the case follow these steps from the microchip forum:


    Thanks to Toley for sending me a few of the problem PIC16F88 parts. This problem is unique to 18-pin parts that share the Timer1 oscillator with the PGx programming pins. Parts included are the PIC16F88, 87 and possibly the 818, 819, 62xA, & 648A.

    The problem occurs when the device is programmed so that:
    1) It uses the internal oscillator
    -and-
    2) The MCLR pin is turned off to use as a digital input instead
    -and-
    3) The program code enabled the Timer1 Oscillator in the T1CON register. (The sooner this is enabled after the reset vector the more likely the problem is to occur.

    This problem can be prevented by avoiding one of the 3 conditions above.

    It is possible to recover parts with this issue. To do so, follow these steps in the PICkit 2 Programmer software:

    A) Put the part on a breadboard or other jig where it is only connected to the 5 PICkit 2 programming signals.
    B) Open the PICkit 2 Programmer application v2.40 (or later). Select "Device Family > Midrange"
    C) Set the PICkit 2 Programmer VDD voltage box to 3.0 Volts
    D) Select "Device Family > Midrange" again; it should now detect the part
    E) If the part is not detected in D), reduce the VDD by 0.1 volts and try again. Repeat until the part is detected.
    F) Select the WRITE button. It should now erase the part.

    You will now be able to program & use the part normally at 5.0 Volts VDD.
    I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

    www.simonsphotography.org.uk/ - My other hobby
    www.rotaract1070.org.uk/ - make a difference and have fun !


    Never buy "Trust" products, all mine broke !!!

  4. #4
    hugoender Newbie
    Join Date
    May 2008
    Location
    Miami, FL
    Posts
    155

    Default

    Thanks a lot for the extremely quick responses!

    I got it to work (before I read your responses). This is what I did:

    1. Since I was getting the error while trying to program the PIC using the MPLAB IDE program, I decided to try and do it using the PICkit 2 standalone program.

    2. As soon as I opened the PICkit 2 program, it could not detect the device so I selected my PIC from the Device drop down menu. Once I did this, it downloaded some firmware for it (i think) and it found the device. I then checked the box for VDD (5V) and imported the hex file that MPLAB had created. This got the PIC working and everything was fine.

    3. I then went back to MPLAB IDE and tried programming it there and it worked.

    So, I don't know if it was that firmware upgrade or what. I do not think so because I was able to program it before without the firmware update.

    @Thunderchild:
    I do not meet any of those 3 requirements you outlined so I don't think that is my problem. I will post here if I encounter the problem again. For now it is resolved.

  5. #5
    Thunderchild Good Thunderchild Good Thunderchild Good Thunderchild Good
    Join Date
    Jul 2005
    Location
    UK
    Posts
    2,010

    Default

    Quote Originally Posted by hugoender View Post

    @Thunderchild:
    I do not meet any of those 3 requirements you outlined so I don't think that is my problem. I will post here if I encounter the problem again. For now it is resolved.
    well they are the basic setups recomended in the template file from microchip so if your as unfortunate as me to be trying to start up on the 16F88 you run into this often
    I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

    www.simonsphotography.org.uk/ - My other hobby
    www.rotaract1070.org.uk/ - make a difference and have fun !


    Never buy "Trust" products, all mine broke !!!

  6. #6
    Boomslang Good Boomslang Good
    Join Date
    Mar 2007
    Location
    South Africa
    Posts
    253

    Default

    I get the same error once in a while, I just reseat (reset) the PICKIT and it works OK again.

  7. #7
    hugoender Newbie
    Join Date
    May 2008
    Location
    Miami, FL
    Posts
    155

    Default

    Well it just happened to me again. It seems like once you program it successfully once, the second time you try, it gives you the error.

  8. #8
    hugoender Newbie
    Join Date
    May 2008
    Location
    Miami, FL
    Posts
    155

    Default

    Oh just wonderful. I think I broke my PICkit2

    I went to update the OS (since it told me to in the PICkit2 program) and by mistake clicked on the PICkit2 User Guide PDF. Now everytime I open PICkit2 program, it hangs and the busy light on the PICkit2 blinks.

  9. #9
    hugoender Newbie
    Join Date
    May 2008
    Location
    Miami, FL
    Posts
    155

    Default

    WHEW!!!! I was able to recover it using MPLAB IDE. I loaded MPLAB IDE and in there I went to Programmer > Update OS. This was the ONLY thing that was able to wake it up (stop the red busy light from blinking) and communicate with the device. Once I did this, I was able to go back into PICkit2 program and manually update the OS. Wow what a relief. I thought I had destroyed my PICkit.

  10. #10
    Thunderchild Good Thunderchild Good Thunderchild Good Thunderchild Good
    Join Date
    Jul 2005
    Location
    UK
    Posts
    2,010

    Default

    Quote Originally Posted by hugoender View Post
    Well it just happened to me again. It seems like once you program it successfully once, the second time you try, it gives you the error.
    thats is the pricise problem that I had and found those instructions for.
    I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

    www.simonsphotography.org.uk/ - My other hobby
    www.rotaract1070.org.uk/ - make a difference and have fun !


    Never buy "Trust" products, all mine broke !!!

  11. #11
    Thunderchild Good Thunderchild Good Thunderchild Good Thunderchild Good
    Join Date
    Jul 2005
    Location
    UK
    Posts
    2,010

    Default

    erm you flashed a PDF file in to the Pickit2 as the OS ? that was clever well glad to know ya got it back they are mighty exspensive to buy (considering you are quoted 17 £ and end up paying nearly 40 after VAT at 30 % and handling and postage)
    I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

    www.simonsphotography.org.uk/ - My other hobby
    www.rotaract1070.org.uk/ - make a difference and have fun !


    Never buy "Trust" products, all mine broke !!!

  12. #12
    AllVol Good AllVol Good AllVol Good
    Join Date
    Nov 2005
    Location
    Tennesee, USA
    Posts
    957

    Default

    Quote Originally Posted by hugoender View Post
    WHEW!!!! I was able to recover it using MPLAB IDE. I loaded MPLAB IDE and in there I went to Programmer > Update OS. This was the ONLY thing that was able to wake it up (stop the red busy light from blinking) and communicate with the device. Once I did this, I was able to go back into PICkit2 program and manually update the OS. Wow what a relief. I thought I had destroyed my PICkit.
    If you look very carefully, on the right side of your M-sPasm IDE screen, next to where you download to the PICkit, there is a very tiny little picture of the PICkit. Sometimes, if you are having problems, clicking on this icon will straighten things out.

    The error is very common, especially if you are trying to program devices that are not compatable with PICkit, such as the popular 16F84A. When you select your target device in MPasm, be sure the green or yellow dot shows next to PICkit2. If not, you will always get the error.

    Also, problems with the Master reset or Vpp will cause this error.

    I'm still trying to figure it all out, also. These are just a few hints I've discovered.

    Don't be too concerned with harming your PICkit2. They are tough, designed to be used by we dummies. LOL!

    G'luck.
    Creationists have a world of evidence

  13. #13
    hugoender Newbie
    Join Date
    May 2008
    Location
    Miami, FL
    Posts
    155

    Default

    Quote Originally Posted by Thunderchild View Post
    erm you flashed a PDF file in to the Pickit2 as the OS ? that was clever...
    lol yes I know... I feel dumb... but I did not do it on purpose. I misclicked (double clicked the pdf instead of the hex).

  14. #14
    hugoender Newbie
    Join Date
    May 2008
    Location
    Miami, FL
    Posts
    155

    Default

    I am becoming much more comfortable using the PICkit2 and it's software now. I have realized that the software and hardware do some things without telling you when you change certain things.

    What I mean by this is for example:
    When you go to MPLAB and click on Programmer > VDD Off and then turn it back on, it holds the PIC on reset. Basically, you can turn off the reset through the Programmer menu but when you turn VDD back on, it automatically turns the reset on again. This is something that if unless you know this is happening, you would not know that the PICkit2 is holding your PIC on reset and that is why it is not working.

  15. #15
    Boomslang Good Boomslang Good
    Join Date
    Mar 2007
    Location
    South Africa
    Posts
    253

    Default

    Quote Originally Posted by hugoender View Post
    lol yes I know... I feel dumb... but I did not do it on purpose. I misclicked (double clicked the pdf instead of the hex).
    The funniest thing I've read in a long time!

+ Reply to Thread
Page 1 of 2
1 2 Last

Similar Threads

  1. Programming error- pic16lf84a
    By joshua17ss2 in forum Micro Controllers
    Replies: 28
    Latest: 17th April 2008, 07:24 PM
  2. PICkit2 / Junebug bootloader, anyone familiar with custom programming?
    By blueroomelectronics in forum Micro Controllers
    Replies: 13
    Latest: 5th April 2008, 03:39 PM
  3. Programming PIC16F628A using PICKIT2
    By Ken Ho in forum Micro Controllers
    Replies: 9
    Latest: 20th September 2006, 12:38 PM
  4. Error programming 16F628
    By gregmcc in forum Micro Controllers
    Replies: 67
    Latest: 28th August 2005, 08:17 AM
  5. 16F84A programming error using P16PRO40
    By rizzy in forum Micro Controllers
    Replies: 21
    Latest: 11th December 2004, 06:17 AM

Tags for this Thread