Searching \ for '[PIC] MPLAB Memory usage gauge questions' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/memory.htm?key=memory
Search entire site for: 'MPLAB Memory usage gauge questions'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] MPLAB Memory usage gauge questions'
2009\05\26@094141 by Carl Denk

flavicon
face
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.

2009\05\26@095815 by Scott

picon face
On Tue, May 26, 2009 at 9:41 AM, Carl Denk <spam_OUTcdenkTakeThisOuTspamwindstream.net> 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?
>

Can you post the relevant contents of the MAP file so we can see where
and how much data memory (RAM) is being used?

-Scott

2009\05\26@100048 by Rolf

flavicon
face
Carl Denk wrote:
{Quote hidden}

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

2009\05\26@100742 by Xiaofan Chen

face picon face
On Tue, May 26, 2009 at 9:41 PM, Carl Denk <.....cdenkKILLspamspam@spam@windstream.net> 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?

Is it in line with your map file? Memory gauge is only approximate as
far as I know. The map file is the real one.

Your linker script may play a part as well. Maybe you want to post
it and let other people chime in to see whether changing that
would help.

You can also play with the optimization settings or even different
C18 versions.


--
Xiaofan http://mcuee.blogspot.com

2009\05\26@102308 by Isaac Marino Bavaresco

flavicon
face
Carl Denk escreveu:
{Quote hidden}

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ça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2009\05\26@102857 by Carl Denk

flavicon
face
Here's the linker, and I have "Release" in MPLAB and #pragma config
DEBUG = OFF in the C file.
In the LKR I see:
DATABANK   NAME=gpr0       START=0x80              END=0xFF, and in the
map, I think that area is assigned. Unfortunately the 1320 has only 256
data memory. I do have another option, though, but rather not go there -
the PIC communicates with a PLC, and I could do the averaging/filtering
there.


// File: 18f1320_g.lkr
// Generic linker script for the PIC18F1320 processor

#DEFINE _CODEEND _DEBUGCODESTART - 1
#DEFINE _CEND _CODEEND + _DEBUGCODELEN
#DEFINE _DATAEND _DEBUGDATASTART - 1
#DEFINE _DEND _DATAEND + _DEBUGDATALEN

LIBPATH .

#IFDEF _CRUNTIME
 FILES c018i.o
 FILES clib.lib
 FILES p18f1320.lib
#FI

#IFDEF _DEBUGCODESTART
 CODEPAGE   NAME=page       START=0x0               END=_CODEEND
 CODEPAGE   NAME=debug      START=_DEBUGCODESTART   END=_CEND        
PROTECTED
#ELSE
 CODEPAGE   NAME=page       START=0x0               END=0x1FFF
#FI

CODEPAGE   NAME=idlocs     START=0x200000          END=0x200007      
PROTECTED
CODEPAGE   NAME=config     START=0x300000          END=0x30000D      
PROTECTED
CODEPAGE   NAME=devid      START=0x3FFFFE          END=0x3FFFFF      
PROTECTED
CODEPAGE   NAME=eedata     START=0xF00000          END=0xF000FF      
PROTECTED

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

Rolf wrote:
{Quote hidden}

2009\05\26@104458 by Carl Denk

flavicon
face
I tried attaching the whole map file and it got kicked back, here's the
data portion:


                 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


2009\05\26@105121 by Harold Hallikainen

face
flavicon
face
Are you declaring the new array in the same source file as other globals?
If so, without a udata pragma, the linker tries to put everything in the
same bank of memory. You can try declaring it in another source file, or
adding some udata pragmas like below. The FifoStruct is 256 bytes, just
filling one bank of ram. I put all these in a single source file. I did
not have to modify the linker script.


#pragma udata U1TxFifo
volatile struct FifoStruct U1TxFifo;        // Uart1 transmit fifo
#pragma udata U1RxFifo
volatile struct FifoStruct U1RxFifo;  // Uart1 receive fifo
#pragma udata U2TxFifo
volatile struct FifoStruct U2TxFifo;        // Uart2 transmit fifo
#pragma udata U2RxFifo
volatile struct FifoStruct U2RxFifo;  // Uart2 receive fifo


Harold


--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2009\05\26@110052 by Alan B. Pearce

face picon face
>I have an 18F1320 with a C18 program and MPLAB (latest version).
...
>I thought the gauge info was generated at link time, and should
>include all the memory used.
>Is this a MPLAB error?

