Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] circuit diagram to connect the pic kit3 debugger to target device PIC 18F4520

Status
Not open for further replies.

shomikc

Member level 4
Joined
Apr 19, 2013
Messages
71
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,951
Hello all,

Can anyone provide me with the circuit diagram to connect the Pic Kit3 debugger to target device PIC 18F4520.

I am trying to get the PIC Kit3 with a previous board made by a colleague and it keeps giving an ID mismatch problem with MPLAB IDE.

I am guessing this is a connection problem.

Thanks and Regards,

Shomik.
 

Pickit ------ PIC
VPP (1) goes to VPP (if needed for HVP)
VDD (2) goes to VDD
VSS (3) goes to VSS
PGD (4) goes to PGD (also known as ICSPDAT)
PGC (5) goes to PGC (also known as ICSPCLK)
PGM (6) goes to PGM (if needed for LVP)

The names on the Pickit 3 should match the ones on the PIC.

Brian.
 

I think there is pull up resistor and some capacitances as well. I am not sure about the capacitances, i.e., across which pins are they used and what are their values.

Thanks and Regards,

Shomik.
 

There is advice on isolating the programming signals in the Pickit 3 manual. The most common cause of problems are capacitors across VPP to ground that delay the voltage rise during high voltage programming and other circuits driving into any of the ISCP pins. The voltages and signals have to be quite 'clean' for successful programming.

Brian.
 

