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

#Fuse directive for partial code protection on PIC18F8620

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



Joined: 03 Aug 2005
Posts: 1

View user's profile Send private message

#Fuse directive for partial code protection on PIC18F8620
PostPosted: Wed Aug 03, 2005 9:03 am     Reply with quote

I would like to apply code protection (both read and write) to Block 3 (0xC000 to 0xFFFF) only on my PIC18F8620 from the CCS compiler. The available Fuse options don't seem to allow this. I could edit the values of the PROTECT & WRT options, but would prefer a more straightforward, clearly documented method since I am afraid I'll forget to change it back on the next project. I could edit the Hex file, or edit the fuse bits after loading the file into the programmer, but this seems prone to error and oversight, especially when the project goes to production.

Can I create a new Fuse option? I tried to add one via the device editor without success.

Does anyone know a better solution for this?

Thanks,
Larry
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 03, 2005 9:23 am     Reply with quote

Back in the following thread, I asked him to email CCS to request that
those fuses be added. I don't know if he ever did it.
Maybe you should do it.
http://www.ccsinfo.com/forum/viewtopic.php?t=23569
bennyboos



Joined: 17 Nov 2005
Posts: 30
Location: Chester UK

View user's profile Send private message

#FUSES - partial setting of WRT
PostPosted: Thu Nov 17, 2005 8:05 am     Reply with quote

Hi Larry
I have a similar issue. I have an I2C bootloader on a PIC16F819 and I only want to protect the first 0x200 bytes - Impossible to do when your only options are either
Code:
#fuses WRT
or
Code:
#fuses NOWRT

I have just emailed CCS and am currently awaiting a reply.
In the meantime I am using the #rom directive to write a word directly to the config register.
In my case
Code:
#rom 0x2007 = {0b000xxxxxxxxxxxxx}

I guess you could #define each of the individual config bits to make it more readable
Hope this helps

Ben
bennyboos



Joined: 17 Nov 2005
Posts: 30
Location: Chester UK

View user's profile Send private message

PostPosted: Thu Nov 17, 2005 8:26 am     Reply with quote

OK - had a reply back from CCS
It seems that one can simply assign a constant to WRT as required

E.g. To set WRT1=1 and WRT=0 use
Code:
#fuses  WRT=2
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