It could be, if you cannot match the map file info with the gauge. You say
you are running the latest version, but don't say what the actual version
is. The version after 8.15a (ver 8.20 IIRC) did have a problem with the
gauge, but it was a major problem, not a sneaky one like you list. I believe
it was fixed in 8.30.

Otherwise, as others have said, you need to check how you allocate things
for the linker.

2009\05\26@111427 by Bob Ammerman

picon face
>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

Or, if I remember correctly, you can use a #pragma to put some of your
variables in your existing source file into a different data section.

-- Bob Ammerman
RAm Systems

2009\05\26@112228 by Bob Ammerman

picon face
> Here's the linker, and I have "Release" in MPLAB and #pragma config
> DEBUG = OFF in the C file.
> In the LKR I see:
> DATABANK   NAME=gpr0       START=0x80              END=0xFF, and in the
> map, I think that area is assigned. Unfortunately the 1320 has only 256
> data memory.

Just a guess, but you might have to explicity place some of your variables
in ACCESS RAM (you do this by including the keyword "near" in the data
declaration).

Unless you are specifying "near" for some variables, the linker is trying to
place everything into locations 0x80 through 0xFF. I am guessing that some
of the C Library variables are being placed in ACCESS RAM which is allowing
the total bytes used to be greather than 128.

If you do place variables in access RAM you should choose the most often
referenced ones because the compiler can generate significantly better code
to handle them vs. variables in a normal RAM bank.

-- Bob Ammerman
RAm Systems


2009\05\26@113009 by Carl Denk

flavicon
face
This is version 8.30.00.00 MPLAB, downloaded last weekend. Yes, I did
have a major problem with the memory gauge on the earlier versions, it
showed "-" total data and no green arcs, etc. I have tried various mods
to the linker, pragmas, with little success, following examples, non of
which were exactly what my situation was. If I'm reading the map file
correctly, it's pretty much continuous for the full 256 bytes of data
memory of the 1320. To me that says, I have no memory left to use. :(

Thanks everyone for the help, keep the stuff coming. :)

Alan B. Pearce wrote:
{Quote hidden}

2009\05\26@120958 by Bob Ammerman

picon face
> Just a guess, but you might have to explicity place some of your variables
> in ACCESS RAM (you do this by including the keyword "near" in the data
> declaration).
>
> Unless you are specifying "near" for some variables, the linker is trying
> to
> place everything into locations 0x80 through 0xFF. I am guessing that some
> of the C Library variables are being placed in ACCESS RAM which is
> allowing
> the total bytes used to be greather than 128.
>
> If you do place variables in access RAM you should choose the most often
> referenced ones because the compiler can generate significantly better
> code
> to handle them vs. variables in a normal RAM bank.
>
> -- Bob Ammerman
> RAm Systems

After looking at the excerpt from your map file I am nearly certain the
above will fix you up fine. You have filled up the normal RAM bank from 0x80
through 0xFF, but you have plenty of space in the ACCESS RAM bank from 0x00
through 0x7F. The only variables currently in that section are some that are
part of the C runtime environment.

-- Bob Ammerman
RAm Systems

2009\05\26@141149 by olin piclist

face picon face
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].

On the surface, that sounds like yet another brain dead box filter by
someone who didn't pay attention in digital signal processing class.
Explain what characteristics you need this filter to have, such as random
noise attenuation, step response time, frequency response, etc.  What is the
overall purpose of the filter?  If you're just trying to reduce random
noise, then there are better ways that also take less memory.

> 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,

That doesn't mean the extra bytes are all in the same bank.  I never use the
memory gauge.  Look in the MAP file to get the real info.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\26@142018 by olin piclist

face picon face
Isaac Marino Bavaresco wrote:
> The problem may be with your linker script.
> The original linker scrips declare the RAM memory as being split into
> 256 bytes data banks.

You say that like it's a bad thing, when it is exactly what the linker
script should do since that's how the PIC workds.

> 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)

Yes, it can definitely bring up some problems.  In other words, anyone that
doesn't understand the potential problems shouldn't be doing this.
Furthermore, I think it's irresponsible to suggest this solution without
explaining what the problems are or how to avoid them.

> or declare some variables in a new source file,
> because the C18 will put them in a different data section.

Putting them in a different module just to put the in a different section is
downright silly.  Just specify a different section explicitly.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\26@144349 by Jan-Erik Soderholm

