CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Help Can't Erase 16LF84A

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
JohnKennedy



Joined: 12 May 2004
Posts: 38

View user's profile Send private message

Help Can't Erase 16LF84A
PostPosted: Mon Sep 05, 2005 6:55 am     Reply with quote

Hi

I have some 16LF84A Pics programmed but my customer has just requested a minor change.
Mad

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 Crying or Very sad

I tried using another Flash pic and it erases ok so theres no problem with my programmer -

any suggestions anyone??

thanks

JFK
Ttelmah
Guest







PostPosted: Mon Sep 05, 2005 7:30 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 05, 2005 8:03 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 05, 2005 2:05 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 06, 2005 2:28 am     Reply with quote

Thanks for that PCM Programmer I'll try that out.

JFK
guest
Guest







PostPosted: Tue Sep 06, 2005 9:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 06, 2005 9:57 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 07, 2005 3:08 am     Reply with quote

Hi

managed to get the chips erased thankyou Smile

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 Mad

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

View user's profile Send private message

PostPosted: Wed Sep 07, 2005 2:29 pm     Reply with quote

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








PostPosted: Wed Sep 07, 2005 3:02 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 07, 2005 4:54 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 08, 2005 8:55 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group