Recently I have been working with AVR XMEGA128A1 and I needed to use I2C (TWI) bus.
I also have some 24LC16b EEPROMs which are pretty easy to use, so I decided to use them
to test my I2C code. The code did not work on the first try (as expected) so I said, hey, let’s
try that I2C mode of the Bus Pirate so we know the EEPROM is not damaged.
At first I needed to connect my Bus Pirate to the EEPROM with the probe cable.
Gray = SDA
Purple = SCL
Then I fired up the terminal, entered the m (mode) command
and finally set the speed to 100kHz.
Now we can talk to the chip.
I needed something very simple, only to verify that the chip is OK, so I wrote
random byte (I chose 0xAA) to the address 0x00 and read it back.
To write a byte to memory we need to enter this [0xA0 0x00 0xAA]
[ = Start bit
0xA0 = I2C address of the EEPROM with the WRITE bit
0x00 = Memory address
0xAA = Data
] = Stop bit
Here we see that we read 0xAA which is correct.