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 CCS Technical Support

How to determine if a function exceeds a page limit ??

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



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

How to determine if a function exceeds a page limit ??
PostPosted: Fri Aug 04, 2006 3:30 am     Reply with quote

Hi,

How can one determine whether a function exceeds the page limt ??

thanks
arunb
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri Aug 04, 2006 8:19 am     Reply with quote

Well, I check it out by clicking on the compile button and if I get an error message that I'm out of memory then I know that something was too big. Very Happy

Ronald
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Fri Aug 04, 2006 9:35 am     Reply with quote

Quote:


Well, I check it out by clicking on the compile button and if I get an error message that I'm out of memory then I know that something was too big


I was refering to the size of a function and not the program size (if the program exceeds the ROM size , then 'Out of ROM ' error occurs)

When a function becomes very large , the mcu starts to go haywire, one way to check this out is to run the mcu, but I think there should be another way....

thanks
arunb
[/code]
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri Aug 04, 2006 10:59 am     Reply with quote

The PIC should run just fine regardless of the size of the routines you call. If any of the routines are to large to fit into a page then the compiler will tell you, otherwise they should work just fine. I've had routines that barely squeeze into a page. I'm not sure what might be going on. Maybe check your LST file and see what the stats are for Stack. Too many and you'll choke.

Ronald
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Fri Aug 04, 2006 11:05 am     Reply with quote

Hi,

PCM 3.228
MCU:16F877A

Thank you for the reply.

The stack looks OK (less than 7)

Here is an extract of the .LST file, coould you tell me what is wrong with this

Quote:

CCS PCM C Compiler, Version 3.228, 16542 02-Aug-06 21:03

Filename: CLG004Main-v2.LST

ROM used: 2121 words (26%)
Largest free fragment is 2048
RAM used: 61 (35%) at main() level
71 (41%) worst case
Stack: 5 worst case (3 in main + 2 for interrupts)



I find that whenver then ROM used is more than Largest free fragment, the mcu goes haywire, as in this case.

Kindly advise ...

thanks
arunb
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