User manual

I2C API reference
58 © 2007-2010 Analytica GmbH
6.1. Programming I2C EEPROM
The AnaGate I2C is very well suited for programming serial I2C EEPROM. To support this special
requirement two different functions are made available: I2CReadEEPROM and I2CWriteEEPROM.
Like all other I2C-capable devices EEPROM's are addressable on the I2C bus via a unique slave address
(see also Appendix B, I2C slave address formats). The so-called Device Type Identifier for these types
of devcies is 0xA. In principle 8 similar devices can be connected and addressed via the Chip Enable Bits
E0, E1 und E0.
A data transmission is started with a Start signal by the master, followed by the slave address. The slave
address is confirmed by the slave with a ACK. Depending on the R/W bit data is written (data to slave)
or read (data from slave). The last byte of a read access has to be confirmed with a NAK by the master
to signal the slave end of read transmission. The data transmission is terminated always by a Stop signal
from the master.
When using EEPROM's the memory address is transmitted after transmission of the slave address, to
advice the slave which memory address is to be written or read. Depending on the used EEPROM type
the memory address is sent as single byte (8 bit) or as two bytes (16 bit, MSB First).
To expand the address space from 8 bit (or 16 bit), some EEPROM types use the Chip Enable Bits E0, E1,
E2 as additional address bits. Which bits are used in individual cases is defined by the chip producer. In
the following, all possible combinations of the bits usage are listed:
Table 6.1. Usage of the CHIP-Enable Bits of I2C EEPROMs
Mode
1
Usage Description
0x0 E2-E1-E0 Bits are only used to select the chip.
0x1 E2-E1-A0 Bit E0 is used to expand the addresse space. It is used for address bit A8 (resp.
A16).
0x2 E2-A1-A0 E0 and E1 are used to expand the addresse space. E0 is used for address bit A8
(resp. A16) and E1 is used for A9 (resp. A17).
0x3 A2-A1-A0 E0, E1 and E2 are used to expand the addresse space. E0 is used for address bit
A8 (resp. A16), E1 for A9 (resp. A17) and E2 for A10 (resp. A18).
0x5 A0-E1-E0 Bit E2 is used to expand the addresse space. It is used for address bit A8 (resp.
A16).
Das E2-Bit wird für die Addressierung verwendet. Es entspricht dabei dem
Adressbit A8 bzw. A16.
0x6 A1-A0-E0 E2 and E1 are used to expand the addresse space. E1 is used for address bit A8
(resp. A16) and E2 is used for A9 (resp. A17).
1
Set this mode flag in bit 8-10 of parameter nOffsetFormat in I2CReadEEPROM and I2CWriteEEPROM functions.