Topic

FAQ
Login Register
How to read IIC data when 2 devices are connected on one IIC line ?
Apr 04, 2024 16:02

/

A

/A

How to read IIC data when 2 devices are connected on one IIC line ?

* IIC initialize function :

    - i2c_master_init( Device 1 ID, speed)

    - i2c_master_init( Device 2 ID, speed)

* IIC read function : 

     - i2c_read_series(Address, addr_len, buffer, data_size)

           -> Is this read data from Device 1 or Device 2 ?


TL_Soyo Apr 07, 2024 13:59
0
/A

Hi,

  You need to differentiate between two i2c devices using an address


3 replies
TL_Soyo Apr 07, 2024 13:59
0
/A

Hi,

  You need to differentiate between two i2c devices using an address


JaeYong Lee [Author] Apr 15, 2024 16:15
0
/A

If I use two same devices(device id are different, addresses are same),

Should I run i2c_master_init() when I read data from each devices ?

examples)

i2c_master(Device ID1, speed);

i2c_read_series(Address, addr_len, buffer, data_size);


:


i2c_master_init(Device ID2, speed);

i2c_read_series(Address, addr_len, buffer, data_size);


:


i2c_master(Device ID1, speed);

i2c_read_series(Address, addr_len, buffer, data_size);


:


i2c_master_init(Device ID2, speed);

i2c_read_series(Address, addr_len, buffer, data_size);


: