PIC programming through PICKit3 (clone)

This Forum is about the Opentherm gateway (OTGW) from Schelte

Moderator: hvxl

Post Reply
mcasamento
Starting Member
Starting Member
Posts: 17
Joined: Fri Jan 03, 2020 6:14 pm

PIC programming through PICKit3 (clone)

Post by mcasamento »

as stated in other post I've somehow corrupted the firmware in my PIC16F88.
So I bought a PIC Programmer (it's just an amazon's "user rated" PICKIT3 clone) and tried to read it with MPLAB X IDE v3.65 (and MPLAB IPE).
I've turned on the "Power target circuit from PICkit3" option and connected the PIC more or less as in this schema (except for the led and buzzer that are absent and a 2200uF electrolytic capacitor between pin 2 and pin 3):

Image

the PIC programmer seems to be working or at least is well recognized from MPLAB but the log says:

Connecting to MPLAB PICkit 3...

Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.49.09
Firmware type..............Midrange

Programmer to target power is enabled - VDD = 5,000000 volts.
Target Device ID (0x0) is an Invalid Device ID. Please check your connections to the Target Device.


*****************************************************

Giving that this is my first time with a PIC programmer, do anyone have an idea of what could I be doing wrong ?
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: PIC programming through PICKit3 (clone)

Post by hvxl »

First of all: You can't reprogram the PIC while it is placed in the OTGW. So get it out of its socket and insert it into a breadboard. Then just connect the PICkit3 with some jumper leads. There is no need for additional components.

After starting mplab_ipe, you enable advanced mode and set the device to PIC16F88. On the "Power" tab, enable "Power Target Circuit from Tool" (as you did). Back on the "Operate" tab, the PICkit3 should show up as the "tool". Now, when you click connect, you should get:

Code: Select all

Connecting to MPLAB PICkit 3...

Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.49.09
Firmware type..............Midrange

Programmer to target power is enabled - VDD = 5.000000 volts.
Target device PIC16F88 found.
Device ID Revision = 5
You will get a popup dialog asking to be sure you want to apply 5V to the device. You shouldn't get another popup saying to check the connections. If you do, there is actually something wrong with the connections and you should check them.

I can reproduce the "Target Device ID (0x0) is an Invalid Device ID" error message when I disconnect the PGC or PGD wires, or mix them up. It also happens when I disconnect the Vpp wire. So I suggest to examine all of those connections carefully.
Schelte
tjfs
Starting Member
Starting Member
Posts: 25
Joined: Fri Dec 18, 2020 11:50 am

Re: PIC programming through PICKit3 (clone)

Post by tjfs »

You could also use a low cost K150 programmer, but note that on Windows 10 it requires an old driver as the latest Prolific driver blocks use of the port.

Tim
mcasamento
Starting Member
Starting Member
Posts: 17
Joined: Fri Jan 03, 2020 6:14 pm

Re: PIC programming through PICKit3 (clone)

Post by mcasamento »

I've removed every other component and checked the connections several times and to be super sure that my breadboard wasn't playing with me I've also detached the connector from the PICKIT3 side and with a multimeter I've checked the connection of the first 5 pin, directly touching the pin of the PIC.
Actually they are:

PICKIT 1 => PIC4
PICKIT 2 => PIC 14
PICKIT 3 => PIC 5
PICKIT 4 => PIC 13
PICKIT 5 => PIC 12

After attaching the cable to the PICKIT I've also checked voltage betwen pin 5 (-) and PIN 14 (+) and the multimeter returns 4.96V.
When connecting, I do get the warning about 3.3 and 5 V, and after ignoring it I get another one warning "Target Device ID (0x0) is an invalid Devid ID. Pleasse check your connection to the Target Device."

Code: Select all


*****************************************************

Connecting to MPLAB PICkit 3...

Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.49.09
Firmware type..............Midrange

Programmer to target power is enabled - VDD = 5,000000 volts.
Target Device ID (0x0) is an Invalid Device ID. Please check your connections to the Target Device.
I'
I'm new to PIC programming but not new to electronics in general, I've payed lot of attention in handling and connecting the device (static currents) and I'm pretty sure that IF the above connection are rights... Well they are never been swapped.
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: PIC programming through PICKit3 (clone)

Post by hvxl »

With the connections exactly as you describe I am able to read and program a PIC16F88 with the PICkit3 and mplab_ipe v3.65.

I don't suppose you have some other PIC (doesn't have to be a PIC16F88) you can try to see if it's the PIC or the PICkit3 that's at fault here?
Schelte
mcasamento
Starting Member
Starting Member
Posts: 17
Joined: Fri Jan 03, 2020 6:14 pm

Re: PIC programming through PICKit3 (clone)

Post by mcasamento »

Good idea, but, no, unfortunately I don't have other PICs.
Let's buy a new PIC :o, maybe that explain everything!

Thanks, I'll keep you updated on the result
mcasamento
Starting Member
Starting Member
Posts: 17
Joined: Fri Jan 03, 2020 6:14 pm

Re: PIC programming through PICKit3 (clone)

Post by mcasamento »

Just an update.
The PIC was indeed unusable and PICKIT 3 clone was good.
I've ordered other PICs from microchip site (pre-programmed, you never know...) and they were immediately read without any problem

Thanks to everybody for the support
tjfs
Starting Member
Starting Member
Posts: 25
Joined: Fri Dec 18, 2020 11:50 am

Re: PIC programming through PICKit3 (clone)

Post by tjfs »

Interesting that the PIC was corrupted to the extent that it couldn't be programmed even with a programmer.

Tim
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: PIC programming through PICKit3 (clone)

Post by hvxl »

I don't believe the self-programming code could destroy a PIC to the point that it won't even identify itself anymore to a PIC programmer. Something else must have happened to it.
Schelte
Post Reply

Return to “Opentherm Gateway Forum”