Carl Denk escreveu: > 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 =3D 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=3D0x0000000a" 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. > = The problem may be with your linker script. The original linker scrips declare the RAM memory as being split into 256 bytes data banks. If any data section grows larger than 256 bytes then it won't fit into any declared data bank. You may modify the linker script to join some data banks (bring up some problems though), or declare some variables in a new source file, because the C18 will put them in a different data section. Regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist