Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PICKIT 2 verification failed at memory address 0x0000

Status
Not open for further replies.

tarekmdimagh

New Member
I have been using a "pic16f628A"

The problem I am getting:

Failed to verify at programming address 0x0000 (when I click the Verify button).

Failed to program at programming address 0x0000 (when I click the Write button).

Successful (when I click Read button).

Successful (when I click erase button).

when I put another chip with same model is working

**broken link removed**
 
I have the same problem with pic16f628a only, other pic's program ok. I don't have a solution for the problem, I'm just saying that there could be a problem with PicKit2.
The PicKit2 sets the ROM protection config bit even when the code doesn't, after that you need to erase the whole ROM. Since PicKit 2 can't erase protected chip I use MicroBurn programmer to to that.
 
I have the same problem with pic16f628a only, other pic's program ok. I don't have a solution for the problem, I'm just saying that there could be a problem with PicKit2.
The PicKit2 sets the ROM protection config bit even when the code doesn't, after that you need to erase the whole ROM. Since PicKit 2 can't erase protected chip I use MicroBurn programmer to to that.

I've never hard of any such thing?, I've never had my PICKit2 set the protection bit without been asked, nor refuse to erase a chip that has it set.

I would suggest it's FAR more likely he has the internal oscillator selected, with MCLR disabled (as all my tutorials do), and has it powered externally - as shown by his screen shot above.

This means the PIC is already running, and has disabled MCLR (as it's programming tells it to) so the PICKit2 is unable to set it to programming mode.

If he disconnects external power, and powers it from the PICKit2, he will probably be able to program it successfully.

Failing that, take the PIC out of circuit, and make a small programming adaptor you can plug it in to.
 
+1 Nigel,
OP (1) Has PK2 detected the correct PIC... (2) go check the configuration as reported 21FF .
 
+1 Nigel,
OP (1) Has PK2 detected the correct PIC... (2) go check the configuration as reported 21FF .

If it can't access programming mode, then it can't read the chip type (where available) either - presumably the configuration 'value' is just the value reported when the chip can't be read? - if it could read the configuration byte, then it could read the rest.
 
I've never hard of any such thing?, I've never had my PICKit2 set the protection bit without been asked, nor refuse to erase a chip that has it set.

I would suggest it's FAR more likely he has the internal oscillator selected, with MCLR disabled (as all my tutorials do), and has it powered externally - as shown by his screen shot above.

This means the PIC is already running, and has disabled MCLR (as it's programming tells it to) so the PICKit2 is unable to set it to programming mode.

If he disconnects external power, and powers it from the PICKit2, he will probably be able to program it successfully.

Failing that, take the PIC out of circuit, and make a small programming adaptor you can plug it in to.

Microchip documents say that whenever MCLR pulled up to 12V the pic goes into programming mode and all pins are inputs. It means that you should be able to erase.
On Microchip website it say that if the code protection bit is set you can't erase or program. I read the memory with other programmer and learned that PK2 sets the memory protection bit occasionally when I connect the PK2. After that the pic becomes a brick for PK2 only. Microchip explain that they did it to protect the pic16f628 from hackers.

I tried again today.
I set the config to: manual MCLR, XT osc and removed the external power. Still the PK2 refuses to prgram or erase. I bought my PK2 from BangGood.

Please describe step by step how you program pic16f628a with your PK2. I will try to imitate you.
 
The "PK2" :D seems to have read the device type ( manual select would be in a drop box) but the config is all bits set ? Program also reads 3FFF .
 
Microchip documents say that whenever MCLR pulled up to 12V the pic goes into programming mode and all pins are inputs.

Please show me where it says that? - you can't access programming mode if the PIC is running and disables MCLR.

The technique for writing programming software is to either:

1) Set MCLR to 12V - only then switch Vdd ON.

Or

2) Switch Vdd ON - then (VERY quickly) set MCLR to 12V (before the PIC can start running and disable MCLR).

I don't even know (at the moment) where my PK2 is - I've been using a PK3 recently as the PK2 didn't support the enhanced 14 bit series.

However, all my tutorials were done using a PK2 on a 16F628.
 
The "PK2" :D seems to have read the device type ( manual select would be in a drop box) but the config is all bits set ? Program also reads 3FFF .

Which is exactly what it reads if it can't enter programming mode, EVERYTHING reads as 1's - and 21FF is the un-programmed config setting for a 628a with or without a PIC connected.
 
