Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   MPLAB error segment (http://www.chiefdelphi.com/forums/showthread.php?t=75747)

skiz 12-03-2009 01:58

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!

engunneer 12-03-2009 02:19

Re: MPLAB error segment
 
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...

skiz 12-03-2009 03:27

Re: MPLAB error segment
 
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..

Alan Anderson 12-03-2009 07:49

Re: MPLAB error segment
 
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.

skiz 15-03-2009 22:01

Re: MPLAB error segment
 
what if its array instead of a text string? for example:
Code:

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


Alan Anderson 16-03-2009 08:00

Re: MPLAB error segment
 
Quote:

Originally Posted by skiz (Post 836459)
what if its array instead of a text string?

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.

Code:

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

skiz 16-03-2009 20:42

Re: MPLAB error segment
 
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.


All times are GMT -5. The time now is 01:08.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi