|Accessing an I2C Memory Device FAQ (Frequently Asked Questions)|
Accessing an I2C Memory Device
Before you can write or read data to or from an I2C Bus memory device, you most first write to the device's internal address register. When you are writing to the device, the first one or two data bytes you send are loaded into the device's internal address register. This internal address register is subsequently used as a memory pointer to access data. You must write to the address register even when you intend to read from the device. This is demonstrated in the commands below:
1. Open the iPort.
2. Set the destination slave address. This is the slave address of your I2C device. Refer to the device data sheet.
3. To write data:
a. MasterTx one or more data bytes. The first one
(or two, see device data sheet) data bytes get loaded into the device's
Additional data bytes are written into memory at sequential address locations.
To read data:
a. MasterTx one (or two, see EEPROM data sheet) data
bytes to load the device address register.
b. MasterRx to read one or more data bytes. If all goes well, the iPort will respond with the data from the device.
Before you try to connect the iPort to your device, you should check out the pull-up resistor voltage. The pull-ups inside the iPort are 1.8K to 5V. If your device is 3.3V or less, use the iPort slider switch to turn off its pull-ups. Your system should then provide its own pull-ups on the SCL and SDA lines.
Can't find the answer to your question here? Then e-mail your question to us at firstname.lastname@example.org
I2C is just a mouse click away TM