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: > > 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 > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist