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

ICD and code protection bit problem

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



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

ICD and code protection bit problem
PostPosted: Wed Jul 09, 2008 11:06 pm     Reply with quote

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.
Indy



Joined: 16 May 2008
Posts: 24

View user's profile Send private message

PostPosted: Thu Jul 10, 2008 2:22 am     Reply with quote

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.
hayee



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

PostPosted: Thu Jul 10, 2008 3:46 am     Reply with quote

i am using ICD as a programmer not as a debuger.so why this error is happening.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

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

PostPosted: Thu Jul 10, 2008 8:29 am     Reply with quote

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?
hayee



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

PostPosted: Fri Jul 11, 2008 12:52 am     Reply with quote

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.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

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

PostPosted: Fri Jul 11, 2008 8:03 am     Reply with quote

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.
Guest








NICE
PostPosted: Thu Jan 21, 2010 12:02 pm     Reply with quote

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.
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