View previous topic :: View next topic |
Author |
Message |
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
problem with CCS out of memory |
Posted: Wed Mar 30, 2005 6:44 am |
|
|
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
|
|
Posted: Wed Mar 30, 2005 7:39 am |
|
|
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
|
|
Posted: Wed Mar 30, 2005 7:42 am |
|
|
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
|
|
Posted: Wed Mar 30, 2005 9:14 am |
|
|
I wonder if he has device *=16 in his header? |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Mar 30, 2005 9:24 am |
|
|
He is out of ROM. |
|
|
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
|
Posted: Wed Mar 30, 2005 9:29 am |
|
|
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
|
|
Posted: Wed Mar 30, 2005 11:19 am |
|
|
Yeah, I caught the fact he was out of ROM but I was wondering about the other... |
|
|
|