Yes, the map file does show, that there is empty areas, my problem is getting the compiler/linker to use them. As you can see, from 0x1b to 0xc0 there is space, but if I add more than 2 bytes of declaration, the error is not enough space. Here's excerpts for the LKR file, Debug = OFF ACCESSBANK NAME=accessram START=0x0 END=0x7F #IFDEF _DEBUGDATASTART DATABANK NAME=gpr0 START=0x80 END=_DATAEND DATABANK NAME=dbgspr START=_DEBUGDATASTART END=_DEND PROTECTED #ELSE //no debug DATABANK NAME=gpr0 START=0x80 END=0xFF #FI ACCESSBANK NAME=accesssfr START=0xF80 END=0xFFF PROTECTED #DEFINE _SPECIALSIZE 0x40 - _DEBUGDATALEN #DEFINE _STACKSIZE _SPECIALSIZE / 2 #IFDEF _CRUNTIME SECTION NAME=CONFIG ROM=config #IFDEF _DEBUGDATASTART STACK SIZE=_STACKSIZE RAM=gpr0 #ELSE STACK SIZE=0x40 RAM=gpr0 #FI #FI Here's excerpts from a good make MAP: 3366 out of 8472 program addresses used, program memory utilization is 39% SIGN 0x000000 data extern C:\MCC18\src\traditional\math\cmath18.asm __FPFLAGSbits 0x000001 data extern C:\MCC18\src\traditional\math\cmath18.asm __FPFLAGS 0x000001 data extern C:\MCC18\src\traditional\math\cmath18.asm __REMB3 0x000002 data extern C:\MCC18\src\traditional\math\aarg.asm __AARGB7 0x000002 data extern C:\MCC18\src\traditional\math\aarg.asm __REMB2 0x000003 data extern C:\MCC18\src\traditional\math\aarg.asm __AARGB6 0x000003 data extern C:\MCC18\src\traditional\math\aarg.asm __REMB1 0x000004 data extern C:\MCC18\src\traditional\math\aarg.asm __AARGB5 0x000004 data extern C:\MCC18\src\traditional\math\aarg.asm __AARGB4 0x000005 data extern C:\MCC18\src\traditional\math\aarg.asm __REMB0 0x000005 data extern C:\MCC18\src\traditional\math\aarg.asm __AARGB3 0x000006 data extern C:\MCC18\src\traditional\math\aarg.asm __AARGB2 0x000007 data extern C:\MCC18\src\traditional\math\aarg.asm __AARGB1 0x000008 data extern C:\MCC18\src\traditional\math\aarg.asm __AARGB0 0x000009 data extern C:\MCC18\src\traditional\math\aarg.asm __AEXP 0x00000a data extern C:\MCC18\src\traditional\math\aarg.asm __BARGB3 0x00000b data extern C:\MCC18\src\traditional\math\barg.asm __BARGB2 0x00000c data extern C:\MCC18\src\traditional\math\barg.asm __BARGB1 0x00000d data extern C:\MCC18\src\traditional\math\barg.asm __BARGB0 0x00000e data extern C:\MCC18\src\traditional\math\barg.asm __BEXP 0x00000f data extern C:\MCC18\src\traditional\math\barg.asm __TEMPB3 0x000010 data extern C:\MCC18\src\traditional\math\temparg.asm __TEMPB2 0x000011 data extern C:\MCC18\src\traditional\math\temparg.asm __TEMPB1 0x000012 data extern C:\MCC18\src\traditional\math\temparg.asm __TEMP 0x000013 data extern C:\MCC18\src\traditional\math\temparg.asm __TEMPB0 0x000013 data extern C:\MCC18\src\traditional\math\temparg.asm __tmp_0 0x000014 data static D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C __tmp_0 0x000014 data static C:\MCC18\src\pmc_common\USART\uopen.c __tmp_0 0x000014 data static C:\MCC18\src\pmc_common\Timers\t1read.c __tmp_1 0x00001b data static D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C c 0x0000c0 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C ReadArray 0x0000c1 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C pReadArray 0x0000d9 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C read_index 0x0000db data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C w 0x0000dc data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C start_character 0x0000de data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C adc_data 0x0000df data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C padc_data 0x0000e5 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C w_temp 0x0000e7 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C status_temp 0x0000e8 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C bsr_temp 0x0000e9 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C fcs_low 0x0000ea data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C fcs_high 0x0000eb data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C prom 0x0000ec data static C:\MCC18\src\traditional\startup\c018i.c curr_byte 0x0000ef data static C:\MCC18\src\traditional\startup\c018i.c curr_entry 0x0000f1 data static C:\MCC18\src\traditional\startup\c018i.c data_ptr 0x0000f3 data static C:\MCC18\src\traditional\startup\c018i.c check_char 0x0000f6 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C watchdog_flag 0x0000f7 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C punit_id 0x0000f8 data extern D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C PORTAbits 0x000f80 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PORTA 0x000f80 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PORTB 0x000f81 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PORTBbits 0x000f81 data extern C:\MCC18\src\traditional\proc\p18F1320.asm LATA 0x000f89 data extern C:\MCC18\src\traditional\proc\p18F1320.asm LATAbits 0x000f89 data extern C:\MCC18\src\traditional\proc\p18F1320.asm LATB 0x000f8a data extern C:\MCC18\src\traditional\proc\p18F1320.asm LATBbits 0x000f8a data extern C:\MCC18\src\traditional\proc\p18F1320.asm DDRAbits 0x000f92 data extern C:\MCC18\src\traditional\proc\p18F1320.asm DDRA 0x000f92 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TRISA 0x000f92 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TRISAbits 0x000f92 data extern C:\MCC18\src\traditional\proc\p18F1320.asm DDRBbits 0x000f93 data extern C:\MCC18\src\traditional\proc\p18F1320.asm DDRB 0x000f93 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TRISB 0x000f93 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TRISBbits 0x000f93 data extern C:\MCC18\src\traditional\proc\p18F1320.asm OSCTUNE 0x000f9b data extern C:\MCC18\src\traditional\proc\p18F1320.asm OSCTUNEbits 0x000f9b data extern C:\MCC18\src\traditional\proc\p18F1320.asm PIE1 0x000f9d data extern C:\MCC18\src\traditional\proc\p18F1320.asm PIE1bits 0x000f9d data extern C:\MCC18\src\traditional\proc\p18F1320.asm PIR1 0x000f9e data extern C:\MCC18\src\traditional\proc\p18F1320.asm PIR1bits 0x000f9e data extern C:\MCC18\src\traditional\proc\p18F1320.asm IPR1 0x000f9f data extern C:\MCC18\src\traditional\proc\p18F1320.asm IPR1bits 0x000f9f data extern C:\MCC18\src\traditional\proc\p18F1320.asm PIE2 0x000fa0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PIE2bits 0x000fa0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PIR2 0x000fa1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PIR2bits 0x000fa1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm IPR2 0x000fa2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm IPR2bits 0x000fa2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm EECON1 0x000fa6 data extern C:\MCC18\src\traditional\proc\p18F1320.asm EECON1bits 0x000fa6 data extern C:\MCC18\src\traditional\proc\p18F1320.asm EECON2 0x000fa7 data extern C:\MCC18\src\traditional\proc\p18F1320.asm EEDATA 0x000fa8 data extern C:\MCC18\src\traditional\proc\p18F1320.asm EEADR 0x000fa9 data extern C:\MCC18\src\traditional\proc\p18F1320.asm BAUDCTLbits 0x000faa data extern C:\MCC18\src\traditional\proc\p18F1320.asm BAUDCTL 0x000faa data extern C:\MCC18\src\traditional\proc\p18F1320.asm RCSTA 0x000fab data extern C:\MCC18\src\traditional\proc\p18F1320.asm RCSTAbits 0x000fab data extern C:\MCC18\src\traditional\proc\p18F1320.asm TXSTA 0x000fac data extern C:\MCC18\src\traditional\proc\p18F1320.asm TXSTAbits 0x000fac data extern C:\MCC18\src\traditional\proc\p18F1320.asm TXREG 0x000fad data extern C:\MCC18\src\traditional\proc\p18F1320.asm RCREG 0x000fae data extern C:\MCC18\src\traditional\proc\p18F1320.asm SPBRG 0x000faf data extern C:\MCC18\src\traditional\proc\p18F1320.asm SPBRGH 0x000fb0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm T3CONbits 0x000fb1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm T3CON 0x000fb1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TMR3L 0x000fb2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TMR3H 0x000fb3 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ECCPASbits 0x000fb6 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ECCPAS 0x000fb6 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PWM1CONbits 0x000fb7 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PWM1CON 0x000fb7 data extern C:\MCC18\src\traditional\proc\p18F1320.asm CCP1CON 0x000fbd data extern C:\MCC18\src\traditional\proc\p18F1320.asm CCP1CONbits 0x000fbd data extern C:\MCC18\src\traditional\proc\p18F1320.asm CCPR1 0x000fbe data extern C:\MCC18\src\traditional\proc\p18F1320.asm CCPR1L 0x000fbe data extern C:\MCC18\src\traditional\proc\p18F1320.asm CCPR1H 0x000fbf data extern C:\MCC18\src\traditional\proc\p18F1320.asm ADCON2 0x000fc0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ADCON2bits 0x000fc0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ADCON1 0x000fc1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ADCON1bits 0x000fc1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ADCON0 0x000fc2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ADCON0bits 0x000fc2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ADRES 0x000fc3 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ADRESL 0x000fc3 data extern C:\MCC18\src\traditional\proc\p18F1320.asm ADRESH 0x000fc4 data extern C:\MCC18\src\traditional\proc\p18F1320.asm T2CONbits 0x000fca data extern C:\MCC18\src\traditional\proc\p18F1320.asm T2CON 0x000fca data extern C:\MCC18\src\traditional\proc\p18F1320.asm PR2 0x000fcb data extern C:\MCC18\src\traditional\proc\p18F1320.asm TMR2 0x000fcc data extern C:\MCC18\src\traditional\proc\p18F1320.asm T1CON 0x000fcd data extern C:\MCC18\src\traditional\proc\p18F1320.asm T1CONbits 0x000fcd data extern C:\MCC18\src\traditional\proc\p18F1320.asm TMR1L 0x000fce data extern C:\MCC18\src\traditional\proc\p18F1320.asm TMR1H 0x000fcf data extern C:\MCC18\src\traditional\proc\p18F1320.asm RCONbits 0x000fd0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm RCON 0x000fd0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm WDTCON 0x000fd1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm WDTCONbits 0x000fd1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm LVDCON 0x000fd2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm LVDCONbits 0x000fd2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm OSCCON 0x000fd3 data extern C:\MCC18\src\traditional\proc\p18F1320.asm OSCCONbits 0x000fd3 data extern C:\MCC18\src\traditional\proc\p18F1320.asm T0CON 0x000fd5 data extern C:\MCC18\src\traditional\proc\p18F1320.asm T0CONbits 0x000fd5 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TMR0L 0x000fd6 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TMR0H 0x000fd7 data extern C:\MCC18\src\traditional\proc\p18F1320.asm STATUS 0x000fd8 data extern C:\MCC18\src\traditional\proc\p18F1320.asm STATUSbits 0x000fd8 data extern C:\MCC18\src\traditional\proc\p18F1320.asm FSR2L 0x000fd9 data extern C:\MCC18\src\traditional\proc\p18F1320.asm FSR2 0x000fd9 data extern C:\MCC18\src\traditional\proc\p18F1320.asm FSR2H 0x000fda data extern C:\MCC18\src\traditional\proc\p18F1320.asm PLUSW2 0x000fdb data extern C:\MCC18\src\traditional\proc\p18F1320.asm PREINC2 0x000fdc data extern C:\MCC18\src\traditional\proc\p18F1320.asm POSTDEC2 0x000fdd data extern C:\MCC18\src\traditional\proc\p18F1320.asm POSTINC2 0x000fde data extern C:\MCC18\src\traditional\proc\p18F1320.asm INDF2 0x000fdf data extern C:\MCC18\src\traditional\proc\p18F1320.asm BSR 0x000fe0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm FSR1L 0x000fe1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm FSR1 0x000fe1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm FSR1H 0x000fe2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PLUSW1 0x000fe3 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PREINC1 0x000fe4 data extern C:\MCC18\src\traditional\proc\p18F1320.asm POSTDEC1 0x000fe5 data extern C:\MCC18\src\traditional\proc\p18F1320.asm POSTINC1 0x000fe6 data extern C:\MCC18\src\traditional\proc\p18F1320.asm INDF1 0x000fe7 data extern C:\MCC18\src\traditional\proc\p18F1320.asm WREG 0x000fe8 data extern C:\MCC18\src\traditional\proc\p18F1320.asm W 0x000fe8 data extern C:\MCC18\src\traditional\proc\p18F1320.asm FSR0 0x000fe9 data extern C:\MCC18\src\traditional\proc\p18F1320.asm FSR0L 0x000fe9 data extern C:\MCC18\src\traditional\proc\p18F1320.asm FSR0H 0x000fea data extern C:\MCC18\src\traditional\proc\p18F1320.asm PLUSW0 0x000feb data extern C:\MCC18\src\traditional\proc\p18F1320.asm PREINC0 0x000fec data extern C:\MCC18\src\traditional\proc\p18F1320.asm POSTDEC0 0x000fed data extern C:\MCC18\src\traditional\proc\p18F1320.asm POSTINC0 0x000fee data extern C:\MCC18\src\traditional\proc\p18F1320.asm INDF0 0x000fef data extern C:\MCC18\src\traditional\proc\p18F1320.asm INTCON3bits 0x000ff0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm INTCON3 0x000ff0 data extern C:\MCC18\src\traditional\proc\p18F1320.asm INTCON2bits 0x000ff1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm INTCON2 0x000ff1 data extern C:\MCC18\src\traditional\proc\p18F1320.asm INTCON 0x000ff2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm INTCONbits 0x000ff2 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PRODL 0x000ff3 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PROD 0x000ff3 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PRODH 0x000ff4 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TABLAT 0x000ff5 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TBLPTRL 0x000ff6 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TBLPTR 0x000ff6 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TBLPTRH 0x000ff7 data extern C:\MCC18\src\traditional\proc\p18F1320.asm TBLPTRU 0x000ff8 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PCL 0x000ff9 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PC 0x000ff9 data extern C:\MCC18\src\traditional\proc\p18F1320.asm PCLATH 0x000ffa data extern C:\MCC18\src\traditional\proc\p18F1320.asm PCLATU 0x000ffb data extern C:\MCC18\src\traditional\proc\p18F1320.asm STKPTRbits 0x000ffc data extern C:\MCC18\src\traditional\proc\p18F1320.asm STKPTR 0x000ffc data extern C:\MCC18\src\traditional\proc\p18F1320.asm TOSL 0x000ffd data extern C:\MCC18\src\traditional\proc\p18F1320.asm TOS 0x000ffd data extern C:\MCC18\src\traditional\proc\p18F1320.asm TOSH 0x000ffe data extern C:\MCC18\src\traditional\proc\p18F1320.asm TOSU 0x000fff data extern C:\MCC18\src\traditional\proc\p18F1320.asm Jan-Erik Soderholm wrote: > It's still not clear (to me at least) what part of the > memory is "full", and full of what ? Doesn't the MAP > file tell you that ? > > Note that the C-compiler will probably create it's own > memory areas ("stack", "heap" or whatever it's called) > besides of the variables/arrays/whatever you create > in your own code. Some compilers have directives that > can be used to trim this areas (if needed and possible). > > Jan-Erik. > > > > > > Carl Denk wrote: > >> If I checked the extended mode box in MPLAB, I got a error, the 18F1320 >> does not support extended mode, and If I added "near" to a declaration, >> that generated an error that extended mode needs to be checked. Then >> maybe thats a compiler/MPLAB. I do read the manuals, and had been >> working on this problem for about a week of spare time (a couple of >> hours every 2 days minimum) before bringing it to the group. >> >> Here is copy/paste from the output window: >> >>> Make: The target "D:\data\BANKS ROAD\WELL SENSORS\C >>> PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.o" is out of date. >>> Executing: "C:\MCC18\bin\mcc18.exe" -p=18F1320 /i"C:\MCC18-3-3" "WELL >>> SENSOR-3-9-09-B.C" -fo="WELL SENSOR-3-9-09-B.o" --extended -mL -Ls -O- >>> Device '18F1320' does not support extended mode >>> >> Taking a successful compilation file, add "near" to the first int >> declaration ( follows #pragma udata) results in >> >> >>> #pragma config PWRT = OFF // Disable Power-up Timer >>> #pragma udata >>> near char check_char = 3; // This is the maximum quantity of ID >>> characters to compare. >>> unsigned int get_ADC (int); >>> char c; >>> >>> Make: The target "D:\data\BANKS ROAD\WELL SENSORS\C >>> PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.o" is out of date. >>> Executing: "C:\MCC18\bin\mcc18.exe" -p=18F1320 /i"C:\MCC18-3-3" "WELL >>> SENSOR-3-9-09-B.C" -fo="WELL SENSOR-3-9-09-B.o" -mL -Ls -O- >>> MPLAB C18 v3.31 (evaluation) >>> Copyright 2000-2009 Microchip Technology Inc. >>> Days remaining until evaluation becomes feature limited: 56 >>> >>> WARNING: The procedural abstraction optimization will not be >>> supported when the evaluation becomes feature limited. >>> >>> D:\data\BANKS ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL >>> SENSOR-3-9-09-B.C:25:Error [1303] 'near' symbol defined in non-access >>> qualified section >>> >> Last night I did try to follow the manual with modifying the LKR file, >> and trying to with #pragma udata, to specify addresses without full >> success. I was able to with Linker modifications put one of the arrays >> where it appeared in the MAP file to be space in ram, but an array size >> larger that 2 generated the doesn't fit error. Today the plan is to go >> back through that, and if not successful, to prepare meaningful messages >> showing exactly what I did for people to comment. >> Thanking again for help. :) >> >> Olin Lathrop wrote: >> >>> Carl Denk wrote: >>> >>> >>>> The 1320 does not support extended mode, >>>> so near/far isn't available. >>>> >>>> >>> Near and far may be used by your compiler to select access bank versus >>> unbanked memory. As always, read the manual. This should be well described >>> in the compiler manual. >>> >>> >>> ******************************************************************** >>> Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products >>> (978) 742-9014. Gold level PIC consultants since 2000. >>> >>> -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist