Post Go back to editing

Main Secondary I2C read configuration

Category: Software
Product Number: ADAU1463
Software Version: 4.7

I am encountering an issue while trying to configure the mainsecondary I2C interface (MP24/SCL, MP25/SDA) on my ADAU1467 to read from an external I2C device.

In my SigmaStudio project, I have an "I2C Continuous Read" block connected to a "DSP Readback" block. My goal is to continuously read data from a specific register on the external device.

The external I2C device has a 7-bit address of 0x40 (hexadecimal). According to the I2C protocol, for a read operation, the 8th bit of the address should be '1'. I need to read data from register 0x01 (hexadecimal) of this device.

However, when I monitor the I2C bus, I observe that the ADAU1467 is sending the device address 0x80 (hexadecimal). This corresponds to the 7-bit address 0x40 with the 8th bit as '0', indicating a write operation. Consequently, my external device is not responding as expected to a read request.

 

Could you please advise on why the ADAU1463 is sending a write address (0x80) when the "I2C Continuous Read" block is configured for reading from the device at address 0x40? Is there a specific setting or consideration within SigmaStudio or the ADAU1467's I2C configuration that I might be overlooking to ensure the correct read address (0x81) is transmitted?

Any insights or suggestions on how to resolve this issue would be greatly appreciated. Thank you for your time and assistance.

  • Hello Daares1,

    This is how I2C read works, this is a repeated start condition. Though you are reading a data from slave, you must say from which register (sub address) it should read from, in order to do that you have to write the sub-address, so now the sequence will be writing a chip address (R/W = 0), writing a sub address, now the repeated start, again write a chip address (R/W = 1), then read the data. I know my explanation is very poor. Please find the explanation below with a timing diagram.

    "In order to read from a slave, the master must first instruct the slave which register it wishes to read from. This is done by the master starting off the transmission in a similar fashion as the write, by sending the address with the R/W bit equal to 0 (signifying a write), followed by the register address it wishes to read from. Once the slave acknowledges this register address, the master will send a START condition again, followed by the slave address with the R/W bit set to 1 (signifying a read). This time, the slave will acknowledge the read request, and the master releases the SDA bus, but will continue supplying the clock to the slave. During this part of the transaction, the master will become the master-receiver, and the slave will become the slave-transmitter".

    Below is how I read a register value from the AD1938 codec on the ADAU1467 Eval board.

    The codec register address '4' has the value 0x40, so the read is successful.

    The additional register write at the top of my program is to split the I2C Master control port to different pins MP24, MP25. 

    You can find this register in the Multipurpose (MP pins) register's section.

    This is an additional information you may need since I have no idea about your SS schematic or hardware schematic, However, I can see you mentioned secondary I2C, so you must do this.

    Hope this helps!

    Regards,

    Harish

  • Thank you; this helps me a lot. I verified the process, and now I have the right answer from my slave device.