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.

Newbe erase problem

Status
Not open for further replies.

Russlk

New Member
I am using Proton IDE lite and MeProg.exe programmer. When I try to erase my PIC12F675, I get an error message: "Configuration Programming Error", "Erase Failed". I never got that message before and in fact the chip is erased because a read brings up all zeros, even tho a blank check fails, saying" not blank at 000 = 000".

Does this mean the chip has failed, or is there a fault with the programmer?
 
When a pic chip is erased it is filled with 0x3fff and so 000 is not erased.

Mike.
 
Oh, right. Guess I'll try re-installing the software.
Re-installing the software didn't help. I have two 12F675 which both act the same, but a 16F627A erases with no error message, so I guess I need to buy some more 12F675s.
 
It is always best to look at the source.

Check the manual for the HARDWARE.
If it states that the erased byte(s) output something different than what the software outputs, then the software (you are using) is either not designed for that microcontroller, or the software contains bugs, and therefore you need a new version.

The easiest way to tell is to remove the chip from the programmer socket, and make a fake chip and plug it in. Assuming the programmer has no chip detection circuitry, use a voltmeter and connect the grounds together, and connect the +ve output from the voltmeter to the socket a data pin from the uC (microcontroller) would normally go.

Now run the programming software and tell it to erase the chip. You might have to do this 8 times (one for each byte).

For each byte you test, watch the voltmeter. If the display shows a number greater than 1, then the software has sent a 1 to that bit.

Start with D0, and go all the way to D8 (or the highest bit #).
you will eventually get 8 readings. then you can construct a binary number. D0 is always the low value.
For example: If the last 4 tests showed 5V, and the first 4 showed 0V, then you will have:

11110000

The later test results are shown more to the left, and the first results are shown to the right.

Now take the binary number, and convert it to hexadecimal. In this case, it is F0.

Check the value against your uC manual. If it is wrong, then either the software is bad, or the programmer (hardware) is improperly translating the signals received from the computer. The former is more likely to happen than the latter.

Good luck
 
I suggest ignoring mstechca's post! - it's complete rubbish!, don't under any circumstances try anything he suggests on a PIC programmer!. It won't tell you anything!, and could potentially damage something.
 
Russlk said:
I have two 12F675 which both act the same, but a 16F627A erases with no error message, so I guess I need to buy some more 12F675s.

I can think of two possible reasons for your problem.

1. Erasing a PIC involve sending the bulk erase command to it and therefore the PIC must be in Program mode before that command can be received and act upon. If you have configured the PIC with internal oscillator, the PIC might already be running its program codes and would not enter program mode.

2. You have configured the /MCLR pin to be an input pin so the hardware programmer cannot reset the PIC and place it into program mode.

Microchip realised this probelm and thus design the 12F675 to go into program mode if the Vpp voltage is applied first to the Vpp pin ahead of the voltage going to Vdd pin. Many programming software or hardware does not have the capability to output Vpp ahead of Vdd and so cannot re-program a 12F675 after the initial programming.

More information is available in Microchip document DS41191C, page 4 onwards. Hope this helps.
 
Thanks, Chung, that is exactly my problem. So, the next time I program a 12F675, I will make sure that MCLR is operational. I want to use internal oscillator, but if necessary I can use external oscillator until the program is finalized.
 
A possible solution is to isolate the Vdd to the PIC. Then use a N-Ch MOSFET to reconnect Vdd to the PIC. The gate signal of the MOSFET is from Vpp. This would ensure Vpp is applied ahead of Vdd.

For normal use, just use a toggle switch to short out the MOSFET source and drain.
 
There's actually no 'need' to apply Vpp first, it works perfectly applying Vpp after Vdd, as long as the delay between the two is VERY short. As with all internal oscillator PIC's you MUST get to programming mode before the oscillator starts running, as then it's too late.
 
Dependant on your hardware, you maybe able to use WinPic. This has the ability to raise vdd before or after MCLR=Vpp.

Mike.
 
I made a new socket with VPP turning on VDD. The error message now is "Target device does not match selected device".

1. How does the programmer know what device is plugged in?
2. How can I make it recognize the 12F675?

When I try to erase, the VPP and VDD come up momentarily.
 
Russlk said:
I made a new socket with VPP turning on VDD. The error message now is "Target device does not match selected device".

1. How does the programmer know what device is plugged in?

I'm sorry that the modification did not work.

The software reads the PIC ID code after putting the PIC in program mode. But the catch here is that the software pulses high Vpp and immediately try to read the ID(it thinks Vdd is already there) but now, with the modification, the PIC is still in the process of powering up. If there is a short delay before it reads the PIC then it would read the correct ID. This is a shortcoming of your programming software, assuming MCLR pin on the PIC is available all the time.

I agree with Pommie that another programming software which can control both Vpp and Vdd and their order of application would be much better.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top