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.

Unable to erase 16F88

Status
Not open for further replies.

GRC

New Member
Hello all
Recently got up and running with the inchworm and the 16F88.
Running into a bit of a snag as now the PIC will not erase.

Here is a list I get when I try to erase/verify erase.


ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0x1683, Val Read = 0x3FFF)
MPLAB ICD 2 Ready
Erasing Target Device...
...Erase Succeeded
MPLAB ICD 2 Ready
Erasing Target Device...
...Erase Succeeded
MPLAB ICD 2 Ready
Blank Checking...
...Program Memory
ICD0161: Verify failed (MemType = Program, Address = 0x10, Expected Val = 0x3FFF, Val Read = 0x0)
...Device not blank
MPLAB ICD 2 Ready

Any ideas why it will not erase?
 
Check the wiring to the target. I get that all the time and wiggle the chip-clip and all is well.

How long is the cable you use to program the target?

I made an 2x5 to 2x5 for ICD2 to ICD2, an ICD2 to 8 pin (chip-clip), and ICD2 to 18 pins (chip-clip) and an ICD2 to 40 pins (as I have old stuff I made before I had the inchworm/ICD2).

I can clip onto the chip and program. And I see that error sometimes.

Also, are you sure you left MCLR alone? If you are using an internal OSC and flip that one it will make life a pain too.
 
Last edited:
mramos1
You said, "Also, are you sure you left MCLR alone? If you are using an internal OSC and flip that one it will make life a pain too". Yes I set the internal
OSC and changed MCLR to RBA. Believe this might be the problem now.
Just read in an older post that sometimes the 16F88 cant enter programming
mode when using internal OSC config fuse was set.

Any ideas what to do?
 
Write a program with a NOP and write to the chip over and over. It worked for me a couple of times.

But I have an old programmer I use to reset them.

If you read the 16F88 posts, Nigel explains the process. But with the Inchworm/ICD2 it might be a problem. As speed is the key, you flip programming on and try to write to it before the internal OSC fires up.

It might work.. You have other chips?
 
MPLAB should have issued a warning when setting both MCLR and Internal RC on. I've added a warning to the updated Inchworm Assembly manual (pg 7)

To be safe just don't use MCLR as an input with a Inchworm (or many other programmers). Leave it as a reset pin with an external pullup.

If you just got to have the MCLR pin then use the ICD2 special header version (available for most small PICs)

I'll look in to a work around, some fancy tricks with jumpers or a cable mod (like a switch on the +5V line in the programmig cable)

Another thought might be something like this. I'll see if I can adapt it to the Inchworm design.
http://www.voti.nl/wisp628/index_1.html
**broken link removed**
 
Last edited:
Hey guys, thanks for your replies.

Bill, you know, I did get a warning about the MCLR and INT OSC.
Thought all would be ok if I just pressed on and programmed anyway.
I wonder if using another programmer might erase the PIC. Nigel
posted a procedure about this very issue. Still a bit unsure exactly
how to go about it. The thought of 4K memory in the 18 pin package
with 8Mhz INT OSC sounded too good to be true. Twice the bang of
the 628s, cant lose. Good thing I bought 4 of them.

Hopefully someone else will read this and avoid the same mistake.
Thanks again for the help guys.
 
Success, I got it to erase. Used an older programmer that I use for Basic
programming and attempted the erase process mulitple times and it finally
erased the memory.
 
GRC said:
Success, I got it to erase. Used an older programmer that I use for Basic
programming and attempted the erase process mulitple times and it finally
erased the memory.

That is how I did it.. It works, you just have to hit it over and over.
 
Every once in a while it seems to hang when erasing, but now with the config
setup right it only takes 2 or so attempts max when erasing.

For the record the Inchworm was well worth the money. Glad I bought it.

By the way, why is it when I disconnect my ICD2/Inchworm the program
stops running on my PIC. Is it in debug mode when using the
Inchworm as a programmer?
 
GRC said:
Every once in a while it seems to hang when erasing, but now with the config
setup right it only takes 2 or so attempts max when erasing.

For the record the Inchworm was well worth the money. Glad I bought it.

By the way, why is it when I disconnect my ICD2/Inchworm the program
stops running on my PIC. Is it in debug mode when using the
Inchworm as a programmer?

Do you have the MCLR pullup resistor? Inchworm will often pull to ground when disconected if its still connected.
 
No, I do not a pull-up resistor on the MCLR pin. This clears things up a bit.
Didn't realize it would something that simple.

Thanks Bill.
 
With the PICs it is best to get used to pulling up MCLR.. When you master it like many here (not me) it is not a problem. But for now, avoid that pin in software, leave it as MCLR and pull it up.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top