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

PIC18F452 how to apply code protection using programmer opt?

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








PIC18F452 how to apply code protection using programmer opt?
PostPosted: Mon Nov 14, 2005 4:15 am     Reply with quote

Hello All,

I have a problem regarding applying Code protection of PIC18F452. I have written a code for PIC18F452 and its program memory is almost fill i.e code 32070 editor shows.

According to my knowledge correct me if i am worng that CP0-CP1-CP2,CP3 bits of PIC18F452 register should be set to all zero to protect PIC18F452's code from read. But when i do this my PIC dont works. Although i have checked this thing when my code is not too much as 32070 (i.e programm memory nearly filled). then it works ok.

Where i am wrong..

regrads
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 14, 2005 5:53 pm     Reply with quote

Quote:

CP0-CP1-CP2,CP3 bits of PIC18F452 register should be set to all zero to
protect PIC18F452's code from read. But when i do this my PIC dont works

If you have the CCS compiler, just put PROTECT in the #fuses statement
as shown below. This will set all the CPx bits = 0 and enable code
protection.
Quote:
#include <18F452.h>
#fuses XT,NOWDT,PROTECT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)


I suspect that you may not have the CCS compiler, and you may
be setting the CPx bits by other means. You are probably trashing the
config bits in some other config register and this causes your program
to lock-up.
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