View previous topic :: View next topic |
Author |
Message |
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
When will data EEPROM be used by compiler? |
Posted: Thu Aug 31, 2006 9:17 am |
|
|
When will data EEPROM be used by compiler?
The way I understand it is that for example when I
((16F877V3.249))
#define _str_1 0x2100
#rom _str_1={"This is string1"}
This will put in data EEPROM ((right after the program FLASH)
And it is read with
address=0;
result=read_eeprom(address);//remember the offset 0x2100==0
BUT
Is there an easier way?
Does the compiler use this for anything automagically?
Using it doesn't show up in %ROM used..Right? |
|
|
Ttelmah Guest
|
|
Posted: Thu Aug 31, 2006 10:13 am |
|
|
The data EEPROM, is effectively just another peripheral, that happens to be 'built in' to many of the chips. On some of the older chips it is even accessed using the commands for external EEPROM memories, being just a 'clone' of an external EEPROM chip attached to the die. The 'programming' option, is just a convenience provided by MicroChip, who automatically 'remap' this part of the memory space as addressed by the programmer to this 'external' device. CCS,won't use the EEPROM at all. You cannot run code from it, or use it to store variables, so nothing that the compiler actually want's to do itself, can use this area. It is a _long term_ store, for values that change infrequently.
Best Wishes |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Thu Aug 31, 2006 10:52 am |
|
|
Great.
I want to typemod that and use it for seldom/never changing strings and non-volatile program initial values.
I am doing this because I am running out of ROM.
Boards are made.((not my design)) and I can't change PIC. |
|
|
|