• AVR Freaks

AnsweredHot!Did I destroy my PIC16F628A?

Page: 12 > Showing page 1 of 2
Author
oldphart
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2013/01/26 11:24:08
  • Location: 0
  • Status: offline
2020/04/04 14:11:56 (permalink)
0

Did I destroy my PIC16F628A?

Setup:
IPE 5.30, PICKIT 3, small programming board with ZIF socket and power supply. It also has a 10K resistor pulling VPP high.
(I just installed the new version of the IPE, so this is the first use of this version)
 
What I did:
Start the IPE, select my PIC, and it downloaded the firmware into the PICKIT3. Put new PIC in the ZIF, and connect. Found target, all is well. Check to see if device is blank, OK. Load my hex file. Program PIC, OK. Do verify, OK. 
 
Put PIC in circuit, does nothing, check my program, and see I goofed a configuration bit, since I don't use the reset, I did not set MCLRE_OFF. Recompile, and reload new HEX. 
 
Put the PIC back in the programmer, click "connect" and I get a message: "Target Device ID (0x0) is an invalid ID"
If I erase, it says "erase successful". When I do Blank Check it says "device is not blank"
When I do a read it responds "read complete". Then a Verify: it responds "Verification successful".
Try to program new HEX: "Failed to program device".
 
Now I though perhaps my circuit killed the chip, so I get a new one. Program it, everything looks OK. Just to try, I click Program again. Message: "Address: 0 Expected value: 2820 Received value: 0" "Failed to program device"
 
Any suggestion at all? I't got me stumped.
 
OldPhart
 
#1
ric
Super Member
  • Total Posts : 26942
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Did I destroy my PIC16F628A? 2020/04/04 14:22:35 (permalink)
0
That might be one of the old chips that becomes difficult to program When all these conditions are true:
MCLR is disabled
PWRT is disabled.
Your code sets either or both the PGD and PGC pins to output mode very soon after starting.
 
If the PIC is powered by the programmer, then you can often get around this by selecting "VPP before VDD" mode in the programmer settings.
 

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
dan1138
Super Member
  • Total Posts : 3484
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/04 16:21:17 (permalink)
0
Be aware that the PIC16F628A has a Low-Voltage-Program (PGM) mode.
 
In addition to the 10K ohm pull-up you have on MCLR add another pull-DOWN resistor in the RB4/PGM pin.
 
This pull-down resistor is important because there are some controllers that need this pin to be low at power-on-reset regardless of if the Low-Voltage-Program mode is enabled or not in the configuration words. I do not think the PIC16F628A has this issue but pull RB4/PGM down (10k-100K) to ground just to be sure.
 
In any case the IPE should be able to read the device ID from the PIC16F628A even when the controller is all the way locked. That you cannot suggests that there is a wiring fault with your PICKIT3 to ZIF socket wiring.
#3
oldphart
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2013/01/26 11:24:08
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/04 16:47:43 (permalink)
0
Hi Ric,
 
thanks for your reply. I'm not sure what you call old, but yes, I have had these chips for a few years. I reconfigured to power from the PICKIT, but I can't find the VPP before VDD option. I have new chips on order, but I would like to make sure I don't kill them also.
 
I started everything up again, and I immediately got the valid ID message. I decided to try and erase the chip, and it replied "Erase successful". I then did a blank check, and it replied: "blank check complete, device is not blank".
 
I did a read, and it replied: "Read complete". Than a verify: "verification successful". So the chip is alive?? I then did a read device ID, and it replied: "Target Device ID (0x0) is an Invalid Device ID."
 
I plugged the chip in my project, and I get nothing at all.
 
My config: __CONFIG _INTRC_OSC_NOCLKOUT & _WDTE_OFF & _PWRTE_ON & _MCLRE_OFF & _BOREN_OFF & _LVP_ON & _CPD_OFF & _CP_OFF
 
Port A is set: 1111 1000 so RA5 is set to input, Port B is set: 111 0001, so PGD (RB7) and PGC (RB6) are also inputs.
 
Back to the drawing board I guess.....
 
OldPhart
#4
ric
Super Member
  • Total Posts : 26942
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Did I destroy my PIC16F628A? 2020/04/04 16:51:46 (permalink)
0
oldphart
...
I started everything up again, and I immediately got the valid ID message. I decided to try and erase the chip, and it replied "Erase successful". I then did a blank check, and it replied: "blank check complete, device is not blank".
 
I did a read, and it replied: "Read complete". Than a verify: "verification successful". So the chip is alive??

Only briefly.
I'm assuming it started returning all zeroes during that first attempt to erase.
When you did a "read", it read all zeroes into the IPE's program memory.
Then when you did "verify", it verified that all zero memory with all zeroes being read from the device, and said "verification succesful".
 
