
iVIEW-100 Series user’s Manual, 2006, v2.0 ----- 107
7.10 Use EEPROM
The EEPROM is designed to store infrequently changed data.
For example:
Module ID configuration settings
COM port configuration settings
Small data base
The erase/write cycle of EEPROM is limited(1,000,000 erase/write cycles),
user should not change the EEPROM frequently for testing. The EEPROM can
erase/write onto a single byte, so it is very useful in real world applications.
The iVIEW-100 has 2K bytes of EEPROM. The EEPROM contains 8 blocks and
each block has 256 bytes. It totally has 2048 bytes of EEPROM. Normally,
EEPROM is default in protection mode. In this mode, the user can’t write any
data into EEPROM. Call on “EnableEEP” to UN-protect it before writing data.
For example:
To write data to EEPROM block 1, address 10, user has to call
EnableEEP first. The program is shown below.
int data=0x55,data2;
EnableEEP();
/* enable EEPROM to unprotect mode */
WriteEEP(1,10,data);
/* write data to EEPROM */
ProtectEEP();
/* set EEPROM to protect mode */
Data2=ReadEEP(1,10);
/* read EEPROM data2=data=0x55 */
NOTE: To write an integer to EEPROM, you must call “WriteEEP” twice, just like
writing data to NVRAM.