Memory allocation!!

General discussion on mikroC.
Post Reply
Author
Message
rat16f88
Posts: 19
Joined: 07 Sep 2010 11:42

Memory allocation!!

#1 Post by rat16f88 » 28 Mar 2012 10:00

Am using a PIC 16f88 uC and
I need to have an array of 4x32 of chars
eg:-

Code: Select all

char buff[4][32];
it needs only 128 bytes if I am correct(?) :?:

Without using the above array compiler says 328 bytes free & 90% of ram,
but I cannot compile the code :( it says Not enough RAM buff :? :?

is there a any mistake of me or what should I do? :| :|

Regards 8) 8)
rat16f88,

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Memory allocation!!

#2 Post by janko.kaljevic » 29 Mar 2012 10:05

Hello,

Multidimensional arrays are stored on consecutive addresses in RAM.
Since you are using PIC16F which ha banks with 96bytes, maximum two dimensional array that you will be able to implement is

Code: Select all

char buff[4][24]; 
Please consider switching to PIC18, they have better memory organization.

Best regards.

Post Reply

Return to “mikroC General”