|
|
View previous topic :: View next topic |
Author |
Message |
luismramirez
Joined: 17 Feb 2011 Posts: 8
|
#SEPARATE problem |
Posted: Thu Feb 17, 2011 9:50 am |
|
|
Hi,
I'm getting the OUT OF ROM problem, so, I tried the #SEPARATE command, however, I get this error when compiling:
Quote: |
*** Error 51 "main.c" Line 72(0,1): A numeric expression must appear here
|
I searched for an answer but didn't found anything likewise.
Code: |
void main(){
lcd_init(); //Initites LCD
setup_adc(ADC_CLOCK_INTERNAL);
setup_adc_ports(AN0_AN1_VSS_VREF); //2 PORTS, VREF+
ENABLE_INTERRUPTS(GLOBAL);
ENABLE_INTERRUPTS(INT_EXT);
EXT_INT_EDGE(L_TO_H);
output_low(K_R1);
output_low(K_R2);
output_low(K_R3);
output_low(K_R4);
lcd_splash(); //Splash screen
lcd_previewProgram();
#SEPARATE
hotstart();
}
|
The OUT OF ROM error:
Quote: |
*** Error 71 "main.c" Line 75(0,1): Out of ROM, A segment or the program is too large hotstart
Seg 01800-01FFF, 01FA left, need 026E
Seg 00000-00003, 0000 left, need 026E
Seg 00004-00039, 0000 left, need 026E
Seg 0003A-007FF, 0035 left, need 026E
Seg 00800-00FFF, 00E8 left, need 026E
Seg 01000-017FF, 00E4 left, need 026E
|
PIC16F877A, MPLAB IDE v8.60
I don't know my version of CCS C, I know it is 4.X
Any help would be appreciated!
Thanks! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Thu Feb 17, 2011 10:32 am |
|
|
You don't use #SEPARATE like that.....
You put it in front of the _declaration_ of the routine (and any prototypes).
Best Wishes |
|
|
luismramirez
Joined: 17 Feb 2011 Posts: 8
|
|
Posted: Thu Feb 17, 2011 10:34 am |
|
|
Hi,
thanks for the response.
So I should use it like this?
Code: |
#SEPARATE
void hotstart()....
|
Because, even like that, i get the same error of OUT OF ROM
Help![/code] |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Thu Feb 17, 2011 10:54 am |
|
|
Yes.
However you need to separate lots of your routines, not just this one.
You need to reduce the 'lump sizes' of all of your routines, to allow the compiler to juggle things. It is going to be pretty borderline though. There is potentially _just_ enough space, and the more you can split things up, the better the chances are that it can be juggled to fit.
Best Wishes |
|
|
luismramirez
Joined: 17 Feb 2011 Posts: 8
|
|
Posted: Thu Feb 17, 2011 11:08 am |
|
|
Yes, thanks!
I put #SEPARATE in many functions and it worked, but the rom jumped from 38% to 93%
Do i need to put #separate on various functions, before the definition, or all the functions after a #Separate are affected, or just the first one after it?
Thanks! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Thu Feb 17, 2011 3:29 pm |
|
|
luismramirez wrote: | Yes, thanks!
I put #SEPARATE in many functions and it worked, but the rom jumped from 38% to 93%
Do i need to put #separate on various functions, before the definition, or all the functions after a #Separate are affected, or just the first one after it?
Thanks! |
Er. The ROM, was nearly at that level before you used #separate. That was why it didn't fit....
Look at the table from the error message:
Quote: |
*** Error 71 "main.c" Line 75(0,1): Out of ROM, A segment or the program is too large hotstart
Seg 01800-01FFF, 01FA left, need 026E
Seg 00000-00003, 0000 left, need 026E
Seg 00004-00039, 0000 left, need 026E
Seg 0003A-007FF, 0035 left, need 026E
Seg 00800-00FFF, 00E8 left, need 026E
Seg 01000-017FF, 00E4 left, need 026E
|
Now, add up the free space left:
01FA, 0035, 00E8, 00E4 = 3FB
Routine to fit = 026E
So once this is in place, with nothing else changed, you would have just 018D words of ROM left, from a total of 1800. 85% used. This was why I said it was borderline to get it all in.
#SEPARATE, can result in some stuff getting larger (PCM programmer has posted a link about this), _but_ it allows the stuff to be treated as smaller pieces, and juggled to fit. The extra size though, was only about 7 to 8%, not the jump from 38% to 93%. Most of this was caused by whatever code it was you added after it was compiling OK.....
Best Wishes |
|
|
|
|
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
|