View previous topic :: View next topic |
Author |
Message |
JohnKennedy
Joined: 12 May 2004 Posts: 38
|
Help Can't Erase 16LF84A |
Posted: Mon Sep 05, 2005 6:55 am |
|
|
Hi
I have some 16LF84A Pics programmed but my customer has just requested a minor change.
I thought I could simply erase the PIC and re-program. I tried this on my Picstart Plus Programmer and it doesn't erase the data memory. I tried more than one chip but same on the others
I tried using another Flash pic and it erases ok so theres no problem with my programmer -
any suggestions anyone??
thanks
JFK |
|
|
Ttelmah Guest
|
|
Posted: Mon Sep 05, 2005 7:30 am |
|
|
Programming data sheet. Section 2.3.1.9. "If the device is code protcted, the Bulk Erase command will not work".
You need to generate the sequence described in section 4.1, which erases everything (including configuration, data EEPROM etc.). This is done on the 16F84A, by clearing the code protect bit (reprogramming the configuration word), then issuing a 'begin erase programming' command, without trying to seperately erase. MicroChip, should be able to tell you how to do this on the PicStart.
Best Wishes |
|
|
JohnKennedy
Joined: 12 May 2004 Posts: 38
|
|
Posted: Mon Sep 05, 2005 8:03 am |
|
|
The Device wasn't code protected, I have doubled checked this by changing the configuration bit and verifying, the programmer reports the error. Could anything else of caused this or are the chips U/S.
thanks
JFK |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Sep 05, 2005 2:05 pm |
|
|
I just did some testing with a 16F877, and it seems that you
can't erase the Data EEprom with the PicStart-Plus by clicking
on the "Erase Flash Device" button.
I checked the Microchip forum, and here's a thread where Jenninc
says that you can't do it that way.
http://forum.microchip.com/tm.asp?m=65180&mpage=1
So that confirms it.
However, there is a way to manually do it:
The way to erase Data EEprom is to go to the View menu in MPLAB,
and select EEPROM. Then set the data to all FF's. You can do this
manually, by editing each byte, or you can right-click on the window
and select "Fill Memory". Then you'll see a pop-up window in which
you can easily fill all Data EEprom with all FF's.
Then go to the Programmer menu in MPLAB, and select PicStart-Plus,
and enable it.
Then in the Programmer menu, select "Settings". You'll notice that it's
set for "Auto Select Memory Areas and Range". Un-check that box.
Now go down to the boxes in the bottom-right corner of that pop-up,
and select the areas that you want to be over-written. Be sure to
select "EEPROM Data". Now program the PIC. The Data EEprom will
be written to all FF's. Do a blank check or read the chip and view
the Data EEprom window to verify this.
Once you're done, be sure to go back in the Settings box, and put it
back to "Auto Select Memory Areas and Range". |
|
|
JohnKennedy
Joined: 12 May 2004 Posts: 38
|
|
Posted: Tue Sep 06, 2005 2:28 am |
|
|
Thanks for that PCM Programmer I'll try that out.
JFK |
|
|
guest Guest
|
|
Posted: Tue Sep 06, 2005 9:53 am |
|
|
Had same problem with 18LF chips. You must erase at 5V even though its a low voltage chip. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Sep 06, 2005 9:57 am |
|
|
He is not using ICSP. He's using the PicStart-Plus. It runs at 5v.
From his post:
Quote: | I tried this on my Picstart Plus Programmer and it doesn't erase the data memory. |
|
|
|
JohnKennedy
Joined: 12 May 2004 Posts: 38
|
|
Posted: Wed Sep 07, 2005 3:08 am |
|
|
Hi
managed to get the chips erased thankyou
But this has created another problem ,when I go back to tick the ' auto Select Memory Areas box and click 'Apply' the Configuaration Bits box is the only one that remains ticked consequently I can only program the configuration bits now, if I go back and change it to have the program memory box ticked (as it was before I did any of these changes) as soon as I click the apply button the Program Memory box clears
This apply to this project only, if I load any of the others then all is ok.
thanks
JFK |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 07, 2005 2:29 pm |
|
|
Rather than me researching it, the easiest thing would be for you
to delete the project and workspace files for that project, and just
make a new project. It would probably fix everything. |
|
|
Guest
|
|
Posted: Wed Sep 07, 2005 3:02 pm |
|
|
Already tried that, doesn't work. I managed to program the chips in the end by using the import option on the hex file. I'll have to sort out the rest when I have time. Thanks for you help.
JFK |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 07, 2005 4:54 pm |
|
|
OK, I tested it some more.
I can get it (MPLAB vs. 7.20) to behave in the same way that
you're seeing if I close my "Test" workspace (for a 16F877)
and have no project and no workspace.
But if I load the workspace for my standard 16F877 project,
then it works fine:
1. De-select the "Auto Select" box, and un-check the
"Configuration Bits" box (which, like you saw, was the only
one checked).
2. Re-select the "Auto Select" box, and click "Apply", and then
both the "Program Memory" and "Configuration Bits" are
automatically selected by MPLAB.
So my conclusion is that you must have a workspace with a project
loaded in order for it to work.
-----------------
There's more:
Also, you have to compile the project. As a test, I opened a DOS box
and went in and deleted all the files that are created when you compile
a project: COF, HEX, LST, etc.
Then I got the exact thing that you're seeing. It doesn't know there's
any Program Memory. If I do a quick compile, then it starts working.
Selecting "Auto Select" causes the "Program Memory" and "Config Bits"
to become selected. |
|
|
JohnKennedy
Joined: 12 May 2004 Posts: 38
|
|
Posted: Thu Sep 08, 2005 8:55 am |
|
|
Thanks for the time you have put in PCM Programmer. As soon as I get a few spare minutes I'll take a look at what you suggest.
Thanks again
JFK |
|
|
|