M.L. escreveu: > Marcelo, use the [PIC] subject tag if you want people to read your posts. > -- > Martin K. > > > On Mon, Jun 1, 2009 at 8:29 AM, Marcelo Rodrigues wro= te: > > = >> Hi all, >> >> I'm working with the PIC16F916, and according to the Datasheet (page 25) >> it has the following memory banks: >> Bank 0 =3D 96 bytes >> Bank 1 =3D 80 bytes >> Bank 2 =3D 80 bytes >> Bank 3 =3D 96 bytes >> >> I've written a small program only with 4 arrays to fill the banks, but >> the compiler return an error: >> >> bank0 unsigned char volatile static var00[96]; >> bank1 unsigned char volatile static var01[80]; >> bank2 unsigned char volatile static var02[80]; >> bank3 unsigned char volatile static var03[96]; >> >> Error [1250] double.c; 55. could not find space (96 bytes) for variable >> _main_var03 >> >> However, if i set the bank 3 only with 80 bytes, it compiles succesfull >> and says that I have 16 bytes free: >> >> bank0 unsigned char volatile static var00[96]; >> bank1 unsigned char volatile static var01[80]; >> bank2 unsigned char volatile static var02[80]; >> bank3 unsigned char volatile static var03[80]; >> >> Data space used 150h (336) of 160h bytes ( 95.5%) >> >> Why can't i fill these 16 bytes on bank 3, is it used for anything else? >> >> Thanks in advance, >> >> -- >> Marcelo dos Santos Rodrigue Usually the compiler needs a few bytes of RAM for its own use (eg.: interrupt state save, intermediate calculation results, etc). Perhaps the compiler detects the lack of memory before it optimized and removed its own unused internal variables. It would be better if you leave some free memory in bank0, because the common bank resides in the last 16 bytes of every bank and it is a more versatile memory. Some compilers may not work unless there is some free memory in the access bank. Regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist