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 support@ccsinfo.com

#separate and out of ROM

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



Joined: 24 Dec 2003
Posts: 7

View user's profile Send private message

#separate and out of ROM
PostPosted: Sat Dec 27, 2003 2:53 pm     Reply with quote

Hi,
I am programming a PIC16f877 using the PCW PCM C compiler.
I have been getting the error message "out of ROM a segement of the program is too large" i looked in the .sta file and noticed that rom useage is "ROM used: 1835 (90%)" and all my functions are in page 0 and the main function seems to be too big, inside my main function i have relativly little code but i call alot of other functions so i added the #SEPARATE directive before the decleration and definition of some of the bigger functions that i call and continued to call the functions in the same way. this seemed to have no effect. the compiler still complains about being out of ROM. IT appears that all the fucntiosn are still within page 0 after doign this and the rom usage for the main function hasnt changed.
Can anyone give me some tips as to what i may be doing wrong?
Thanks in advance
Greg
Greg



Joined: 24 Dec 2003
Posts: 7

View user's profile Send private message

Greg-
PostPosted: Sun Dec 28, 2003 3:19 pm     Reply with quote

Hi,
I suppose my real problem is understanding how the compiler and the program memory pages work. The pic16f877 has: "8K x 14
words of FLASH program memory" and the compiler is saying that having used 1718 words it is 84% full, what does this mean?
Quote:

ROM used: 1718 (84%)
330 (16%) including unused fragments

I also am having trouble understanding what it means where it says in the .sta file that every funtion in my program is in page '0' surely this is the problem, that page 0 is only 2K and it is now full, how do i make the functions appear in different pages?
Quote:

Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-007FF 1714 330

Any tips or advance are much appreciated,
Thank you
Greg
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Dec 28, 2003 3:40 pm     Reply with quote

I don't have PCW, so I don't have a .STA file to look at.
However, if this statement that you've posted,
"ROM used: 1718 (84%)" is the same thing that is shown
at the top of the .LST file, then something is wrong.
Can you look at the top of your .LST file and tell me
if it has the statement above ?

The implication of that statement is that your PIC has only
2048 words of ROM, total. But a 16F877 has 8192 words.

Based on your previous post concerning the EEPROM, I have
to ask you this question: Does your version of PCW actually
support the 16F877, or did you substitute another PIC for it in
the #include file statement, in the hope that it would work ?

Also, what version of PCW do you have ?
Greg



Joined: 24 Dec 2003
Posts: 7

View user's profile Send private message

Greg-
PostPosted: Sun Dec 28, 2003 4:30 pm     Reply with quote

Well at the top of the lst file i have this:
Quote:

CCS PCM C Compiler, Version 3.177d, 15332

Filename: c:\documents and settings\greg\my documents\work\source\main.LST

ROM used: 1718 (84%)
Largest free fragment is 330
RAM used: 102 (58%) at main() level
111 (63%) worst case
Stack: 4 locations

the compiler does support this chip and the compiler automatically inserted the #include <16F877.h> when i told it i wanted to use a 16F877 chip. I am sure i am doign something rather silly that isnt allowing me to use more than page0 of the program rom.
Thanks again
Greg
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Dec 28, 2003 4:46 pm     Reply with quote

OK. Finally we get the whole story. Smile

You're using the Demo version.
CCS PCM C Compiler, Version 3.177d, 15332

It has a 2k limit on code size, per the CCS Demo page,
in the section on "About the Demo":
http://www.ccsinfo.com/demo.shtml
Greg



Joined: 24 Dec 2003
Posts: 7

View user's profile Send private message

Greg-
PostPosted: Sun Dec 28, 2003 5:57 pm     Reply with quote

Well, i told you i was probably doing something silly ;)
Thanks for all your help!!
Greg
gramya8712
Guest







PostPosted: Mon Nov 12, 2007 2:47 pm     Reply with quote

Hi even i have exactly the same problem of "out of ROM memory"
can any one give suggestions how to correct it and also how to divide the program into different pages??

thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 12, 2007 3:04 pm     Reply with quote

This thread gives an example of breaking up one large function into
two smaller functions to solve the "out of rom" problem:
http://www.ccsinfo.com/forum/viewtopic.php?t=26793&start=8
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