View previous topic :: View next topic |
Author |
Message |
Kasper
Joined: 14 Jan 2004 Posts: 88 Location: Aurora, Ontario, Canada
|
how to erase protected PIC? |
Posted: Wed May 26, 2004 1:11 pm |
|
|
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
|
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Wed May 26, 2004 1:38 pm |
|
|
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
|
|
Posted: Wed May 26, 2004 2:26 pm |
|
|
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 |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Wed May 26, 2004 3:28 pm |
|
|
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
|
|
Posted: Wed May 26, 2004 3:51 pm |
|
|
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
|
|
Posted: Thu May 27, 2004 5:07 am |
|
|
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 |
|
|
|