pinacio Guest
|
Bulk transfer from RAM to I2C EEPROM |
Posted: Wed Feb 11, 2009 3:38 pm |
|
|
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 |
|