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 ?
Hi,
You need to differentiate between two i2c devices using an address
@TL_Soyo
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);
:
Hi,
You need to differentiate between two i2c devices using an address
@TL_Soyo
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);
:
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);
: