View previous topic :: View next topic |
Author |
Message |
Geps
Joined: 05 Jul 2010 Posts: 129
|
Protected Code Even When Using NOPROTECT? |
Posted: Tue Jul 13, 2010 4:11 am |
|
|
Hi,
I'm trying to program a PIC18F4520 and despite having fuses set to:
Code: | #fuses INTRC_IO,NOWDT,NOPROTECT,BROWNOUT,PUT,NOLVP,NOCPD,NOWRT
|
My programmer (PICKIT2) is still displaying 'All Protect' and displays zeros when reading from the device.
I've looked through all the fuses for teh device and can't find any further ones I'd have to include.
Any ideas?
Cheers,
EDIT: Compiler Version PCWH 4.087 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19509
|
|
Posted: Tue Jul 13, 2010 5:01 am |
|
|
You probably need to perform a full erase.
If the erase fuse is set, it can _only_ be cleared by completely erasing the chip (makes sense if you think about it....). Hence if the fuse has been set in the past, a full erase is needed. On many programmers there is an option to 'erase only memory needed', and if this is set, and the protect fuse has been set in the past, because a 'full erase' is not automatically done, you get the behaviour you are seeing.
Best Wishes |
|
|
Geps
Joined: 05 Jul 2010 Posts: 129
|
|
Posted: Tue Jul 13, 2010 5:08 am |
|
|
Excellent thanks.
For anyone else who has this problem:
Erase button (next to verify)
Untick Tools -> Enable Code Protect
Untick Tools -> Enable Data Protect
Reload HEX
Write |
|
|
|