Quote:
Originally Posted by Astronouth7303
IIRC, when you declare a variable as "rom", it is still stored in EEPROM, but the location is allocated by the linker. When you use Kevin's library, you choose the location itself. Data is never stored in the program memory (flash). Also, "rom" variables are reset to default values when the program is downloaded.
|
This is not correct; the
rom qualifier specifies that the variable be referenced in program (i.e. flash) memory, while the
ram qualifier forces it into static RAM (where the
near and
far qualifiers also apply, but that's for using GSRs and SPRs in special ways, which not many people here would need). You should use the rom qualifier if you're storing large arrays (i.e. lookup tables) in program memory. The qualifier is necessary so the compiler can generate the necessary table reads and writes to flash. EEPROM reads and write are done independently through the EECON, etc registers.