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

16f876 PIC + char problem

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



Joined: 19 Oct 2004
Posts: 40

View user's profile Send private message

16f876 PIC + char problem
PostPosted: Tue Feb 14, 2006 7:01 am     Reply with quote

Hello
I am working using a PIC 16f876. I need to use a char variable :
char variable[200];
but only I can use a maximun size of 120
char variable[120];
do you know a way to use more memory for my char variable? I think it is a memory problem so if I can increase my memory this problem could disappear.....
Thanks
Ttelmah
Guest







PostPosted: Tue Feb 14, 2006 9:22 am     Reply with quote

No.
Realistically, the easiest solution is to switch to a 18F chip...
The problem is that on the 18F876, the RAM memory is split into smaller lumps. There are only three blocks of 96 bytes, and one block of 80 bytes available. It is possible to use 16 bytes from the lowest block in one of the upper blocks, to give a maximum continuous block of memory, just 112bytes long. I'm suprised you can actually get 120 to work...
Go can allocate two 96 byte arrays, and have code so that if the address if over 96, this is subtracted, and the second array used. However getting 200 addresses to work is going to be very hard, and suggests you are trying to push the chip too far.

Best Wishes
angel



Joined: 19 Oct 2004
Posts: 40

View user's profile Send private message

OK
PostPosted: Wed Feb 15, 2006 4:46 am     Reply with quote

Hi Ttelmah
Yes you are right. After compiling only I can use now a char of 96. I found some solutions : I tried the command #device *=16 (after compiling I have 28% of the ROM and 48-50% of RAM memory) and I am going to try the commands Write_Back and Read_Bank. I think those commands will arrange my problem. I have to send a SMS message using a modem so another solution could be sending 2 messages instead of one of 200 characters
Thanks for your help
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