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

Buffer lenght limitation

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







Buffer lenght limitation
PostPosted: Wed Aug 31, 2005 9:26 am     Reply with quote

Hi,
I'm working on a PIC16F676A and I've got some problems with a declaration of 2 buffer, this is what I need:
Quote:

unsigned int8 buffer1[100];
unsigned int8 buffer2[100];

The ccs compiler say that I'have not enough RAM, this is true cause I've other variables declaration.
The strange thing is that this work:
Quote:

unsigned int8 buffer1[88];
unsigned int8 buffer2[20];

and this doesn't work:
Quote:

unsigned int8 buffer1[98];
unsigned int8 buffer2[10];

Ther is a buffer lenght limitation for this family or something similar?
(if I compile the 2 buffer of 100 elemets for a PIC18 family everything is ok).
Sorry for my bad english and thanx for your attention.
Best regards.
Ttelmah
Guest







PostPosted: Wed Aug 31, 2005 10:00 am     Reply with quote

The problem is the way the RAM is organised in the 876. A declaration like this, requires a continuous block of memory. the 876, has 96 bytes in the first page as one block, and then 80 bytes in the second page, 96 in the third, and 96 in the fourth. The two latter blocks can each potentially ue another 16 locations (to give 114 bytes in one lump), but only one of them can do this (the extra locations are 'shared' between all the banks), and then the size of block available in the first bank drops to only 80 bytes.
So the 876, cannot have two continuous blocks of 100 memory locations allocated at once.
You _should_ be able to allocate two 96 byte buffers at th same time.
the 18F family, have all the I/O registers mapped seperately at the top of memory, ad can use the available RAM in one large lump.

Best Wishes
Sirio
Guest







PostPosted: Thu Sep 01, 2005 8:14 am     Reply with quote

Thank you very much.
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