View previous topic :: View next topic |
Author |
Message |
hayee
Joined: 05 Sep 2007 Posts: 252
|
ICD and code protection bit problem |
Posted: Wed Jul 09, 2008 11:06 pm |
|
|
Hi Everyone;
i am using pic16f870 and ccs c compiler (version 4.020).
when i enable ICD=true and set "protect" in fuses like(#fuses PROTECT,NOLVP,WDT) and program it through ICD, it program the IC but the IC is not code protected
But when i disable ICD=true and set "protect" in fuses like(#fuses PROTECT,NOLVP,WDT) and program the IC with programmer then the IC is code protected.
i wanna know that where is the problem occurs.
Thanks. |
|
![](templates/subSilver/images/spacer.gif) |
Indy
Joined: 16 May 2008 Posts: 24
|
|
Posted: Thu Jul 10, 2008 2:22 am |
|
|
You can use the ICD as a debugger or as a programmer. You only have to set ICD=TRUE when using the ICD as a debugger.
A debugger does not work when the PROTECT fuse is set, that's why the fuse is disabled by the compiler. |
|
![](templates/subSilver/images/spacer.gif) |
hayee
Joined: 05 Sep 2007 Posts: 252
|
|
Posted: Thu Jul 10, 2008 3:46 am |
|
|
i am using ICD as a programmer not as a debuger.so why this error is happening. |
|
![](templates/subSilver/images/spacer.gif) |
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Thu Jul 10, 2008 8:29 am |
|
|
Since you are using the ICD as a programmer, do you have the
ICD=True in the code, or do you have it commented out? |
|
![](templates/subSilver/images/spacer.gif) |
hayee
Joined: 05 Sep 2007 Posts: 252
|
|
Posted: Fri Jul 11, 2008 12:52 am |
|
|
my configuration is like that
Code: |
#include <16f628A.h>
#device ICD=TRUE
#device *=16
#fuses HS, WDT, NOLVP, NOBROWNOUT, PROTECT, PUT
#use delay(clock=20M)
|
i have enable ICD and also PROTECT in fuse. |
|
![](templates/subSilver/images/spacer.gif) |
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Fri Jul 11, 2008 8:03 am |
|
|
My guess is that when you have
ICD=TRUE then the compilers thinks
In Circuit Debugger = TRUE; eg: your using the debugger.
Then it says.. Ohh he is using the debugger, so I can't set the protect fuse.
When you comment out the ICD=TRUE then everything works. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
NICE |
Posted: Thu Jan 21, 2010 12:02 pm |
|
|
treitmey wrote: | My guess is that when you have
ICD=TRUE then the compilers thinks
In Circuit Debugger = TRUE; eg: your using the debugger.
Then it says.. Ohh he is using the debugger, so I can't set the protect fuse.
When you comment out the ICD=TRUE then everything works. |
And it was just so nice of the compiler to let me know that it didn't protect anything for me. |
|
![](templates/subSilver/images/spacer.gif) |
|