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 CCS Technical Support

Bulk transfer from RAM to I2C EEPROM

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







Bulk transfer from RAM to I2C EEPROM
PostPosted: Wed Feb 11, 2009 3:38 pm     Reply with quote

Hello there

I am writing a program with a very large interface (lots of text and menus) which are taking up a lot of ROM and RAM.
I am declaring the strings in RAM and initializing them with constant values.
I would like to be able to store all the strings in an eeprom (24AA256) and then use the EEPROM to initialize the variables, thus saving ROM.

Is there an easy way for me to copy the contents of the memory area where the strings are (they are contiguous) to the eeprom, and then copy back a block containing the needed strings to the memory address of the variables in RAM?

Allow me to exemplify:

Code:


char A[1][21];
char B[1][21];
char C[1][21];
//...

strcpy(A,"Temp");
strcpy(B,"Hrs");
strcpy(C,"Code");
//...

void programEEPROM(){
addr=A[0];
write_ext_eeprom_str(0, addr, 2500);
}

void LoadStrings(){
addr=A[0];
read_ext_eeprom_str(0, addr, 2500);
}



Must I force the variables to be contiguous? How?
Is it enough to declare them in sequence and they wiil occupy contiguous addresses?

Thanks in advance
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 11, 2009 5:04 pm     Reply with quote

These threads might help:
http://www.ccsinfo.com/forum/viewtopic.php?t=35685
http://www.ccsinfo.com/forum/viewtopic.php?t=29309
http://www.ccsinfo.com/forum/viewtopic.php?t=37442
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