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

problem with CCS out of memory

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



Joined: 01 Feb 2005
Posts: 21
Location: Paris

View user's profile Send private message

problem with CCS out of memory
PostPosted: Wed Mar 30, 2005 6:44 am     Reply with quote

Hello,

i'am using CCS compiler 3.28, to program a PIC 16LF877A, in my software, i have 3 subroutines, and i want to add a calculation section.
Without this section, my program use 83% of the ROM memory.

If i add this section in the Main, the compiler says "out of ROM memory".
If i try to add this section in a subroutine, with two of them, the compiler compile the HEX file, but the program doesn't work.
It only works when i put the section in the last subroutine, but the program seems to run slowly.

So, i want to know, if there is something to configurate to use all the memory of the PIC.

Thanks for your help.
Bruno
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Wed Mar 30, 2005 7:39 am     Reply with quote

Break the larger functions into smaller ones. This allows the compiler to better fit the code in the memory pages. You can also add the #separate to functions that are only called once to force the compiler to make these actual functions, otherwise, the compiler might optimize them and put them inline.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Mar 30, 2005 7:42 am     Reply with quote

Quote:

i'am using CCS compiler 3.28, to program a PIC 16LF877A, in my software, i have 3 subroutines


Hola Bruno:

1) CCS compiler 3.28 is not a valid version.

2)16LF877A has a 8K memory, if you only have 3 subroutines and
with this you reach 83% of memory, I can guess that your main()
is too big.

3)Divide and conquer! Try to divide the main() and generate new
routines to help the compiler to locate the code in memory slicing them in
small blocks.

Best wishes,

Humberto
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Mar 30, 2005 9:14 am     Reply with quote

I wonder if he has device *=16 in his header?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Wed Mar 30, 2005 9:24 am     Reply with quote

He is out of ROM.
global



Joined: 01 Feb 2005
Posts: 21
Location: Paris

View user's profile Send private message

PostPosted: Wed Mar 30, 2005 9:29 am     Reply with quote

Hello,
Sorry my version of CCS is 3.150, i use device *=16 in my header, the Main of my program is only composed of call function, the 83% is all the program.
I forgot to mention that i also use 2 interruptions.
Thanks for your help
Bruno
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Mar 30, 2005 11:19 am     Reply with quote

Quote:
He is out of ROM


Yeah, I caught the fact he was out of ROM but I was wondering about the other...
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