[SOLVED] large array variables in ram

Status
Not open for further replies.

Rk_on_edaboard

Junior Member level 3
Joined
Apr 5, 2013
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,452
i am using 89s52 microcontroller, c programming in keil.
my question is can i use array of 256 bytes in main function ?
if yes then how?:-|

please reply
 

Hi Rk,
Not familiar with the 89s52 in particular. But the rule is, anything declared in any function(also in main()) is an auto variable which gets stored in RAM. If I am not wrong, the entire RAM available in 89s52 is just 256 bytes which makes this impossible. If you are about to deal with constant data, consider using the programmable flash part within the IC.

Raj Gunaseelan.
 
if your array is fixed then u can store it in ROM and with this method u can store array in upto ROM memory limitation.
use code infront of declaration that is it will look like as

code unsigned char array[100]={0};

but this will constant
 
hello,

Have a look on FRAM

 
thanks for yours valuable reply.
i am creating 16x64 led matrix display using 74595(for cathode,column ) , 74ls138(anode and is row) and 89s52.
for that i want to display character in 16x14 font.
i have created font and their codes.one character has 224 hex codes.
so i require array which can store these 224 codes of one character.
for that if you all have any idea please tell me.
I also defined array as xdata but it is not working .

please reply
 

I don't know your 89s52 MCU, but it's seems this MCU can acces
to external (devices) RAM with ALE signal ?
if not..
use external devices like a FRAM or EEPROM with I2C protocol.. 2 wires SDA SCL
to store led matrix table
if base is 96 car => 21.504 bytes
non printable char from 0 to 31 not included !!!

EEPROM 24LC256 => 32K*8 is OK..
maybe you can arrange your big table in EEPROM , modulo 64 bytes to speed up the reading of eeprom
by page of 64 bytes (instead of byte per byte) into a table of RAM size 64 bytes .
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…