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

not enough RAM?

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



Joined: 05 Jul 2006
Posts: 10

View user's profile Send private message

not enough RAM?
PostPosted: Thu Aug 17, 2006 4:19 pm     Reply with quote

Hi, I'm using PIC16F877A and when i do something like
char something[100] then it'll show error, not enough RAM, hmmm any suggestion on what else I can try? Because I'm trying to store data that's 101*128 bytes, and if I send it every time to PC then putc is too slow, so I don't know what else I can do.
Thanks in advance.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Aug 17, 2006 5:21 pm     Reply with quote

Quote:
Hi, I'm using PIC16F877A and when i do something like
char something[100] then it'll show error, not enough RAM,
any suggestion on what else I can try?

In CCS, the largest array size is limited by the RAM bank size.
For the 16F877A, the largest possible array is 96 bytes. The compiler
will place it in one of the upper banks (bank 2 or 3). You need to
enable use of all ram with the "#device *=16" statement, in order to
get the compiler to use RAM in these banks.
Code:

#include <16F877A.H>
#device *=16    // This enables use of all RAM.
#fuses XT, NOWDT, PROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)

char array[96];   // This is the largest array size.

//======================================

void main()
{

while(1);
}



Quote:

Because I'm trying to store data that's 101*128 bytes, and if I send it
every time to PC then putc is too slow, so I don't know what else I can do.

Can you explain this some more ? What type of data is being stored ?
Where does it come from ?
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