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

anybody know why in the .lst file say free fragment is 2048

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



Joined: 09 Feb 2007
Posts: 3

View user's profile Send private message

anybody know why in the .lst file say free fragment is 2048
PostPosted: Fri Feb 09, 2007 12:01 pm     Reply with quote

My ccs compiler is a pcm soft for windows (command line).
this program is not a version demo.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 09, 2007 12:14 pm     Reply with quote

Look in the data sheet for the 16F877, in section 2.0 on Memory
Organization. Look at this chart:
FIGURE 2-1: PIC16F877/876 PROGRAM MEMORY MAP AND STACK

You'll see that the Program Memory is divided into four pages.
Each one is 2048 words in size.

For the CCS compiler, a function must be contained within a single
page of Program Memory. It can't span across two or more pages.
The compiler reports the remaining free space in terms of ROM pages.
When it says you have 2048 words of free space, it means there is
an entire ROM page that is free. If you want to add features to your
program in the future, you have some ROM space left to do so.
Guest








THANKS
PostPosted: Mon Feb 12, 2007 7:54 am     Reply with quote

my function main has more than 2048 words. so that it works would have to separate it in more small functions and to try with #SEPARATE and #INLINE to obtain blocks of 2048 words? I suppose that when has the three occupied blocks, it will not leave the message “free fragment is 2048”
juasan



Joined: 09 Feb 2007
Posts: 3

View user's profile Send private message

the guest who has written the previous message I am I
PostPosted: Mon Feb 12, 2007 8:00 am     Reply with quote

the guest who has written the previous message I am I
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 12, 2007 3:21 pm     Reply with quote

Quote:

My function main has more than 2048 words. So that it works would I
have to separate it in more small functions and to try with #SEPARATE
and #INLINE to obtain blocks of 2048 words?

If the compiler gives an error message, and says that a "Segment is
too large", then you need to break up the single main() function into
a few smaller functions that are called from main().

The compiler should then be able to place the smaller functions in other
ROM segments. If the compiler still has a problem doing this, then it
will give an error message. Then you can try to fix the problem by
using #separate.
Guest








thanks
PostPosted: Mon Feb 12, 2007 3:58 pm     Reply with quote

in my source code I have 15 functions and the main function.
in the tree file say I have functions on page 0, on page 1 and on page 2.
it is the first time that I make a program so long. 80% rom 16f876
I try with #separate and it compile but not works.
can be by the pages of codes?
in the lst file say 4 worst case in main an 1 in interrupt, and continuous saying "largest free fragment is 2048".
What is a fragment?
Sorry, and very thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 12, 2007 4:04 pm     Reply with quote

Quote:

In the lst file say 4 worst case in main an 1 in interrupt, and
continuous saying "largest free fragment is 2048".

The stack usage is OK. It's within the limit of 8 stack levels
for the 16F876, so there is no problem.

The "free fragment" just means the largest available block
of ROM that is unused. So for the 16F876, it means an
entire ROM page of 2048 words is unused, and is available.


Quote:
I try with #separate and it compile but not works.

There may be a bug in your program. You need to test the
program and find the error in your code. It's a coding problem
or a program design problem. I don't think it's a compiler problem.
Guest








thanks for all
PostPosted: Mon Feb 12, 2007 4:12 pm     Reply with quote

I going to try with my code.
juasan



Joined: 09 Feb 2007
Posts: 3

View user's profile Send private message

my problem is
PostPosted: Thu Feb 15, 2007 10:43 am     Reply with quote

if I compile and appears that I have used less than 2048 words it works but it appears that I have used but no, works bad.
then it is what it makes me think if is the license, but this just bought and updated with the PCM command line.
before I have the version demonstration can that has something to see with the installation.
the variation of but to less than 2048 is commenting some case of one switch.
for that reason I believe that the problem not is in my code.
I have code in the pages 0 and 1.
in the page 1 is the main function and is 750 words
in the page 0 are seven functions and are 1500 words
What can limit compiling over 2048 words if i have the license?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 15, 2007 11:49 am     Reply with quote

Here are some instructions to uninstall the PCWH demo and install
the PCM command line compiler.
http://www.ccsinfo.com/forum/viewtopic.php?t=23835
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