I think what has happened the pic has been written with all FFFF ( every where ) including the configuration code protect ... :oops:
Quote "when I put another chip with same model is working" don't know what that means...
 
I think what has happened the pic has been written with all FFFF ( every where ) including the configuration code protect ... :oops:
Quote "when I put another chip with same model is working" don't know what that means...

You can't 'write' all 1's - you can only write zero's - the act of erasing the chip sets all the bits to 1's, and programming sets the required bits to zero.

The config fuses set to all 1's (21FF - not FFFF as only some bits exist) turns off code protection, and is just the setting for a blank PIC.
 
Please show me where it says that? - you can't access programming mode if the PIC is running and disables MCLR.

The technique for writing programming software is to either:

1) Set MCLR to 12V - only then switch Vdd ON.

Or

2) Switch Vdd ON - then (VERY quickly) set MCLR to 12V (before the PIC can start running and disable MCLR).

I don't even know (at the moment) where my PK2 is - I've been using a PK3 recently as the PK2 didn't support the enhanced 14 bit series.

However, all my tutorials were done using a PK2 on a 16F628.

It will be difficult to dig out the documents, I will if you really want them.
You expect the PK2 to know how to program pic16f628 so if you connect it to the programmer only the PK2 should do the programming and connect 12v to MCLR first or what ever needs doing.
Well, it doesn't.

I have pic running with external supply, the config bits are internal osc and disabled MCLR and the program works well. I connect 12v to MCLR, the program stops and all pins turn inputs.
Is this good enough proof to what I said that whenever you pull MCLR to 12v the pic goes into programming mode?

Is it possible that your PK2 uses old software?
 
It will be difficult to dig out the documents, I will if you really want them.
You expect the PK2 to know how to program pic16f628 so if you connect it to the programmer only the PK2 should do the programming and connect 12v to MCLR first or what ever needs doing.
Well, it doesn't.

As far as I'm aware it does - but it can't if you use external power and have MCLR disabled.

Have you tried it using power from the PK2, or isn't that possible?.

I have pic running with external supply, the config bits are internal osc and disabled MCLR and the program works well. I connect 12v to MCLR, the program stops and all pins turn inputs.
Is this good enough proof to what I said that whenever you pull MCLR to 12v the pic goes into programming mode?

No, if it's running you can't access programming mode if MCLR is disabled.

Is it possible that your PK2 uses old software?

It probably does, as I haven't used it for a while now - thinking as to where it is, I think it might be at work? (I did a project for a company near work, and programmed all the PIC's there for them).
 
I have just verified that I can program a PIC16F628a using a PICkit2. I am using PICkit2 V2.61 software and it works with the 64 bit version of Windows 7 pro and the 64 bit version of Windows 10 pro. It worked without any problem on both these versions of Windows. I have also used it in the past with XP pro (32 bit)

Les.
 
I have just verified that I can program a PIC16F628a using a PICkit2. I am using PICkit2 V2.61 software and it works with the 64 bit version of Windows 7 pro and the 64 bit version of Windows 10 pro. It worked without any problem on both these versions of Windows. I have also used it in the past with XP pro (32 bit)

Are you using ICSP, and are you using external power? - and are you disabling MCLR?.
 
Have you tried it using power from the PK2, or isn't that possible?.
I tried it powered from the PK2 (I put the other power source in the other room :) ). This is what I meant by saying:
if you connect it to the programmer only

I guess the possibility that some PK2 out there program pic16f628 and others don't, looks totally improbable to you. You believe that it must be error of the user. I have only one PK2 and I don't know enough to be able to add to this.
 
I think what has happened the pic has been written with all FFFF ( every where ) including the configuration code protect ... :oops:
Quote "when I put another chip with same model is working" don't know what that means...
that's mean i have tow chip model ' 16f628a '
one is working without any problem
the other one have this problem "Failed to program at programming address 0x0000"
 
I use a PicKit2, a "genuine" MicroChip type which came in a 16F887 development kit.

I only use 16F887s and 16F628s for my projects, I have never needed anything else.
The only times that I have had problems are when using the ICSP facilities and some part of my target system is connected to the pins used by ICSP.
To overcome this, on my home made development board I have a DIL switch to isolate the ICSP from the rest of the circuit.

JimB
 
that's mean i have tow chip model ' 16f628a '
one is working without any problem
the other one have this problem "Failed to program at programming address 0x0000"

OK
If you have one 16F628 which works correctly, and one 16F628 which gives the error <<Failed to program >> , then the one which failed to program is faulty and you must buy an new one.

JimB
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top