Carl Denk wrote: > I have an 18F1320 with a C18 program and MPLAB (latest version). The > program has been running fine for several years, and recently I wanted > to add software averaging/filtering to the 3 ADC inputs, which included > declaring 3 int extern arrays [10]. Apparently I was just under the > maximum data locations. The memory gauge shows 1683/4096 program and > 152/256 data before any changes. It would seem that 256 - 152 = 104 > would be sufficient, but even declaring one additional "int a[10]" array > creates the ".udata_c018i.o' can not fit the section. Section > '.udata_c018i.o' length=0x0000000a" error. I had been assuming that the > memory usage gauge reflected the actual memory used, including those > locations added by the compiling/assembling process, but after reviewing > the map file, that does not appear to be the case. I thought the gauge > info was generated at link time, and should include all the memory used. > Is this a MPLAB error? > > I looked, but didn't find a replacement for the 18F1320 with more data > memory, does anyone know of one? I use 3 ADC and the UART. Speed isn't a > priority. Fitting the existing 18Dip is. I am going to study my code to > see if I can optimize the memory usage, but doubt I can free up enough > to do the job. I do put several initialized constants in code already. > > Check the linker file for the sizes of the declared memory segments.... Common things I get wrong are things like using the 'debug' linker file instead of the 'real' one. The linker declares various memory areas, and the memory declarations of your program have to fit in to one memory segment. Changing your linker script will likely resolve your problem... Rolf -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist