CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Locate array in BANK0 and BANK1

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Max
Guest







Locate array in BANK0 and BANK1
PostPosted: Wed Dec 10, 2003 11:45 am     Reply with quote

array TXBuffer in BANK1
array RXBuffer in BANK2

is possible following code (IAR) in CCS ??


Thanks


// Buffers for transmitted and received data
// These are put into different banks so that they can be as large as possible
// The TX buffer is filled up with data to be sent in the next data packet
// The RX buffer is a ring buffer in which received data is stored waiting to be
// sent to the UART

/*
volatile __bank1 char TXBuffer[TX_BUFFER_SIZE];
volatile __bank2 char RXBuffer[RX_BUFFER_SIZE];
*/
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: Locate array in BANK0 and BANK1
PostPosted: Wed Dec 10, 2003 1:18 pm     Reply with quote

Max wrote:
array TXBuffer in BANK1
array RXBuffer in BANK2

is possible following code (IAR) in CCS ??


Thanks


// Buffers for transmitted and received data
// These are put into different banks so that they can be as large as possible
// The TX buffer is filled up with data to be sent in the next data packet
// The RX buffer is a ring buffer in which received data is stored waiting to be
// sent to the UART

/*
volatile __bank1 char TXBuffer[TX_BUFFER_SIZE];
volatile __bank2 char RXBuffer[RX_BUFFER_SIZE];
*/


This places a 64 byte buffer in bank 1
Code:
int8  PacketBuffer[64];
#locate PacketBuffer = 0x100

Having the array start at byte 0 within the bank also reduces code required for indirect addressing by 1 instruction per access.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group