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

How to keep compiler from using RAM 0x70 through 0x7f

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



Joined: 06 Apr 2008
Posts: 16

View user's profile Send private message

How to keep compiler from using RAM 0x70 through 0x7f
PostPosted: Wed Apr 08, 2009 3:45 am     Reply with quote

Hi,

I am keeping these ram locations for cross page access without having to flipping pages.

On CCS PCM C Compiler (Version 4.073) with F690, the compiler does not seem to use the location.

However, with F887, location 0x77 through 0x7a are reserved.

Is there a directive to keep the compiler away? Thanks,
Guest








PostPosted: Wed Apr 08, 2009 6:55 am     Reply with quote

Try this out:

Code:

#RESERVE  0x70:0x7f
epalite



Joined: 06 Apr 2008
Posts: 16

View user's profile Send private message

PostPosted: Wed Apr 08, 2009 7:28 pm     Reply with quote

Hi,

Tried your suggestion.

It works on F690, however, it doesn't work on F887. Here is the error and the source code for F887:

*** Error 103 "main.c" Line 6(2,6): Constant out of the valid range 07B is reserved by the compiler

0x7b is used by compiler as scratch.

Source:
Code:

#device PIC16F887
#reserve 0x70:0x7f

#define PORTA_MASK   0x01

#byte TRISA   = 0x85

void main() {
   set_tris_a(TRISA | PORTA_MASK);
}
Ttelmah
Guest







PostPosted: Thu Apr 09, 2009 3:20 am     Reply with quote

If you have the 'windows' compiler, you can change the scratch location with the device editor. The compiler uses this area, to reduce the need to page swap. The memory in addresses 70 to 7F, is accessible through all the banks, without having to page switch. Hence putting the scratch memory here, saves a lot of overhead, _on chips that have more than one bank of RAM_. Because the F690, only has memory in the bottom page, this optimisation doesn't apply, so the scratch is not put into this area by default.

Best Wishes
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