If you are getting an ID mismatch then we need to be told the actual error message.
There are two possibilities: if it says that the device is returning and ID of 0x0000 then it is a connection problem in that the PGD line is being held low and therefore not receiving any actual ID sent by the chip.
The other possibility is that the ID is begin received but is not the one that is expected. In this case the connection is fine but the IDE has not got the correct device set for this project.
By the way, the Microchip web site as the PicKit3 User Guide (https://ww1.microchip.com/downloads/en/DeviceDoc/52116A.pdf) which tells you exactly how to connect the PicKit3.
Susan
 
Hello
error2.jpg
error1.jpg

The above images show the error I am getting. Please tell me where I am going wrong.

Thanks and Regards,

Shomik
 

That indicates total lack of communication with the PIC. The PicKit sends a command to the PIC saying "tell me your ID number" but the default 0000 indicates it didn't hear the command or the reply didn't get back to the Pickit.

Are you programming the PIC while it wired into a circuit board or is it in it's own socket?

If you are trying to program it while it is wired (which is fine if you follow the rules) can you post the schematic showing the components immediately around the PIC please.

Brian.
 
Yes I am trying to program it while it is wired.

The following schematic is the one I am using.

schematic.jpg

Please tell me where I am going wrong.

Thanks and Regards,

Shomik
 

Hello all,

Is it possible that either the PICkit3 or the controller PIC 18F4520 or both are faulty.

Is there are anyway to check them both. PICkit is getting detected by MPLAB. So I think I may have blown the microcontroller. Is it possible to blow the microcontroller if the external power supply is connected wrong, i.e. the positive of the supply is connected on the ground pin of the controller.

But it says Target is detected so I am not sure but I think there may be something wrong with my connection. I am selecting PIC 18F4520 from MPLAB
Configure menu and from Programmer I am selecting PICkit3. The circuit I believe is a standard circuit.

I am giving an external power supply to from 5V SMPS power supply as shown in the schematic.

Any help would be welcome.

Thanks and Regards,

Shomik.
 

As a rule I always add some capacitor to the MCLR bus, and this could make difference if you are using long wirings from the target to the programmer, or if the signal is not well conditioned along the path between both sides.
 

I would advise the opposite!
In normal operation a capacitor may be useful as a filter or to delay the reset but while programming it can delay the rise of VPP and stop the device going into programming mode.

The connections look correct but if you really do have an LED on RA0 you MUST fit a series resistor to limit it's current. Without it the PIC or LED or both could be damaged and if present, the extra current while programming may drag the supply too low.

Try to keep the wiring as short as possible, the programming is performed by sending high speed serial data through the ISCP pins and they are not forgiving of long wire lengths, up to about 10cm should be OK. If the wiring is already short, try connecting the LVP pin as well. The PIC can be programmed in two ways, by high voltage on the VPP pin or using normal VDD and driving the LVP pin, if you use the wrong mode it may not work.

If it still doesn't work, try measuring the voltage from VSS to VDD and from VSS to VPP while it tries to program. You really need an oscilloscope to check accurately but a DVM will give some clues.

Brian.
 
Have you (or anyone else) managed to program the MCU before?
If so, did they select the LVP config option?
Further, have you selected the LVP config option for the code you are trying to program into the device?
If so then turn that off in your program so that the PicKit3 will use the normal 'high voltage' programming option.
You will also know if the PicKit3 is trying to use LVP if you follow @betwixt's advice about using a scope on the \MCLR\ pin - if it doesn't go high then LVP is being used (and you will need to connect the PGM pin connection to the PicKit3 if this is *really* what you want and it probably isn't).
Susan
 
Hello all,

I have checked all the connections and they seem to be fine. The circuit I am using is shown below.
PIC circuit.jpg

I am still getting the error shown below.
target not detected.jpg

I am using MPLAB IDE 8.56. Could the problem be that I should use MPLAB X IDE instead MPLAB IDE 8.56.

I checked the voltage levels on the pins of the PICKit3. It is 5 volts on pin 1 (MCLR) and 5 volts on pin 2 (V_DD).

I connect an external power supply of 5V from SMPS and connect the PICKIT 3 and select the Target device from "Configure" in MPLAB IDE and select PIC Kit3 from "Programmer".

Any advice would be welcome. I even manually downloaded the firmware but there was no change.

Could it be that the PICKit3 is faulty?

Thanks in advance,

Shomik.
 

Anything is possible but my first guess is the circuit around MCLR/VPP. During programming, the VPP voltage will rise from 0V to 5V and then up to about 12.5V. It will also go back down to zero several times as part of the programming cycle. As it is connected, when the Pickit takes VPP to zero, C1 and C3 will discharge through D2 and almost certainly prevent the pin reaching the correct voltages.

Try removing D2 and see if it programs correctly. If it does, you need to change the circuit so it complies with Microchip's recommendations around the VPP pin.

Brian.
 
Anything is possible but my first guess is the circuit around MCLR/VPP. During programming, the VPP voltage will rise from 0V to 5V and then up to about 12.5V. It will also go back down to zero several times as part of the programming cycle. As it is connected, when the Pickit takes VPP to zero, C1 and C3 will discharge through D2 and almost certainly prevent the pin reaching the correct voltages.

Try removing D2 and see if it programs correctly. If it does, you need to change the circuit so it complies with Microchip's recommendations around the VPP pin.

Brian.

I did the above. Now the error reads Target Device ID (00000700) does not match expected Device
ID (00001200) instead of the earlier Target Device ID (00000000) does not match expected Device
ID (00001200).
 

That proves the capacitors were responsible for the complete loss of communication. It is quite possible that by discharging 10uF into the Pickit3 VPP output has damaged it but there are other possibilities to check first.

Are you powering the PIC from an external 5V supply? If you are relying on the Pickit to provide 5V, are there other devices loading the voltage? Are all supply pins connected? Are there large capacitors across VSS & VDD that the Pickit might struggle to charge up?

Are wires short? Try to keep the connection between the Pickit and PIC as short as possible. The fact that it is reading something suggests a communications error rather than total failure.

If that doesn't help, try connecting PGM as well.

Incidentally, the ID code 00001200 is for the PIC18F4550, is the program properly compiled for the '4520 and not accidentally set to '4550 ?


Brian.
 
That proves the capacitors were responsible for the complete loss of communication. It is quite possible that by discharging 10uF into the Pickit3 VPP output has damaged it but there are other possibilities to check first.

So the PICKit3 is damaged. Is there anyway to check for damage in the debugger/programmer PICKit3.

Are you powering the PIC from an external 5V supply? If you are relying on the Pickit to provide 5V, are there other devices loading the voltage? Are all supply pins connected? Are there large capacitors across VSS & VDD that the Pickit might struggle to charge up?

I am powering from an external 5V supply. There are no other devices connected. All pins from PICKit3 are connected except pin6. Pin nos 11 and 31 in PIC18F4550 are connected to supply of 5V and

Are wires short? Try to keep the connection between the Pickit and PIC as short as possible. The fact that it is reading something suggests a communications error rather than total failure.

No wires used. Direct connection. Using Burg connectors - male.

If that doesn't help, try connecting PGM as well.

How should I connect PGM(pin no 6) from the PIC KIT 3? Isn't that supposed to be left unconnected as per User manual.

Incidentally, the ID code 00001200 is for the PIC18F4550, is the program properly compiled for the '4520 and not accidentally set to '4550 ?


Brian.

I am using PIC18F4550.

Thanks,

Shomik.

- - - Updated - - -

Are there large capacitors across VSS & VDD that the Pickit might struggle to charge up?

Brian.

Only 0.1nF capacitors across pins 11 and 12 and across pins 31 and 32. Used as Decoupling capacitors.

Thanks,

Shomik.
 

Everything seems electrically OK but I'm confused over which PIC you are trying to program. Your post title says 18F4520 but now you say it's an 18F4550.

Brian.
 

Everything seems electrically OK but I'm confused over which PIC you are trying to program. Your post title says 18F4520 but now you say it's an 18F4550.

Brian.

Sorry about that Sir. I started off with 18F4520 but I bought anew 18F4550 yesterday and have been trying with that. The old 18F4520's still give the same error of no connection , i.e. 00000000 as Device Id

- - - Updated - - -

Everything seems electrically OK but I'm confused over which PIC you are trying to program. Your post title says 18F4520 but now you say it's an 18F4550.

Brian.

Also Sir can I ask if the supply ground and the PIC Kit3 pin 3 are connected together.
 

Also Sir can I ask if the supply ground and the PIC Kit3 pin 3 are connected together.
Yes, they must be connected. The programming is actually done by raising VPP to a high voltage (assuming you are not using LV programming mode) then sending serial data bits on PGD synchronized to a clock on PGC. The timing of the data and when it starts relative to VPP rising is critical, that's why Microchip recommend that the programming signals are isolated from other circuitry during the programming procedure.

Brian.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top