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