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

Boot Block Code Protection Bit

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



Joined: 22 Oct 2007
Posts: 21

View user's profile Send private message

Boot Block Code Protection Bit
PostPosted: Thu Apr 01, 2010 2:18 pm     Reply with quote

If I understand the data sheet for the 18f8722, there are 2 code protection bits that seem to overlap:

bit 6 CPB: Boot Block Code Protection bit
1 = Boot block (000000-0007FFh) not code-protected
0 = Boot block (000000-0007FFh) code-protected

An then bit 0 of the CPn bits (CP0):

bit 7 CP7: Code Protection bit(1)
1 = Block 7 (01C000-01FFFFh) not code-protected
0 = Block 7 (01C000-01FFFFh) code-protected
bit 6 CP6: Code Protection bit(1)
1 = Block 6 (01BFFF-018000h) not code-protected
0 = Block 6 (01BFFF-018000h) code-protected
bit 5 CP5: Code Protection bit(2)
1 = Block 5 (014000-017FFFh) not code-protected
0 = Block 5 (014000-017FFFh) code-protected
bit 4 CP4: Code Protection bit(2)
1 = Block 4 (010000-013FFFh) not code-protected
0 = Block 4 (010000-013FFFh) code-protected
bit 3 CP3: Code Protection bit(3)
1 = Block 3 (00C000-00FFFFh) not code-protected
0 = Block 3 (00C000-00FFFFh) code-protected
bit 2 CP2: Code Protection bit
1 = Block 2 (008000-00BFFFh) not code-protected
0 = Block 2 (008000-00BFFFh) code-protected
bit 1 CP1: Code Protection bit
1 = Block 1 (004000-007FFFh) not code-protected
0 = Block 1 (004000-007FFFh) code-protected
bit 0 CP0: Code Protection bit
1 = Block 0 (000800, 001000 or 002000(4)-003FFFh) not code-protected
0 = Block 0 (000800, 001000 or 002000(4)-003FFFh) code-protected



Are these one and the same? I realize that CP0 has to also use the fuse that sets the size associated with CP0 (4K, 2K, or 1K), but assuming I set it to 1K, do these two configuration bits do the same thing?

Thanks for any help.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 01, 2010 2:42 pm     Reply with quote

They are not the same, because Block 0 protection (CP0) starts at a
minimum address of 0x800. The Boot Block protection (CPB) always
start at address 0x0000 (and ends at 0x7FF).
loupan



Joined: 22 Oct 2007
Posts: 21

View user's profile Send private message

PostPosted: Fri Apr 02, 2010 5:38 am     Reply with quote

Thanks PCM Programmer!
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