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 CCS Technical Support

code protection

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



Joined: 27 Apr 2012
Posts: 15
Location: TURKEY

View user's profile Send private message

code protection
PostPosted: Tue Sep 11, 2012 6:09 am     Reply with quote

Hi, I want to code protection for ccs c. No one can not read from chip. How can I do? Maybe fuses ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Tue Sep 11, 2012 7:38 am     Reply with quote

Yes, depends on the chip.

On many older chips, just 'PROTECT' in the fuses, but on a lot of newer chips there are separate options for different parts of the memory.
Things to remember. If you write the code to the chip, with PROTECT set, you can't verify the chip. The way you do this, is to write one chip, without the protect fuse, verify it is OK, and only then set the PROTECT fuse. Then read the chip back. You will get a set of garbage values. Store these.
Then write the chips, with PROTECT set, and verify the chips against the garbage values. The same code should always give the same garbage returns, if the chip has programmed correctly.
You can still read the chip, but what comes back is not code.
Then you can only turn off the PROTECT fuse, by performing a full erase on the chip, which deletes the code. If you program the read garbage into another chip, it won't work. Hence 'protected'.

The data sheet for your PIC, should tell you what protect options are available. Then just a matter of working out what the CCS fuse names are for the options you want.

Best Wishes
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Sep 11, 2012 7:43 am     Reply with quote

First, the code programmed into the PIC is not the source C code , rather the compiled 'hex' code or assembler...

You have to read the datasheet for whatever PIC you're using as some have simple code protect, others have 'banks' of protection.
Also look at the header file CCS supplies for your PIC as it will have the 'codewords' required to select the correct 'fuses' /options configuration for that PIC.

Some PICs are easy to read even when protected, though a simple,effective way to reduce or delay anyone is to just sand or grind off the PIC id data on the chip itself.that way it's just another,say 40 pin device, and it'll take a few days to figure out which PIC.Be sure to mark them with say coloured nail polish so YOU know which PIC it is !

Nowadays I'd be surprised if anyone would truly 'hack' into any product to get the code. The time spent would be more than if they actually wrote the code themselves.

hth
jay
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Thu Sep 13, 2012 11:10 pm     Reply with quote

temtronic wrote:

Nowadays I'd be surprised if anyone would truly 'hack' into any product to get the code. The time spent would be more than if they actually wrote the code themselves.



Isn't that the truth.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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