|
|
View previous topic :: View next topic |
Author |
Message |
epalite
Joined: 06 Apr 2008 Posts: 16
|
How to keep compiler from using RAM 0x70 through 0x7f |
Posted: Wed Apr 08, 2009 3:45 am |
|
|
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
|
|
Posted: Wed Apr 08, 2009 6:55 am |
|
|
Try this out:
|
|
|
epalite
Joined: 06 Apr 2008 Posts: 16
|
|
Posted: Wed Apr 08, 2009 7:28 pm |
|
|
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
|
|
Posted: Thu Apr 09, 2009 3:20 am |
|
|
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 |
|
|
|
|
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
|