View previous topic :: View next topic |
Author |
Message |
Aurbo
Joined: 07 Apr 2008 Posts: 49
|
Compile message |
Posted: Tue Sep 30, 2008 6:29 pm |
|
|
On compiling (v4.069), Compiler output reports
"Memory Usage: ROM=99% RAM=19%-32%"
0 Errors, 0 Warnings
Normally the code compiles at ROM=72% RAM=19%-26%
I've added a single line,
Code: |
Temp16=Temp16*1.8+32; // conversion from `C to `F
|
and this take it to 99%
What does it mean? I've reach the limit of this particular pic and need to migrate to a larger one? |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
yup thats probably right |
Posted: Tue Sep 30, 2008 9:18 pm |
|
|
you don't say which pic part - but i'm guessing midrange to bitty-
and that
if this is the first time you used a floating point operation in your prog - or your compiled memory tree overflowed the PIC page distribution you had -
it could be quite real and neccesary |
|
![](templates/subSilver/images/spacer.gif) |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Wed Oct 01, 2008 8:16 am |
|
|
You could try one of these:
Code: | Temp16=((Temp16*18)/10)+32; // conversion from `C to `F
Temp16=((Temp16*9)/5)+32; // conversion from `C to `F | Make sure it doesn't overflow and gives the resolution you need. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
![](templates/subSilver/images/spacer.gif) |
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Wed Oct 01, 2008 8:16 am |
|
|
If that is the only floating point you have in your code, then: Code: | Temp16=Temp16*9/5+32; | avoids the use of floating point. _________________ Andrew |
|
![](templates/subSilver/images/spacer.gif) |
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Wed Oct 01, 2008 1:19 pm |
|
|
One thing that might be happening is the fact that the PIC's memory is organized into 'pages'. Each page can only hold so much code. If this last bit of code filled up the page that contains it then you will get that message even if you still have room in the other pages for more code.
One way of avoiding this is to avoid placing all of your code in main() and create functions to contain some of the code. This way the compiler can shift the functions around and get the most use of the PIC's memory.
Ronald |
|
![](templates/subSilver/images/spacer.gif) |
Aurbo
Joined: 07 Apr 2008 Posts: 49
|
|
Posted: Wed Oct 01, 2008 1:50 pm |
|
|
Thanks everyone
The Pic in question is a 16F628A
Code: |
Temp16=((Temp16*9)/5)+32; // conversion from `C to `F
|
Is working and reduced the % back down to 73%
rnielson, can you tell me a bit more about pages please. |
|
![](templates/subSilver/images/spacer.gif) |
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
![](templates/subSilver/images/spacer.gif) |
|