View previous topic :: View next topic |
Author |
Message |
juasan
Joined: 09 Feb 2007 Posts: 3
|
anybody know why in the .lst file say free fragment is 2048 |
Posted: Fri Feb 09, 2007 12:01 pm |
|
|
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
|
|
Posted: Fri Feb 09, 2007 12:14 pm |
|
|
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 |
Posted: Mon Feb 12, 2007 7:54 am |
|
|
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
|
the guest who has written the previous message I am I |
Posted: Mon Feb 12, 2007 8:00 am |
|
|
the guest who has written the previous message I am I |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 12, 2007 3:21 pm |
|
|
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 |
Posted: Mon Feb 12, 2007 3:58 pm |
|
|
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
|
|
Posted: Mon Feb 12, 2007 4:04 pm |
|
|
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 |
Posted: Mon Feb 12, 2007 4:12 pm |
|
|
I going to try with my code. |
|
|
juasan
Joined: 09 Feb 2007 Posts: 3
|
my problem is |
Posted: Thu Feb 15, 2007 10:43 am |
|
|
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
|
|
|
|