• AVR Freaks

Failed to program device (MPLAB X IDE and PICKIT 3)

Page: 12 > Showing page 1 of 2
Author
PelleS
New Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2011/03/28 10:53:44
  • Location: 0
  • Status: offline
2019/01/02 03:29:22 (permalink)
0

Failed to program device (MPLAB X IDE and PICKIT 3)

I've been having problems the last couple of days programming PIC chips. I suspect I've done something wrong in MPLAB X IDE, as I can not see there being problems with the chip (I have tried three different ones with the same result). I have the PICKIT 3 connected to a PIC16F54 with no other circuitry. The chip is  powered from the PICKIT. The code is in C and only has an empty main function. When trying to program, this is what I get:
 
Connecting to MPLAB PICkit 3...

Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.54.00
Firmware type..............Baseline

Programmer to target power is enabled - VDD = 4.500000 volts.

Device Erased...

Programming...

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x1fe
program memory
Address: 0 Expected Value: a01 Received Value: 0
Failed to program device

 
Sometimes, the "Expected Value" is different from a01. Does anybody have an idea what the reason might be?
#1

25 Replies Related Threads

    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 03:37:42 (permalink)
    0
    It would appear the chip is never getting into program mode.
    It's difficult to tell with these old baseline devices, newer/bigger parts have a device ID which the programmer reads out first.
    You would probably get the same errors if the chip was not there at all.
    Are you sure you don't have PGC & PGD swapped, or some component preventing the MCLR pin being raised to 12V?
     
     

    Nearly there...
    #2
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 04:06:10 (permalink)
    0
    Thank you for the quick answer! I took out the chip, and you're right, the error message stayed the same. Clock pin and Data pin are connected correctly. I have a resistor over VPP and VDD as stated in the documentation.
     
    I have tried programming two different PIC10F220 as well, with the samme error. Do I need a separate supply to raise it to 12V, or is the USB powered PICKIT able to do that on its own?
    #3
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 06:30:59 (permalink)
    0
    I have checked the voltage, and can confirm that it reaches around 12v, so that shouldn't be the problem.
    #4
    NKurzman
    A Guy on the Net
    • Total Posts : 19144
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 07:08:34 (permalink)
    0
    Does the chip have 0.1uF decoupling caps?
    What is the value of the pull up resistor on MCLR?
    Why is Vdd 4.5 and not 5.0? What is the minimum programming voltage for that PIC?
    #5
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 07:23:30 (permalink)
    0
    When I try setting it to 5v, I get this: 
     
    PICkit 3 is trying to supply 5.000000 volts from the USB port, but the target VDD is measured to be 4.500000 volts. This could be due to the USB port power capabilities or the target circuitry affecting the measured VDD.

    The target circuit may require more power than the debug tool can provide. An external power supply might be necessary.
    Connection Failed.

     
    I thought the PICKIT was able to adjust this itself, considering it reaches a lot higher during programming. I might be wrong. 
     
    Edit: There are no caps, and the pull-up is 1K.
    post edited by PelleS - 2019/01/02 07:25:45
    #6
    NKurzman
    A Guy on the Net
    • Total Posts : 19144
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 08:05:54 (permalink)
    0
    The try 4.75V
    And you need one 0.1uf cap on each pair of Vcc/ Gnd pins.
    1K is a little strong but should be OK.
    But try it with the resistor removed.
    #7
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 08:17:37 (permalink)
    0
    I tried 4.75, but still same error. I've tried without resistor, as well as with a weaker one, but neither fixed it. I have programmed this chip a few years ago with luck, and didn't use any caps.
    #8
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 14:20:01 (permalink)
    0
    PelleS
    When I try setting it to 5v, I get this: 
     

    PICkit 3 is trying to supply 5.000000 volts from the USB port, but the target VDD is measured to be 4.500000 volts. This could be due to the USB port power capabilities or the target circuitry affecting the measured VDD.

    The target circuit may require more power than the debug tool can provide. An external power supply might be necessary.
    Connection Failed.

    This indicates that your USB port is not supplying enough voltage to the PK3.
    You could either try a different USB port on your PC, or connect via a powered USB hub.

    I thought the PICKIT was able to adjust this itself, considering it reaches a lot higher during programming. I might be wrong.

    You are mixing up the two power supplies.
    Vdd is the supply voltage. 5V for many chips. 3.3V for many others. The PK3 is able to REDUCE Vdd from 5V but not increase it.
    Vpp is the programming voltage. 12V for some chips, 9V for others. The PK3 IS able to boost the USB voltage up to these higher levels (but only at a very low current, which is all that is needed). The MCLR pin can be connected to ground, Vdd, or Vpp as required.
     

    Nearly there...
    #9
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 15:03:52 (permalink)
    0
    Thank you for clarifying regarding the voltages. I have tried multiple USB ports, even on different computers. I also know that I have used this computer in the past for programming this chip, so that can't be the case here. Can the PK3 be broken? 
    #10
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 15:10:20 (permalink)
    0
    PelleS
    Can the PK3 be broken?

    Possibly.
    Work through the self test here:
    https://www.microchip.com/cisar/Default.aspx?type=pickit3
    if it is broken, and it is a genuine Microchip PK3, they will usually replace it.
     

    Nearly there...
    #11
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 16:41:07 (permalink)
    0
    I couldn't find any relevant info on that page. The warranty has unfortunately expired as well. I have no idea what to do now. Maybe there are some settings in MPLAB X IDE that I have configured wrong, but I have no idea which ones, in that case.
    #12
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 16:49:59 (permalink)
    0
    PelleS
    I couldn't find any relevant info on that page.

    Did you click the "START" button to go through the self test procedure?
     

    The warranty has unfortunately expired as well.

    Many people have reported that Microchip have done a free replacement, regardless of the age, so long as you've followed their recommended self test procedure first.
     

    Nearly there...
    #13
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 17:28:16 (permalink)
    0
    I was filling out the form after pressing start on the page you gave me link to, but there were no devices appearing in the list where I was supposed to select one, so I can't proceed. I guess it is a bug on the site. So that didn't work too well.
    #14
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 17:34:54 (permalink)
    0
    Had you selected "8-bit PIC Microcontrollers" in the box above?
    For me, the "Device" drop down populated a couple of seconds after I did.
     

    Nearly there...
    #15
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 17:54:53 (permalink)
    0
    I tried reloading the page a few times, and I eventually got it working. I sent a request, so we'll see what happens. I don't really have time to wait a week for this, so I might end up buying a new one. It will probably end up being a waste anyway, because it's probably something else that's wrong. Unfortunately, I don't know what to try next.
     
    #16
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 18:03:36 (permalink)
    0
    Unfortunately both the PICs you have (PIC16F54 and PIC10F220) require at least 4.5V Vdd to program, and do not contain a device ID to verify the connection.
    If you could get access to a more modern PIC (e.g. PIC16F1xxx) then you could check if the PK3 was working at all.

    Nearly there...
    #17
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/02 18:19:19 (permalink)
    0
    I will order some and hope for the best. We'll see how it works out :)
    #18
    PelleS
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2011/03/28 10:53:44
    • Location: 0
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/03 08:13:48 (permalink)
    0
    I just tried supplying 5v to the chip from an external supply and still got the error "Target has invalid calibration data (0x0f)".
    #19
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Failed to program device (MPLAB X IDE and PICKIT 3) 2019/01/03 14:40:59 (permalink)
    0
    That means the programmer is now working, but the PIC has been corrupted during your previous attempts.
     
    I'm not sure of the best way to fix it.
    There's some discussion here: https://www.microchip.com/forums/m983660.aspx
     
     

    Nearly there...
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2021 APG vNext Commercial Version 4.5