MPLAB error segment

Hi…I’m currently using MPLAB to program pic. I’ve managed to correct the errors except when this error comes up instead…:ahh:

Error [1347] ; 0. can’t find 0x90 words (0x90 withtotal) for psect “text76” in segment “CODE” (largest unused contiguous range 0x31)

I do not even know where to start? Anyone knows? Thanks!

sounds like you have too many variables, or are using too much space in the EEPROM.

look to see where you are defining that variable, (or including the file that does) and see if you can remove it temporarily.

You may also consider reducing the size of any arrays or strings you are using that are taking more than absolutely needed.

Reminds me of my FIRST days, programming in PBASIC. We only had 26 BYTES of general purpose RAM for variables. I will admit to storing bit flags in extra direction registers and unused pins…

i was thinking of the variables sizes are over the limit too…but i have no idea how to reduce it. haa…

hmmm…is there a pro version at internet without evaluation period? hee…

If you have a “variable” that doesn’t change (e.g. a text string), it can be placed in ROM instead of the CODE segment by using the rom keyword at the beginning of the variable declaration.

what if its array instead of a text string? for example:


int delay_addr]= {9000,4500,560,560,560,1690,560,1690,560,560,560,560,560,560,560,560,560,1690,560,1690,2250,560,560,560,1690,560,560,560,1690,560,1690,560,560};	//0x61d6
int delay_cmd1]= {560,560,1690, 560,1690,560, 560,560,1690, 560,560,1690, 560,1690,560, 560,560,1690, 560,560,1690, 560,560,1690};	//0x48
int delay_cmd2]= {560,560,1690, 560,1690,560, 560,1690,560, 560,1690,560, 560,1690,560, 560,560,560,  560,560,560, 560,560,560};	//0x78
int delay_cmd3]= {560,560,1690, 560,1690,560, 560,560,1690, 560,1690,560, 560,1690,560, 560,560,560,  560,560,560, 560,560,560};	//0x58
int delay_cmd4]= {560,1690,560, 560,560,1690, 560,1690,560, 560,560,1690, 560,560,1690, 560,560,1690, 560,560,1690, 560,560,1690};	//0xA0

Lookup tables are actually the most common thing I’ve seen placed in ROM. Joystick value mapping and trig function arrays (sine, arctangent, etc.) are typical.

rom const int delay_addr]= {9000,4500,560,560,560,1690,560,1690,560,560,560,560,560,560,560,560,560,1690,560,1690,2250,560,560,560,1690,560,560,560,1690,560,1690,560,560};	//0x61d6

But i get these errors when i change the code as above.
Warning [374] C:\Documents and Settings\admin\Desktop\ZD\main.c; 33.5 missing basic type; int assumed
Error [314] C:\Documents and Settings\admin\Desktop\ZD\main.c; 33.5 “;” expected

Btw, i put the above code outside void main (void). Because when i put it inside, there are more errors.