• AVR Freaks

Hot!Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000"

Author
Erik2
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2021/01/08 13:03:56
  • Location: 0
  • Status: offline
2021/01/18 11:50:06 (permalink)
0

Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000"

Hello, I'm using an MPLAB ICD 4 with MPLAB X IDE 5.45 to program a PIC24FJ256GA110 and I am getting this error:

Connecting to MPLAB ICD 4...

Currently loaded versions:
Application version............01.07.39
Boot version...................01.00.00
FPGA version...................01.00.11
Script version.................00.04.07
Script build number............59586f4647
Tool pack version .............1.4.906
Target voltage detected
Target Device ID (0x0) is an Invalid Device ID. Please check your connections to the Target Device.

Calculating memory ranges for operation...

Erasing...

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x2bff
program memory: start address = 0x14800, end address = 0x14bff
configuration memory

[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000.
Programming did not complete.

 
I have the MPLAB ICD 4 connected to PGED, PGEC, VSS, and GND. It recognizes the chip's voltage rail correctly.
Self-test of the ICD 4 passes.
 
MCLR is tied to VDD with a 50k resistor.
 
What could cause the device ID to show up as all 0's? Bad connection? This is a mass produced board which has
already had the PIC programmed, I'm trying to load new code on it, so the connections from the header to the
chip should be fine.
#1

11 Replies Related Threads

    ric
    Super Member
    • Total Posts : 29861
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/18 15:42:18 (permalink)
    4 (2)
    This message:

    Target Device ID (0x0) is an Invalid Device ID. Please check your connections to the Target Device.

    indicates the programmer is not talking to your PIC at all, so anything from that point onwards is bogus.


    There are many problems that could cause this. e.g.
    PGD and PGC swapped.
    Other components on the PCB loading those two signals.
    Something on the PCB preventing the MCLR signal being raised to about 9V (assuming high voltage programming mode is being used, does not apply to LVP).
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    du00000001
    Just Some Member
    • Total Posts : 4114
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/18 15:51:59 (permalink)
    4 (2)
    In addition to ric's suggestions: bad programmer connection (cable, connectors).

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #3
    hexreader
    Super Member
    • Total Posts : 1125
    • Reward points : 0
    • Joined: 2008/05/04 03:06:55
    • Location: England
    • Status: online
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/18 16:20:48 (permalink)
    4 (1)
    Erik2
    I have the MPLAB ICD 4 connected to PGED, PGEC, VSS, and GND. 
    I believe that 5 connections are needed. MCLR needs to be connected to programmer, as well as ...
    "MCLR is tied to VDD with a 50k resistor."

    Experienced Hobbyist
    #4
    ric
    Super Member
    • Total Posts : 29861
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/18 16:38:03 (permalink)
    0
    hexreader
    Erik2
    I have the MPLAB ICD 4 connected to PGED, PGEC, VSS, and GND. 
    I believe that 5 connections are needed. MCLR needs to be connected to programmer, as well as ...
    "MCLR is tied to VDD with a 50k resistor."

    ++1.
    I didn't notice that MCLR was not mentioned in the first bit..
    If the programmer is really not connected to MCLR, that is the biggest problem!
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    Erik2
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2021/01/08 13:03:56
    • Location: 0
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/19 11:31:36 (permalink)
    0
    ric
    hexreader
    Erik2
    I have the MPLAB ICD 4 connected to PGED, PGEC, VSS, and GND. 
    I believe that 5 connections are needed. MCLR needs to be connected to programmer, as well as ...
    "MCLR is tied to VDD with a 50k resistor."

    ++1.
    I didn't notice that MCLR was not mentioned in the first bit..
    If the programmer is really not connected to MCLR, that is the biggest problem!
     




     
    These boards get programmed at our manufacturer using an MPLAB ICD 3. So having MCLR tied to VDD doesn't prevent that from working. MCLR is not even present on the MPLAB ICD 4, there's nowhere to attach it. The MPLAB ICD 4 only has five connections: PGD, PGC, GND, VDD, and power (if the programmer is powering the device). 
     
    You can see that RJ11 pinout here:
    https://ww1.microchip.com/downloads/en/DeviceDoc/50002538B.pdf
    #6
    ric
    Super Member
    • Total Posts : 29861
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/19 12:35:18 (permalink)
    0
    Erik2
    ...
    These boards get programmed at our manufacturer using an MPLAB ICD 3. So having MCLR tied to VDD doesn't prevent that from working. MCLR is not even present on the MPLAB ICD 4, there's nowhere to attach it. The MPLAB ICD 4 only has five connections: PGD, PGC, GND, VDD, and power (if the programmer is powering the device). 
     
    You can see that RJ11 pinout here:
    https://ww1.microchip.com/downloads/en/DeviceDoc/50002538B.pdf


    The "function" labels in the table at the foot of page#2 of that document are faulty.
    VDD is "power"
    The 5th connection is "MCLR/VPP", which is not "power".
    Look on page#3, the third column labelled "ICSP (MCHP) has the correct labels
    7 MCLR#
    6 VDD
    5 GND
    4 DAT
    3 CLK
    2 AUX
     
    That connector is designed for a 6 pin modular cable, which mirrors the pins at the other end, and ignores the endmost pins, so at the device end, the numbering is:
    1 MCLR#
    2 VDD
    3 GND
    4 DAT
    5 CLK
    6 AUX (not used by modern PICs. Can remain unconnected)
     
    (Verify against the "Correct" "Target Application PC Board" image in the middle of page#2)
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #7
    Erik2
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2021/01/08 13:03:56
    • Location: 0
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/20 10:30:38 (permalink)
    0
    ric
    Erik2
    ...
    These boards get programmed at our manufacturer using an MPLAB ICD 3. So having MCLR tied to VDD doesn't prevent that from working. MCLR is not even present on the MPLAB ICD 4, there's nowhere to attach it. The MPLAB ICD 4 only has five connections: PGD, PGC, GND, VDD, and power (if the programmer is powering the device). 
     
    You can see that RJ11 pinout here:
    https://ww1.microchip.com/downloads/en/DeviceDoc/50002538B.pdf


    The "function" labels in the table at the foot of page#2 of that document are faulty.
    VDD is "power"
    The 5th connection is "MCLR/VPP", which is not "power".
    Look on page#3, the third column labelled "ICSP (MCHP) has the correct labels
    7 MCLR#
    6 VDD
    5 GND
    4 DAT
    3 CLK
    2 AUX
     
    That connector is designed for a 6 pin modular cable, which mirrors the pins at the other end, and ignores the endmost pins, so at the device end, the numbering is:
    1 MCLR#
    2 VDD
    3 GND
    4 DAT
    5 CLK
    6 AUX (not used by modern PICs. Can remain unconnected)
     
    (Verify against the "Correct" "Target Application PC Board" image in the middle of page#2)
     
     


    That pinout on page 3 is wrong, because this RJ11 connector (and I'm using the adapter board ICD-2 ICSP to break it out to a 6 pin female header) only has 6 connections, not 8. 
     
    The alternative pinout you pointed out on the "Correct Target Application PC Board" is also wrong because it conflicts totally with the "RJ11 to RJ45 pinouts" table directly underneath it, even considering which pins it points to underneath the RJ11! I am very confused now!
    #8
    Erik2
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2021/01/08 13:03:56
    • Location: 0
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/20 11:04:56 (permalink)
    0
    I know that pin 4 is GND and pin 5 is target VDD, because when I have those hooked up the tool can report the correct system voltages in the IDE. 
    #9
    du00000001
    Just Some Member
    • Total Posts : 4114
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/20 11:46:36 (permalink)
    0
    Basically everything is fine with the doc - it's just a bit difficult to read:
    • Pin numbering of the RJ-* connectors is reversed wrt the pin numbering of the historical SIP connector (as e.g. in the PICKits up to version 3).
    • If you use an ICD-4, you can use the RJ-11 cable (6 contacts): it plugs in nicely (in the center position) - leaving contacts 1 and 8 of the RJ-45 socket unconnected. (That's how the image on page #2 is to be understood.)
    Erik2
    I know that pin 4 is GND and pin 5 is target VDD ...

     
    Now make sure pin 6 (obviously RJ-11 numbering) is connected to VPP/#MCLR and DAT and CLK have contact as well.
    Then it should be possible to program the device - either in LVP or in HVP mode (depends on config settings). The 50 k resistor shouldn't hurt, but might affect the timing following #MCLR. You may try to parallel it with some 12 k to speed things up a bit.

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #10
    Erik2
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2021/01/08 13:03:56
    • Location: 0
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/20 15:12:18 (permalink)
    0
    Thank you everyone, this got solved when I hooked the MCLR line to the erroneously named "VPP - Power" pin on the ICD 4. Now I can program my device. I appreciate ya'll's help. 
     
    #11
    ric
    Super Member
    • Total Posts : 29861
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Error: "[ Pgm ] at 0x0, expected 0x00042404, got 0x00000000" 2021/01/20 15:22:00 (permalink)
    5 (2)
    The historical name for Vpp is "Voltage for Programming Power".
    A long time ago (on much older PIC devices), that pin literally supplied the high voltage required to reprogram EPROM/EEPROM/FLASH cells inside the device.
    More recently, a high voltage on that pin was simply used to trigger programming mode, and the programming current actually came from a high voltage generator (internal to the PIC) powered from the Vdd pin.
    Even more recently, they have dispensed with the high voltage altogether, and held this pin low while toggling the PGD and PGC pins in a prescribed manner to activate programming mode, with the power again coming from the Vdd pin.
     
    That is the background of why the word "power" appears in the acronym for MCLR/Vpp, but some numbskull who produced that information flyer has misinterpreted this and simply labelled the pin as "power".
     
    post edited by ric - 2021/01/20 15:23:04

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #12
    Jump to:
    © 2021 APG vNext Commercial Version 4.5