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

Compile message

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



Joined: 07 Apr 2008
Posts: 49

View user's profile Send private message

Compile message
PostPosted: Tue Sep 30, 2008 6:29 pm     Reply with quote

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?
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

yup thats probably right
PostPosted: Tue Sep 30, 2008 9:18 pm     Reply with quote

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
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Oct 01, 2008 8:16 am     Reply with quote

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.
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Wed Oct 01, 2008 8:16 am     Reply with quote

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
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed Oct 01, 2008 1:19 pm     Reply with quote

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
Aurbo



Joined: 07 Apr 2008
Posts: 49

View user's profile Send private message

PostPosted: Wed Oct 01, 2008 1:50 pm     Reply with quote

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.
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Oct 02, 2008 8:35 am     Reply with quote

Take a look at this post http://www.ccsinfo.com/forum/viewtopic.php?t=30167

Ronald
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