face picon face
> Isaac Marino Bavaresco wrote:
>> The problem may be with your linker script.
>> The original linker scrips declare the RAM memory
>> as being split into 256 bytes data banks.

Note that for the actual device he is using, it's not.

ACCESSBANK NAME=accessram  START=0x0      END=0x7F
DATABANK   NAME=gpr0       START=0x80     END=0xFF

So you can have 128 bytes in UDATA_ACS and then have
to change to UDATA to store the last 128 bytes. Or
the other way around, depending on which bank he's
using (I do not think that the whole UDATA* directive
was posted).

>> If any data section grows larger than 256 bytes
>> then it won't fit into any declared data bank.

128 bytes in this particular device.

One have to decide which variables should go into
the "access bank" and which should go into "bank0".

2009\05\26@152834 by Carl Denk

flavicon
face
And I say all this with a :) looking for good info.
>  Just specify a different section explicitly.
>
>  
In Microchip literature and other places there are numerous ways
suggested, including:
1: Specify a different section
2: Place the arrays in different files
3: Modify the linker file.

And I'm not anywhere near an expert, but have tried them all (most) with
little success. It may be some little detail that I don't have correct,
but Not one of the examples follows through the whole method with code
examples, I'll fault Microchip with poor examples. Here are some of the
issues:
1: They sometimes add a "NAME" declaration in the linker, and then use
that in the "C" file. Not sure where to safely assign an address to put
the variable. I think I could check the MAP file, but how do I know with
some small changes to the program, that's still safe.
2: The "extern int a_well[10];" , should it be with [ ] since the size
is defined in the file. Can/must this line be at the beginning of the
"C" file with other external declarations, or in main() or other function.
3: My linker file doesn't have  many gpr? areas, if I reduce the gpr0,
what are the rules?

Microchip specs claim that the 1320 has 256 data, the C18 package claims
to somewhat handle the near/far bit, but the whole package is cumbersome.

Looking for a good current reference on "C" most of my stuff is older
including K & R copyright 1978 is the oldest.

> That doesn't mean the extra bytes are all in the same bank.  I never use the memory gauge.  Look in the MAP file to get the real info.
>  
They give you a nice looking tool, no info on the usage, and then
doesn't give good info. Ideally, it would use different colors and
differentiate between the banks.

Sorry for getting long winded

2009\05\26@161914 by olin piclist

face picon face
Jan-Erik Soderholm wrote:
> One have to decide which variables should go into
> the "access bank" and which should go into "bank0".

Given that in this case there is only one normal bank, I would start by
putting all arrays in the normal bank, then as many variables as possible
into the access bank.  The randomly addressed one-off variables will benefit
from being in the access bank, whereas there is no benefit to memory that is
indirectly addresses, such as a array.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\26@162436 by olin piclist

face picon face
Carl Denk wrote:
> I'll fault Microchip with poor examples.

Perhaps.  I haven't really looked at their examples.

The real documentation is in the manual, which in this case is "MPASM User's
Guide with MPLINK and MPLIB".  You have to actually read that, of course,
for it to do any good.  The function of the linker is well explained in that
manual.  You need to understand it before you can make sense of how to tell
the compiler to tell things to the linker.  It does little good to read
about memory sections in the compiler manual if you don't understand what
the linker does with them, or what they are in the first place.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\26@163010 by Jan-Erik Soderholm

face picon face
Ah, wait, your're using C, right ?
Then maybe what I wrote below has no rellevance,
I don't know...

Jan-Erik.



Jan-Erik Soderholm wrote:
{Quote hidden}

2009\05\26@164717 by Jan-Erik Soderholm

face picon face
Olin Lathrop wrote:
> Jan-Erik Soderholm wrote:
>> One have to decide which variables should go into
>> the "access bank" and which should go into "bank0".
>
> Given that in this case there is only one normal bank, I would start by
> putting all arrays in the normal bank, then as many variables as possible
> into the access bank.  The randomly addressed one-off variables will benefit
> from being in the access bank, whereas there is no benefit to memory that is
> indirectly addresses, such as a array.

In *this* particular case (18F1320) with only *one* RAM bank (half
accessed via access-bank and half via BANK0), one can (as far as
I understand) put the variables wherever one likes, then setup
the BANK bits to point to BANK0. MPASM will then select RAM access
via the access-bank or via normal banking depending on the actual
address of the variable, right ? So there is no practical difference
(or benefit) in accessing a variable in the access-bank as when
accessing a variable in the rest (upper half) of BANK0.
You never have to use BANKSEL on a 18F1320.
On a larger PIC, with BANK1 and so on, it's different, of course.

