Hi, Many thanks indeed for the advice, Olin. This puts me on the right track but I am still uncertain over exactly what to put into my source code in order to place certain globals into specified RAMBANKS. I've just been reading through the C18 User Guide again (while munching through my breakfast) and come across #PRAGMA, which I confess I don't know a whole lot about, and it seems as though this is what I need to use (?). I also looked at the linker file again briefly and noted that the fifteen DATABANKs are labelled gpr0, gpr1, etc. Presumably, C18 only puts globals into one of those DATABANKS, and if I want to make use of any of the others, I have to kind of switch to them. So what it seems as though I need to do is something like: #PRAGMA udata my_array RAM=gpr7 Char mybigarray[255]; #PRAGMA /* Go back to putting globals into default locations */ I know the syntax of that is probably hopelessly wrong - I need to drive over to work first before I can experiment with it(!) - but hopefully I'm in the right direction here! Many thanks and kindest regards, Trevor. > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Olin Lathrop > Sent: 21 August 2003 21:51 > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC:] C18 and available RAM on 18Fxxxx > > > > When compiling, > > the linker told me that this array couldn't be fitted. Only when I > > reduced it to something like char buffer[150] did it compile okay. > > It should compile OK either way. The fact that it doesn't > means there is > something else wrong other than the array not fitting into > memory. Only > the linker would know to complain about that. > > > What confuses me is that when I changed the target device > to an 18F6720 > > (the device I intend to start using instead, for more IO > pins) I still > > got errors when setting that array to more than 200 chars > wide. And this > > is on a device that has many more times more ram (3840 bytes, IIRC). > > The linker control file probably defines separate DATABANKs > for each RAM > bank. This means no data section can exceed 256 bytes. You should be > able to create an array of 256 bytes, but it needs to be in its own > section. You are probably defining the array in a section with other > stuff. In other words: > > > udata > ar res 256 > stuff res 13 > morestuff res 17 > > > isn't going to work (again assuming 256 max size of any > DATABANK). You > should put the array in its own section: > > > .bigarray udata > ar res 256 > > udata > stuff res 13 > morestuff res 17 > > > This will allow the linker to put AR in its own RAM bank, and > STUFF and > MORESTUFF will go into a different RAM bank. > > > ***************************************************************** > Embed Inc, embedded system specialists in Littleton Massachusetts > (978) 742-9014, http://www.embedinc.com > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.