To assist others that may have the same problems I will answer my own post: Below is what I had to do, it appears that I was not using the accessram, I did try things like the near and far but they do not work until you put "#pragma udata access accessram" I expect reducing the stack may have helped but I don't know enough to be sure I am not going to cause other problems. I have taught myself C over the last few weeks so still have a lot of holes in my knowledge but are slowly getting there. regards Lee McLaren //variables //--------------------------------------------------------------------- #pragma udata access accessram near unsigned char buffer[54]; //--------------------------------------------------------------------- #pragma udata unsigned char Stop; unsigned char debounced_state; unsigned char clock_A; unsigned char clock_B; unsigned char DiscReg[1]; // Discrete Inputs 02 10001 R Jan-Erik Soderholm wrote: > Lee McLaren wrote : > > >> I am writing a program in C18 for the 18F1320 and keep running out >> > of > >> data memory, according to the "Memory Usage Gauge" in MPLAB 7.30 I >> > am > >> only using 138 out of 256 but every time I try to increase >> the size of a serial buffer I get:... >> > > It seems as the C18 stack is "eating" half of your mem : > > >> SHAREBANKS: >> >> DATABANKS: >> Memory Start End Section >> --------- ------ --- --------- >> gpr0 0x0080 0x00f3 .stack >> > > > Maybe try to decrease the stack size (no idea how to do that). > > Or, of course, rewrite your app or use a processor with > more RAM... > > Jan-Erik. > > > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist