|
|
View previous topic :: View next topic |
Author |
Message |
sheing3003
Joined: 05 Jul 2006 Posts: 10
|
not enough RAM? |
Posted: Thu Aug 17, 2006 4:19 pm |
|
|
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
|
|
Posted: Thu Aug 17, 2006 5:21 pm |
|
|
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 ? |
|
|
|
|
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
|