|
Re: read/write EEPROM on 18F8520
I don't yet have EEPROM read and write working reliably. It works erratically, and I've not yet figured out what I'm doing wrong. I found this couple of paragraphs in the 18Fxx20 data sheet, which I can't make sense of. I doubt it's related to my problem, but would anyone like to try to interpret it?
This is it:
7.8 Using the Data EEPROM
The data EEPROM is a high endurance, byte addressable
array that has been optimized for the storage of
frequently changing information (e.g., program variables
or other data that are updated often). Frequently
changing values will typically be updated more often
than specification D124. If this is not the case, an array
refresh must be performed. For this reason, variables
that change infrequently (such as constants, IDs, calibration,
etc.) should be stored in FLASH program
memory.
A simple data EEPROM refresh routine is shown in
Example 7-3.
Note: If data EEPROM is only used to store constants
and/or data that changes rarely, an
array refresh is likely not required. See
specification D124.
(specification D124 is missing from the 18Fxx20 data sheet, but is included in the errata)
Param=D124 Sym=TREF Characteristic=Number of Total Erase/Write Cycles before Refresh(4)
min=1M typ=10M (no max) unit=E/W Conditions -40°C to +85°C
|