You have not confirmed, do you have PWRT disabled, and does your code change either of the programming pins to outputs immediately after starting?

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
oldphart
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2013/01/26 11:24:08
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/04 17:34:22 (permalink)
0
Hi Dan,
 
Thanks for your suggestions. I added the pull-down, and that made no difference. I checked with the data sheet again, and it did not mention that either. I also checked my wiring, directly from the PICKIT connector to the chip legs, and everything there is OK. I checked the voltages (5.01V between Vss and Vdd) at the chip pins, and that is OK also. At rest the PICKIT is holding Vpp, RB6, and RB7 low, also in keeping with the manual.
 
Thanks again,
OldPhart
 
#6
oldphart
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2013/01/26 11:24:08
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/04 17:43:03 (permalink)
0
Hi Ric,
 
I see what you mean about the verify, that could be it. It still seems odd that it would say Read Complete if it in fact did not actually read the chip.
 
In my last message I copied my config line, and it shows PWRTE_ON, and no, the ports do not change to outputs.
 
Thanks, OldPhart
 
#7
ric
Super Member
  • Total Posts : 26942
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Did I destroy my PIC16F628A? 2020/04/04 19:32:29 (permalink)
0
oldphart
It still seems odd that it would say Read Complete if it in fact did not actually read the chip.

It doesn't know that the reads are not working. It's just getting 0x000 at every location because the chip has not got into program mode at all.

In my last message I copied my config line, and it shows PWRTE_ON, and no, the ports do not change to outputs.

But was it always on, or have you changed it?
That is in your source, but I suspect you have not managed to reprogram the chip with those settings yet.
It's what is in the chip that matters, not what you are trying to reprogram it with.

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!
#8
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11813
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/04 20:57:48 (permalink)
0
I'm not sure what you call old

 
Well over a decade, possibly pushing two decades.
#9
ric
Super Member
  • Total Posts : 26942
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Did I destroy my PIC16F628A? 2020/04/04 21:11:58 (permalink)
5 (2)
jtemples
I'm not sure what you call old

 
Well over a decade, possibly pushing two decades.

Rev A of the PIC16F628A datasheet is dated 2002
 

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!
#10
dan1138
Super Member
  • Total Posts : 3484
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/04 23:32:54 (permalink)
0
oldphart
Thanks for your suggestions. I added the pull-down, and that made no difference. I checked with the data sheet again, and it did not mention that either. I also checked my wiring, directly from the PICKIT connector to the chip legs, and everything there is OK. I checked the voltages (5.01V between Vss and Vdd) at the chip pins, and that is OK also. At rest the PICKIT is holding Vpp, RB6, and RB7 low, also in keeping with the manual.



So you are saying that your ZIF programming interface has no faults in any of the connections to the PICKIT3 and yet the Device ID displayed by the MPLABX v5.35 is zero.

When if use the IPE for my PIC16F627A in a DM163022-1 demo board this is what I see:
*****************************************************

Connecting to MPLAB PICkit 3...

Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.56.00
Firmware type..............Midrange
Target device was not found (could not detect target voltage VDD). You must connect to a target device to use PICkit 3.

After I configure the IPE to cause the PICKIT3 to supply power to the demo board this is what I see:
*****************************************************

Connecting to MPLAB PICkit 3...

Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.56.00
Firmware type..............Midrange
Programmer to target power is enabled - VDD = 5.000000 volts.
Target device PIC16F627A found.
Device Revision ID = 5


Until you can get your ZIF programming interface to do the same thing you have a wiring problem, a broken PICKIT3 or a blown PIC16F628A.

No read, write, blank check, or erase command from the IPE will work when the target device has not been identified correctly.

DM163022-1 (no longer available)
#11
oldphart
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2013/01/26 11:24:08
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/05 13:02:37 (permalink)
0
<But was it always on, or have you changed it?>
 
Yes, that's what is in the chip (part of the first programming attempt). The only change I tried to make after the original program was the MCLR setting. I thought that it was the reason the chip did not run in the board.
 
No matter what I try, I now keep getting that: "Target Device ID (0x0) is an Invalid Device ID." I triple checked that I did not create any problems with frying inputs, other than that I don't know what I could do to kill the chips with code errors.  I now have three dead chips. I have new ones coming, I'll see what happens then.
 
Thanks for all your suggestions,
OldPhart
#12
dan1138
Super Member
  • Total Posts : 3484
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/05 13:54:10 (permalink) ☼ Best Answerby oldphart 2020/04/06 09:51:32
5 (2)
If the PICKIT3 is the only PIC device programmer you have available your PIC16F628A controllers may be unrecoverable.

