View previous topic :: View next topic |
Author |
Message |
WASSIM22 Guest
|
USE THE 8k programe memory |
Posted: Tue Apr 01, 2008 4:04 pm |
|
|
how can I use the full programe memory?? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Apr 01, 2008 4:18 pm |
|
|
Don't use the demo compiler.
http://www.ccsinfo.com/demopoll.php
Quote: |
The demo compiler is licensed for 30 days and has a 2k program size limit. |
|
|
|
wassim22 Guest
|
|
Posted: Tue Apr 01, 2008 4:40 pm |
|
|
if it's not a demo, does it exist some thing to do with my program to guarantee the use of 8k program memory |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Apr 01, 2008 4:41 pm |
|
|
1. Post the PIC that you are using.
2. Post the CCS compiler version.
3. Post the how much ROM you are using. |
|
|
WASSIM
Joined: 01 Apr 2008 Posts: 5
|
|
Posted: Tue Apr 01, 2008 5:19 pm |
|
|
1-PIC16F877
2- CCS VERSION 4.057
3-ROM used: 2693 words (33%)
i need more,
thank you for your help |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Apr 01, 2008 5:47 pm |
|
|
Do you get an error message when you compile, if you try to add
more lines of code ? |
|
|
WASSIM
Joined: 01 Apr 2008 Posts: 5
|
|
Posted: Sat Apr 05, 2008 2:27 am |
|
|
yes when I use more memory program a error message appear:" out of rom,the segment or the program is too large Main". |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Apr 05, 2008 9:57 am |
|
|
Quote: | out of rom,the segment or the program is too large Main". |
In CCS, a function can't be larger than a ROM page. For the 16F877,
a ROM page is 2048 words. The solution is to break up the code in
main() and put some of it into functions. Then call those functions from
main(). This will allow the compiler to put those functions into other
ROM segments, and you won't get the "out of rom" error anymore.
Example:
Code: |
void func1(void)
{
// code
}
void func2(void)
{
// code
}
//====================
void main(void)
{
// Initial main code goes here.
// Put some of the main() code into these functions.
func1();
func2();
// or more.
// Other main code goes here.
while(1);
} |
|
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Mon Apr 07, 2008 8:55 am |
|
|
There have been several posts regarding this error. Do a search on 'out of rom' and you should find the answers you are looking for.
Ronald |
|
|
WASSIM
Joined: 01 Apr 2008 Posts: 5
|
|
Posted: Mon Apr 07, 2008 10:23 am |
|
|
also you must add #separate before the main function |
|
|
|