Dear, @pb632146
You don't need to make extra channels in order to connect several slave devices to a single I2C master on the same SDA/SCL line. Rather, you use the I2C driver to programmatically control the slave addresses. This is a solution breakdown that is developer-friendly:
Single I2C Channel: Keep using the same hardware channel (LPI2C_1) in your configuration.
Manage Slave Addresses in Code:
The configuration tool is for initializing one channel with one default slave address (e.g., 0x39).
In your application code, switch between slave addresses dynamically using API calls provided by your I2C driver.
Dynamic Address Switching:
Use your I2C library or HAL to set the target slave address before sending or receiving data. For example, in an NXP SDK environment:
c
I2C_MasterStart(LPI2C_1, 0x38, kI2C_Write);
// Perform operations with slave at 0x38
I2C_MasterStop(LPI2C_1);
I2C_MasterStart(LPI2C_1, 0x39, kI2C_Write);
// Perform operations with slave at 0x39
I2C_MasterStop(LPI2C_1);
Shared Bus Handling:
Ensure that only one device communicates at a time, as all slaves are connected to the same bus. This is managed automatically if the protocol is followed correctly.
In short, you don't need multiple channels—just handle the slave address selection in your application code!