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

Be careful with EBTR table read protection

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







Be careful with EBTR table read protection
PostPosted: Thu Jan 03, 2008 8:15 am     Reply with quote

Hi all!

I had a very annoying problem on a PIC18 with constant strings which started disappearing when my program grew and when I moved the functions around the program. I thought it was a compiler bug but then I noticed that I had enabled a table read protection for program memory through #fuses EBTR (Table-read-protect MEMORY from table-reads executed in other blocks). For reading constant strings the compiler seems to use such table reads and setting NOEBTR seems to solve my problem. So be careful when setting these!

BTW: Can anyone tell me what the table reads protection is good for?

Best regards,
Zer0flag
treitmey



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

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

PostPosted: Thu Jan 03, 2008 9:29 am     Reply with quote

spec 18F452 pg 209
Quote:
The user program memory is divided into five blocks.
One of these is a boot block of 512 bytes. The remainder
of the memory is divided into four blocks on binary
boundaries.

so if you have boot programmer, and the protection bit
you can't read from one section and then over into the next.
Quote:
19.4 Table Read instruction that
executes from within that block is allowed to read. A
Table Read instruction that executes from a location
outside of that block is not allowed to read, and will
result in reading ‘0’s.


so the boot programmer can only read in its area, and trying to read
outside the boot area in the next data table will read back 0.

maybe helpfull, maybe not,.. ?
Zer0flag
Guest







PostPosted: Thu Jan 03, 2008 2:43 pm     Reply with quote

Thank you treitmey! So if I understood correctly it is a kind of code protection. The problem is that the datasheets tell us what we can do but never why this is useful :(
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