I do think that you still have to *allocate* using UDATA_ACS and
UDATA to use both halfs, since that is how it's setup in the LKR.

Now, I'm not sure if this was C or ASM, so this might not be
of any concern in this case...

Jan-Erik.


>
>
> ********************************************************************
> Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
> (978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\26@175751 by olin piclist

face picon face
Jan-Erik Soderholm wrote:
> In *this* particular case (18F1320) with only *one* RAM bank (half
> accessed via access-bank and half via BANK0), one can (as far as
> I understand) put the variables wherever one likes, then setup
> the BANK bits to point to BANK0.

True if using MPASM where you know exactly what may be messing with the bank
register.  I don't know whether his compiler has a optimization for when
there is only a single bank to set the bank once and then assume the bank
register is always set to this single bank.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\26@181854 by Carl Denk

flavicon
face
I have the optimization turned off, so when the active time on the free
period is past, it still will compile. Code size isn't an issue, there
is plenty of code memory available. There are only 4 or 5 arrays, and
most are only 10, and one is 25 int's. Other variables I declare are
maybe 20, with only one long. The PIC watches 3 ADC's, scales the
values, and puts them out fiber optic to RS-485. The unit is slave on
the RS-485, checks 3 lead-in characters for identifying it's commands.

Olin Lathrop wrote:
{Quote hidden}

2009\05\26@183327 by Jan-Erik Soderholm

face picon face
Anyway, the MAP files should tell you what realy is
allocated and where.



Carl Denk wrote:
{Quote hidden}

2009\05\26@191456 by Carl Denk

flavicon
face
Yes, the description below, only being Bank0 and access-bank is correct.
I am using C18. As was recently suggested put the arrays in normal bank,
and other variables in access. The 1320 does not support extended mode,
so near/far isn't available.

Jan-Erik Soderholm wrote:
{Quote hidden}

2009\05\26@210648 by Bob Ammerman

picon face

----- Original Message -----
From: "Carl Denk" <cdenkspamKILLspamwindstream.net>
To: "Microcontroller discussion list - Public." <.....piclistKILLspamspam.....mit.edu>
Sent: Tuesday, May 26, 2009 7:14 PM
Subject: Re: [PIC] MPLAB Memory usage gauge questions


> Yes, the description below, only being Bank0 and access-bank is correct.
> I am using C18. As was recently suggested put the arrays in normal bank,
> and other variables in access. The 1320 does not support extended mode,
> so near/far isn't available.

Carl,

I'm afraid you have that backward. near/far is NOT available in extended
mode, only in normal mode.

I am really quite sure that near/far is the solution to your problem. (IE:
just stick "near" in front of all your single variables, and maybe an array
or two if necessary).

-- Bob Ammerman
RAm Systems

2009\05\27@071250 by olin piclist

face picon face
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.

2009\05\27@090641 by Carl Denk

flavicon
face
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

{Quote hidden}

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:
{Quote hidden}

2009\05\27@092723 by Jan-Erik Soderholm

face picon face
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:
{Quote hidden}

2009\05\27@102546 by olin piclist

face picon face
Carl Denk wrote:
> 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 don't use the compiler much so I don't remember the exact syntax.  The
trick is to put small groups of variables that will be accessed together
into their own named section.  That makes more and smaller chunks for the
linker to place, allowing it to use the space more efficiently.

In your case since your machine apparently only has a single bank, there are
only two bins for the linker to put sections into, and the choice of bin is
fixed in the source code due to whether you specified access bank or not.
First make small groups of variables each in their own named section anyway,
then you'll have to manually move the groups between the access bank and
banked memory.  There is no way to do this automatically since the compiler
needs to know whether a variable is in the access bank or not, so this is
already decided before the linker gets the sections.  The linker then has no
choice in your case.

Once you get a version to build, look at the MAP file to see how big each
section is and where there is space available.  Then you can move the
various named sections between access and banked memory to leave the most
possible space in banked memory.  Once you've done that, you can see how
much room there is really left for additional arrays.

You still haven't answered the question of what you want these filters to do
and why you think they need such large amount of state.  Most likely they
don't if the right filter is chosen.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\27@102802 by Carl Denk

flavicon
face
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:
{Quote hidden}

2009\05\27@121646 by Carl Denk

flavicon
face
Thanks guys, I have confirmed that the 1320 just doesn't have enough
data memory.  I was able to place the one array where I wanted with a
size of 2 and make successfully, but after studying the MAP file, I have
come to the conclusion that data memory from 0x00 to 0xFF is being fully
utilized. That Memory Usage gauge sure is misleading. There are a few
other things in the mechanical area I can possibly do to help the
situation. The pressure reducing valve after the offending sensor was
changed out late winter. The new one may have a different sized orifice
causing peaks in the pressure.

:)

