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

USE THE 8k programe memory

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



Joined: 01 Apr 2008
Posts: 5

View user's profile Send private message MSN Messenger

PostPosted: Sat Apr 05, 2008 2:27 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 9:57 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 07, 2008 8:55 am     Reply with quote

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

View user's profile Send private message MSN Messenger

PostPosted: Mon Apr 07, 2008 10:23 am     Reply with quote

also you must add #separate before the main function
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