Read EEPROM

The Zigbee BoosterPack, MDB1, and other boards have an I2C EEPROM. This example demonstrates how to read/write to the EEPROM.

There are a few manufacturers of compatible EEPROMs which share the same software interface, including: The board uses a 128kBit part (16kBytes). Note that smaller parts use a slightly different interface, with one address byte instead of two.
 * Atmel AT24C128C
 * Microchip 24LC128
 * Rohm BRT128

I2C EEPROMs allow you to write data to individual bytes or entire pages. This example demonstrates both. The example will write to the EEPROM and then read the same location as shown below.



When writing to the EEPROM you must wait for it to complete its write operation (internally timed) before any further operations. The best way to determine whether the EEPROM is busy is with "Acknowledge Polling". In Acknowledge Polling the master outputs the EEPROM's slave address on the I2C bus and checks whether the EEPROM acknowledges it. If not then the EEPROM is still busy. We use this technique in the example.

EEPROM is non-volatile memory and will retain its value after removing power.

''Congratulations, you've finished all the Hardware Interface Examples!

Previous: Timer Interrupt

Return to Module Examples Page''