Electronic – i2cget works, but i2cdetect does not show the device

i2clinux

I'm working to bring up ADV7610 (similar to ADV7611) on a Linux based embedded system (TI AM5728 platform).

By all account, I think the Chip-Select, Reset and I2C bus are all configured correctly. There is not much to worry about the bus itself, as I have no problem communicating with other devices on the same bus.

The device is supposed to show up in 0x4c. Here is what I see when I run i2cdetect:

i2cdetect -y -r 0                                                                                                                                                                                      
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: 10 -- 12 -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- 22 -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- UU 3d 3e 3f 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- UU UU UU 5b -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --  

Nothing there on 0x4c.

However, when I use i2cget tool, it is responding correctly:

i2cget -y -f 0 0x4c 0xeb                                                                                                                                                                 
0x51
i2cget -y -f 0 0x4c 0xea
0x20

The hex values of 0x51 and 0x20 correspond correctly to the device ID as per the datasheet.

Here is the raw traffic trace of i2cdetect:

   i2cdetect-2043  [000] ....   619.790641: i2c_read: i2c-0 #0 a=04b f=0001 l=1                                                                                                                      [70/40604]
   i2cdetect-2043  [000] ....   619.790713: i2c_result: i2c-0 n=0 ret=-121     
   i2cdetect-2043  [000] ....   619.790820: i2c_read: i2c-0 #0 a=04c f=0001 l=1
   i2cdetect-2043  [000] ....   619.790892: i2c_result: i2c-0 n=0 ret=-121     
  a=053 f=0001 l=1
   .
   .
   .
   i2cdetect-2043  [000] ....   619.792347: i2c_result: i2c-0 n=0 ret=-121     
   i2cdetect-2043  [000] ....   619.792482: i2c_read: i2c-0 #0 a=054 f=0001 l=1
   i2cdetect-2043  [000] ....   619.792554: i2c_result: i2c-0 n=0 ret=-121     
   i2cdetect-2043  [000] ....   619.792662: i2c_read: i2c-0 #0 a=055 f=0001 l=1
   i2cdetect-2043  [000] ....   619.792734: i2c_result: i2c-0 n=0 ret=-121     
   i2cdetect-2043  [000] ....   619.792868: i2c_read: i2c-0 #0 a=056 f=0001 l=1
   i2cdetect-2043  [000] ....   619.792940: i2c_result: i2c-0 n=0 ret=-121     
   i2cdetect-2043  [000] ....   619.793048: i2c_read: i2c-0 #0 a=057 f=0001 l=1
   i2cdetect-2043  [000] ....   619.793120: i2c_result: i2c-0 n=0 ret=-121     
   i2cdetect-2043  [000] ....   619.793593: i2c_read: i2c-0 #0 a=05b f=0001 l=1
   i2cdetect-2043  [000] ....   619.793727: i2c_reply: i2c-0 #0 a=05b f=0001 l=1 [00]
   i2cdetect-2043  [000] ....   619.793732: i2c_result: i2c-0 n=1 ret=1   
   i2cdetect-2043  [000] ....   619.793844: i2c_read: i2c-0 #0 a=05c f=0001 l=1

What can might be going on here?

Best Answer

I have seen this before, with chips closely related to the ADV7610 and even other video chips from Analog Devices.

The chip considers a single I2C read operation as invalid, and it will not acknowledge the address for a read operation because no register address was written to it first.

The chip only responds to a I2C read operation, if it happens after writing a register address before the read.

As far as my memory serves, there must be no I2C stop condition between the end of register address write, and the I2C data read must happen with a repeated start condition.

The datasheet does mention that when invalid register address is used, it will not acknowledge the read operation. But it is not specifically explained anywhere that the sequence does not allow writing register address and reading of data in two separate operations, while it is more common that they are also supported as two separate operations.

Consider it as a special feature of the chip's I2C interface that must be known, documented and handled as required.