example with a PIC18F26K22
table of 350 bytes .. over than a BANK size !
so modiy the "18f26k22.lkr" file to collapse 2 BANK in only one to obtain 512 bytes available!
and give a name for this section
example
......
DATABANK NAME=msgToSend START=0x100 END=0x2FF PROTECTED // 512 bytes
DATABANK NAME=usartBuff START=0x300 END=0x4FF PROTECTED // 512 bytes
DATABANK NAME=gpr5 START=0x500 END=0x5FF
.... etc ..
DATABANK NAME=gpr13 START=0xD00 END=0xDFF
SECTION NAME=msgToSend RAM=msgToSend
SECTION NAME=usartBuff RAM=usartBuff
......
renamed as 18F26k22_a.lkr
after in the C program
add in the project the modified file 18f26k22_a.lkr"
to link with this file , not with the standard file.
declare a pragma idata ...
#pragma idata msgToSend // déclaration des tableaux dans leur mémoire respective
char msgToSend[300] = { 0 };
#pragma idata usartBuff
char inputBuffer[500] = { 0 };
#pragma idata
char *msg_ptr = &msgToSend[0]; // pointeurs pour manipuler les grands tableaux
char *buff_ptr = &inputBuffer[0];
... etc ...