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 CCS Technical Support

how to erase protected PIC?

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



Joined: 14 Jan 2004
Posts: 88
Location: Aurora, Ontario, Canada

View user's profile Send private message Visit poster's website

how to erase protected PIC?
PostPosted: Wed May 26, 2004 1:11 pm     Reply with quote

I have a PIC 18F6620, which I loaded with a bootloader and tried experimenting with security bits and such. I now have a PIC, which I cannot reprogram.. how can I override the security bits in it to reprogram it?
I have these flags set:

Code:

#fuses HS,NOWDT,NOLVP,CPB,WRTBP,EBTRB   //Enable all protections for the Boot Block
//CPB = Code Protect Boot
//WRTB = Table Write Protect Boot
//EBTRB = Table Read Protect Boot


Obciously the write protect bit is the one causing trouble now, but can it be overwritten?

Kasper


Last edited by Kasper on Wed May 26, 2004 2:23 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed May 26, 2004 1:25 pm     Reply with quote

Did you try a bulk erase ?
Some related threads from the Microchip board:
http://forum.microchip.com/tm.asp?m=34395&mpage=1&key=erase&anchor#34395
http://forum.microchip.com/tm.asp?m=36767&mpage=1&key=erase&anchor#37881
http://forum.microchip.com/tm.asp?m=35826&mpage=1&key=erase&anchor#35878
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed May 26, 2004 1:38 pm     Reply with quote

This is from the data sheet:

Quote:

Note: Code protection bits may only be written to
a �0� from a �1� state. It is not possible to
write a �1� to a bit in the �0� state. Code protection
bits are only set to �1� by a full chip
erase or block erase function. The full chip
erase and block erase functions can only
be initiated via ICSP or an external
programmer.


You might want to dig deeper into the data sheet to find out more.

Ronald
Kasper



Joined: 14 Jan 2004
Posts: 88
Location: Aurora, Ontario, Canada

View user's profile Send private message Visit poster's website

PostPosted: Wed May 26, 2004 2:26 pm     Reply with quote

I tried a Debugger >Clear Memory > All memory, but got this:

Quote:

Setting Vdd source to target
Target Device PIC18F6620 found, revision = 0x4
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
ICD0157: Attempted target memory access using an invalid type and mode combination. (Mem = Data) (Mode = ICSP) (Type = Write)
ICD0169: CapID not supported for this device (WREG)
ICD0157: Attempted target memory access using an invalid type and mode combination. (Mem = Data) (Mode = ICSP) (Type = Write)


I am using the ICD2 on the 18F6620, which is soldered onto a board, and it is operating at 3.3V, which I am starting to think is a problem for an erase Sad
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed May 26, 2004 3:28 pm     Reply with quote

If I remember correctly, the spec sheet states that you need to have 5v applied. Dig into the data sheet.

Ronald
Kasper



Joined: 14 Jan 2004
Posts: 88
Location: Aurora, Ontario, Canada

View user's profile Send private message Visit poster's website

PostPosted: Wed May 26, 2004 3:51 pm     Reply with quote

I just modded the board so that the ICD and the PIC gets 5V.. still no go.. I guess I have to really dig into those datasheets, or better yet, see if I can get the PIC replaced.. damn surfacemount chips are a pain to replace though :(
Ttelmah
Guest







PostPosted: Thu May 27, 2004 5:07 am     Reply with quote

Kasper wrote:
I just modded the board so that the ICD and the PIC gets 5V.. still no go.. I guess I have to really dig into those datasheets, or better yet, see if I can get the PIC replaced.. damn surfacemount chips are a pain to replace though :(

My memory, is that the key', is that you have to use ICSP, _not_ low voltage ICSP. The data sheet says (as you quote), that the bits can only be reset using a full erase, with ICSP, or an external programmer, but does not make it clear, that this does not include low voltage ICSP. However on other chips in the past, this has definately been true, and Vihh, must be applied to clear these bits...

Best Wishes
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