If the code running in the controller makes the PGC or PGD pins outputs before the MPLAB IPE can get the PICKIT3 to put the chip into programming mode commands to read the device ID will fail.

Other user interfaces to Microchip device programmers may use different methods to get the target controller into programming mode.

You can try using the PICKIT3 with MPLAB v8.92 to see if that combination can get control of the target.

A PICKIT2 with the standalone GUI may work, or a PICStart+ but these are even more obsolete.

The only Microchip device programmer that is still available that may possible be able to recover your PIC16F268A parts is the PM3 (DV007004) with the MPLAB PM3 Universal Socket Module for 8/18/20/28/40 Pin DIP devices  (AC164337) but this is a really expensive solution. You could buy about 500 PIC16F628A for the cost of this programmer and I am not sure it would help.
post edited by dan1138 - 2020/04/05 15:33:40
#13
oldphart
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2013/01/26 11:24:08
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/06 09:59:15 (permalink)
0
That sounds like it may be the case. I still have a pickit2 somewhere, I'll dig it out if I can get hold of the old MPLAB version.
 
Thanks for your explanation!
 
OldPhart
#14
dan1138
Super Member
  • Total Posts : 3484
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/06 10:56:23 (permalink)
0
Don't bother with the old MPLAB stuff. Use the PICkit2 standalone GUI tool and just erase the PIC16F628A chips.
post edited by dan1138 - 2020/04/06 13:52:33
#15
oldphart
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2013/01/26 11:24:08
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/08 10:26:17 (permalink)
5 (1)
Hi Dan,
 
The old PICKIT 2 has a funky USB interface, and the Microchip supplied driver does not want to play with WIN 10. One of my laptops still has a serial port, but the newer MPLABX does not talk to a serial port (that I could figure out anyway). So I loaded MPLAB 7.40 which cam on the CD with the PICKIT 2. Configure the port (set speed, disable FIFO) and I could talk to the programmer. The program I had loaded used the RC oscillator, and configured MCLR set internal. So as soon as power was connected, the program fired up. I connected the MCLR pin to Vcc to override the internal pull-up. The old MPLAB does not appear to do a target verification on target power-up, whereas the new version reads the chip ID immediately. So I was able to connect the "bricked" chip to the programmer and IDE, without modifying anything. So immediately after connecting the power I sent the erase command, AND........ it worked. The chip is now blank and ready to be programmed again. I recovered my chips!
 
Now perhaps I am not 100% correct in my assessment of why it worked, but it seems logical to me, and it is hard to argue with success. I am not a professional, just a mostly misguided amature, so please don't kill me if I got something wrong. And yes, a professional would probably have chucked the chips a long time ago, and moved on. But since I am mostly stuck indoors due to the COVID restrictions, it seemed like the right thing to do!
 
Thanks again to all who took the time to guide me to the ultimate solution.
OldPhart.
#16
dan1138
Super Member
  • Total Posts : 3484
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/08 13:05:13 (permalink)
0
It great you have achieved success.
 
There is one inconsequential thing to seem to have wrong.
 
The PICkit2 does not use any USB drivers from Microchip. The PICkit2 was an "open source" design more or less sponsored by Microchip. The design uses a generic HID mode driver that connects the PICkit2 standalone GUI application or MPLAB to the device programmer.
 
This is a really minor thing but you should at least get a clear idea if how this old stuff worked.
 
<EDIT>
Also what you describe as a PICKIT2 may be a PICstart Plus, as the PICkit2 does not have a serial interface.
post edited by dan1138 - 2020/04/08 13:10:57
#17
oldphart
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2013/01/26 11:24:08
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/08 16:41:26 (permalink)
0
<EDIT>
Also what you describe as a PICKIT2 may be a PICstart Plus, as the PICkit2 does not have a serial interface.
 post edited by dan1138 - 3 hours ago
 
Actually mine was a cool Chinese "clone" which has both a USB and a serial port.
 
PldPhart
#18
ric
Super Member
  • Total Posts : 26942
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Did I destroy my PIC16F628A? 2020/04/08 16:56:44 (permalink)
5 (1)
oldphart
Actually mine was a cool Chinese "clone" which has both a USB and a serial port.

You can hardly blame Microchip for problems with it then...
 

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!
#19
oldphart
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2013/01/26 11:24:08
  • Location: 0
  • Status: offline
Re: Did I destroy my PIC16F628A? 2020/04/08 18:06:41 (permalink)
5 (1)
I never blamed anyone or anything other than myself, starting with the title of this tread. The clone item was my old PICKit 2, and in the end it actually helped me out of this pickle. My PICkit 3 is genuine, and works as it should as far as I can tell.
 
OldPhart
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2020 APG vNext Commercial Version 4.5