View previous topic :: View next topic |
Author |
Message |
franckcl
Joined: 12 Sep 2003 Posts: 32 Location: France (Paris)
|
"ROM Used" in .LST strange result ? |
Posted: Tue Jan 27, 2004 10:22 am |
|
|
Hello,
Using CCS v3.184
I have compiled my program for a PIC18F6520 (ROM 32K bytes)
here is the .LST file header :
ROM used: 30818 (96%)
Largest free fragment is 1118
RAM used: 1572 (77%) at main() level
1654 (81%) worst case
Stack: 18 worst case (15 in main + 3 for interrupts)
Now I compile it for a PIC18F6720 (ROM 128K bytes, that means 4 times more)
ROM used: 30926 (12%)
Largest free fragment is 0
RAM used: 1571 (41%) at main() level
1653 (43%) worst case
Stack: 18 worst case (15 in main + 3 for interrupts)
1) Why there is 12% and not 24% of ROM used because there are 4 times more ROM.
2) Why Largest free fragment is 0
Thank you
Franck |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jan 27, 2004 12:01 pm |
|
|
I don't have that exact version. I tested the following program
with PCH vs. 3.173 and 3.178, and when I compiled it for each
PIC chip, it gave a ROM usage in the .LST file, of 4x more for
the 18F6520. So it works OK with those versions.
Is it possible that there could be an error in the DEVICES.DAT file ?
Do you have PCWH ? If so, you can use the Device Editor
to see if there is a problem with the specified ROM size.
See this link for a screen shot of the Device Editor (click on the image).
http://www.ccsinfo.com/pcwide.shtml#device
//#include <18F6720.H> // 24 % (ROM used = 30818)
#include <18F6520.H> // 94% (ROM used = 30818)
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
void main()
{
float a, b, c;
// Copy the following line, so there are 303 lines
// like this. Then compile. Rom usage will be 30818.
a = b * c + 123.456 / 345.678 % 789.123;
while(1);
} |
|
|
franckcl
Joined: 12 Sep 2003 Posts: 32 Location: France (Paris)
|
|
Posted: Wed Jan 28, 2004 2:34 am |
|
|
I have found where is the problem !!!
In your source, just after "#include <18F6720.h>" try to add this line :
#device ICD=TRUE
and see the difference of the "ROM USED" !!!!!!!!
Franck |
|
|
|