12-27-2020 10:19 AM
I am using the AXI IIC ip Blog. When I do the slave address 0x2c, it stays in the loop while writing on the i2c bus address. As shown in the picture 1, but when I do the slave address is 0x58, the i2C bus works as shown in the picture 2.
Why does the slave not work when I do the address 0x2c?
Picture 1 Picture 2
12-27-2020 11:15 AM
I don't know anything about the IIC blog, but clearly the slave in your system is set to respond to address 0x58. I2C slaves can only ever respond to one address. (Devices usually have some method to set the address, but once your system is up and running, it can't be changed). Why do you expect the slave to respond to 0x2C? What slave have you connected to your system?
01-05-2021 04:55 PM - edited 01-05-2021 04:56 PM
An I2C device has a 7-bit address, but on the bus each device has two addresses: one for read, one for write. To get the value you need to write on the bus, you shift the address left by one, and add 1 if it is a read. So, if a device's documentation says it has slave address 0x2C, the address you'd put on the bus is 0x58 for write, 0x59 for read.