mainlogo.jpg (16286 bytes)

AN504

Products: Domino 1 and 2

Using a 24LC16 I2C EEPROM with the Domino

Date: 4/12/99

Introduction: This application note demonstrates how to interface an I2C EEPROM to the Domino 1 or 2.
 

Background: While the on-board EEPROM memory of the Domino can be used to store data, it has a limited erase/write-cycle lifetime. To eliminate the worry over whether you’re wearing out the internal device or not, simply add one or more external devices. Currently, the largest device that will work with the built-in utilities is the 16k (256 x 8 x 8 blocks) Microchip 24LC16. One can add several more of these devices but additional hardware and I/O lines are needed as well as a small bit of software to address the chips.

 

 

How it works: I2C addressing can be a little confusing so we’ve included this table to make things a little easier. The 24LC16 has three address lines (A0-A2) which are not used. Normally these 3 pins allow the user to set the address of the device. A specific address is set by pulling the lines high or low as shown in the table. I2C EEPROMS start with a base address of A0h. To this you add a device address. How ever, the 24LC16 uses the device address (controlled via software) to access the 8 blocks of 256 bytes.

A2

A1

A0

A0H

GND

GND

GND

A2H

GND

GND

+5V

A4H

GND

+5V

GND

A6H

GND

+5V

+5V

A8H

+5V

GND

GND

AAH

+5V

GND

+5V

ACH

+5V

+5V

GND

AEH

+5V

+5V

+5V

The Read/Write modes of the 24LC16 (Byte Write, Byte Read) are supported by the Domino utilities. The skeleton code below shows how these are accomplished. 

Base = the base address of the EEPROM (A0h)
Block = one of the 8 (0-7), 256 byte blocks in the device
Addr = the address within the block (0-255)
Data = the data you are writing to the device

Byte Write:
PUSH (Base + Block) * 100h + Addr, Data
CALL 0F128h
POP C

Byte Read:
PUSH (Base + Block) * 100h + Addr
CALL 0F12Ch
POP C : REM C contains the data read from the EEPROM