News:

;) This forum is the property of Proton software developers

Main Menu

fail to program Pic 18F26k22 with pickit 3

Started by Yves, Feb 13, 2024, 11:06 AM

Previous topic - Next topic

Yves

Hello everyone,

I had a perfectly working program but all the sudden it fails to program with Pickit 3 and not even working with the previous program.
1) All connections tested, 5V and Gnd ok. Pull-up resistor ok
2) When I check communication, I get No Device Detected
3) When I manually select device 18F26k22 and read it is all at 0.
4) If I Erase then check Blank Check, I get Program Memory is not Blank starting at addres0X0000
5) If I flash my Hex I get Programming failed at program memory address 0X000004
6) All protections are set to OFF including the Pickit3

Is my almost brand-new chip is dead? I must make sure before I start the tedious desoldering process
Any advice?

Regards,

Yves


Yves

trastikata

Measure the resistance for the Clock and Data lines between the PIC pin and the ICSP port, I had faulty PCBs before.

Is there anything else connected to the Data and Clock pins?

If using MPLAB IPE, make sure the Pickit3 is not trying to supply power to the circuit.

Yves

What you call the clock there is a 16Mhz crystal with his decoupling capacitors. Which pin is the ICSP do you mean MCLR. The thing is the PIC was working perfectly yesterday and it is only when I wanted to change minor code it stopped to accept any new Hex
Yves

RGV250

#3
Hi,
I think you are confusing the PGC clock with the Xtal clock. PGC / PGD are used for ICSP and are on port B.6 / B.7 The programmer can be quite tempermental if there is anything else on them. I try to leave them specifically for programming.

Bob

Yves

Ok my bad, I have checked the the ohms between PGD and PGC and got 0.76 mega Ohms nothing else is connected on those two pins. I have also checked in between pins for shorts nothing out of the ordinary there either.
Yves

Yves

It look like I have to get my copper wick and flux and replace the chip, unless someone have a bright idea :(
Yves

trastikata

Quote from: Yves on Feb 13, 2024, 02:54 PMunless someone have a bright idea :(

Did you verify whether the MPLAB X IPE is trying to supply power to the circuit?

I have experienced it before ... after changing one PIC type with another and the MPLAB IPE automatically reinserts the option to supply the circuit from Pickit3.

Go to advanced options and check the Power option.

IPE.jpg

Yves

I'm using standalone Pickit 3 programmer. I can either turn on or off the voltage to the board depending if the board is self powered  or not. It had been running been running endlessly many 100 of times. It recognize the pick automatically and warn you if the board is powered or not. It can even program the chip even without power. I have tried my Pickit 3 module on same but new PIC and it is working fine.
Yves

JonW

I have had issues with IPE and pic kit 4.  After restarting the PC it works. Have you also tried slowing the programming speed?

Have you tried programming another IC with the same programmer?

It is possible that the IC has been damaged, I have had this issue before with ICSP and bad connections causing damage and is one of the main reasons I tend to use a bootloader for development.


John Drew

I use the PICkit3 and MPLAB 8.92 and sometimes find I have to reduce the voltage from 5.00 to 4.75 and this seems to fix the problem. Don't know why it works. Changing the USB connection is also worth trying.

Yves

JonW,

I did breadborded a new Pic18F26k22 even without crystal and not even an oscillator  and flash it using standalone PicKit3 app with my code and it is working fine as far my Pickit dongle programmer is concerned. So either the Pic soldered on my printed circuit is dead or there is a short somewhere.

By the way what are the advantages of PicKit4 or it is all the same. I have seen that PicKit5 is out too.

Regards,

Yves
Yves

Stephen Moss

Quote from: Yves on Feb 13, 2024, 01:36 PMI have checked the the ohms between PGD and PGC and got 0.76 mega Ohms nothing else is connected on those two pins.
I think you are measuring between the two pins on the PIC as 760K ohms is rather high, whereas @trastikata was talking about measuring the resistance between the PIC pin and its corresponding ISCP pin for high resistance/open circuit that may be the issue.

Quote from: Yves on Feb 14, 2024, 07:54 AMI did breadborded a new Pic18F26k22 even without crystal and not even an oscillator  and flash it using standalone PicKit3 app with my code and it is working fine
But did you try re-flashing it as it work fine the first time with the device on your PCB?
If a re-flash of the breadboarded pic also fails then it is a hex file/programmer issue, if not then the problem is with the PCB or the device on it.
If the Breadboard re-flash also fails I would look at your programming modes, as there may be a mismatch between the High/Low level programming mode the devices is set to and that your programmer is set to which is preventing you from re-flashing.

ricardourio

Quote from: John Drew on Feb 13, 2024, 11:02 PMI use the PICkit3 and MPLAB 8.92 and sometimes find I have to reduce the voltage from 5.00 to 4.75 and this seems to fix the problem. Don't know why it works. Changing the USB connection is also worth trying.

Good tip John. At my work, we have 4 programmers pickit3 and pickit4, and we ever need to reduce the voltage between 4.5 and 4.75, using any MPLab IPE version. We had some problems with poor quality USB cables, and mainly, long programmer > board cables, these ones need to be as short as possible.

Ricardo Urio

charliecoutas

I've had what John describes quite a few times: dropping the voltage from my PicKit2 from 5v to 4.8v did the trick. No idea why it works.

Charlie

ricardourio

Charlie, I guess the Vdd from USB drop down along PicKit circuit, and when programmer expect to read 5V, it isn't possible. Many times, even USB has not 5v.

Ricardo Urio