|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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..
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! |
|
#2
|
||||
|
||||
|
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... |
|
#3
|
|||
|
|||
|
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.. |
|
#4
|
|||||
|
|||||
|
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.
|
|
#5
|
|||
|
|||
|
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
|
|
#6
|
|||||
|
|||||
|
Re: MPLAB error segment
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
|
|
#7
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Generic error in MPLAB | domoarigato | Programming | 11 | 01-12-2008 14:21 |
| MPLAB build error | cabbagekid2 | Programming | 7 | 12-01-2005 13:36 |
| MPLAB IDE 6.60 Error | mchan1111 | Programming | 8 | 08-11-2004 20:17 |
| MPlab error | ryan_f | Programming | 9 | 24-05-2004 07:30 |
| Mplab startup error | Team 869 | Programming | 6 | 25-01-2004 10:41 |