2009\05\27@122840 by Tamas Rudnai

face picon face
You may can try to use the access ram area however...

Tamas


On Wed, May 27, 2009 at 5:16 PM, Carl Denk <EraseMEcdenkspam_OUTspamTakeThisOuTwindstream.net> wrote:

{Quote hidden}

> -

2009\05\27@125437 by Carl Denk

flavicon
face
What I understand, in the LKR file below, the first line defines the
access ram area, and further down from the MAP file, that area is fully
used. Thanks for the thought.

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
=================================================
   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
C:\MCC18\src\pmc_common\Timers\t1read.c
                 __tmp_0   0x000014       data     static
C:\MCC18\src\pmc_common\USART\uopen.c
                 __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_1   0x00001b       data     static D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
           a_temperature   0x0000c0       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
                       c   0x0000c4       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
               ReadArray   0x0000c5       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
              pReadArray   0x0000dd       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
              read_index   0x0000df       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
                       w   0x0000e0       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
         start_character   0x0000e2       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
                adc_data   0x0000e3       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
               padc_data   0x0000e9       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
                  w_temp   0x0000eb       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
             status_temp   0x0000ec       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
                bsr_temp   0x0000ed       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
                 fcs_low   0x0000ee       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
                fcs_high   0x0000ef       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
                    prom   0x0000f0       data     static
C:\MCC18\src\traditional\startup\c018i.c
               curr_byte   0x0000f3       data     static
C:\MCC18\src\traditional\startup\c018i.c
              curr_entry   0x0000f5       data     static
C:\MCC18\src\traditional\startup\c018i.c
                data_ptr   0x0000f7       data     static
C:\MCC18\src\traditional\startup\c018i.c
              check_char   0x0000fa       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
           watchdog_flag   0x0000fb       data     extern D:\data\BANKS
ROAD\WELL SENSORS\C PROGRAM\3-9-09-B\WELL SENSOR-3-9-09-B.C
                punit_id   0x0000fc       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

=================================================

Tamas Rudnai wrote:
{Quote hidden}

>> --

2009\05\27@132444 by Scott

picon face
On Wed, May 27, 2009 at 12:54 PM, Carl Denk <@spam@cdenkKILLspamspamwindstream.net> wrote:
{Quote hidden}

Carl,

The relevant parts of the linker script are:

ACCESSBANK NAME=accessram  START=0x0               END=0x7F
DATABANK   NAME=gpr0       START=0x80              END=0xFF
ACCESSBANK NAME=accesssfr  START=0xF80             END=0xFFF


Generally, variables that you access often are put in ACCESS RAM because
it's faster (no bank switching). Temporary math variables are placed here

The C stack is generally put at high part of RAM (since there's not much RAM
in this chip, the stack is placed somewhere in gpr0, the highest bank
possible).

The stack size is 0x40, so you should be able to fit another 0x40 (64) bytes
in gpr0, and most of the access bank will be available to use (C takes the
beginning of it up for math variables/arguments).

Your 20 variables (~40 bytes assuming they're all ints) and 5 arrays (4x10
and 1x25) assuming all ints would be 130 bytes. Your chip should be able to
accommodate these variables, plus the 64 byte stack, plus ~20 math
variables. There's only a few bytes of memory left after all that.


I would declare my variables something like this:



//start code

//Variables in ACCESS RAM must be declared with "near"
#pragma udata access accessram
near uint8_t var1;
near uint8_t var2;

//Variables in Banked RAM
#pragma udata
uint8_t buffer[MAX_LENGTH];

//Variables in a special section of RAM that was declared in the linker file
#pragma udata your_special_section
uint8_t var;

//end code

-Scott

2009\05\27@143328 by Carl Denk

flavicon
face
Just by adding "#pragma udata access accessram", and "near" to the 3
arrays did the job so far. I still have some code commented out, but
seems to be working. Thanks so much :) I'll have to review what didn't
work to understand why this does work. :)

Scott wrote:
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...