From 7005310d612d9c19cccfa3e275ae47277aaeff6a Mon Sep 17 00:00:00 2001 From: DAVe3283 Date: Sun, 24 Aug 2025 17:41:44 -0400 Subject: [PATCH] =?UTF-8?q?Support=20different=20I=C2=B2C=20frequencies=20?= =?UTF-8?q?per=20channel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/components/tca9548a.md | 36 +++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/content/components/tca9548a.md b/content/components/tca9548a.md index 2914639ac9..e59be24dc3 100644 --- a/content/components/tca9548a.md +++ b/content/components/tca9548a.md @@ -9,24 +9,34 @@ params: The TCA9548A component allows you to use TCA9548A as a I²C multiplexer ([datasheet](https://www.ti.com/lit/ds/symlink/tca9548a.pdf), -`AdaFruit`_) in ESPHome. It uses [I²C Bus](#i2c) for communication. +[Adafruit](https://www.adafruit.com/product/2717)) in ESPHome. It uses [I²C Bus](#i2c) for communication. + +{{< img src="tca9548a.jpg" alt="Image" caption="tca9548a I2C Multiplexer." width="80.0%" class="align-center" >}} Once configured, you can use any of the 8 channels (TCA9548A) as separated channels for your projects. -Every Channel acts for all connected components as a virtual I²C Bus. +Each channel acts as a virtual I²C Bus for the connected components, and can be set to a different frequency than the main I²C bus. -{{< img src="tca9548a.jpg" alt="Image" caption="tca9548a I2C Multiplexer." width="80.0%" class="align-center" >}} +Please note that the main (upstream) I²C bus frequency will be temporarily changed to the frequency of the active channel, so the devices on the main bus must be able to gracefully handle all selected channel speeds! +This is usually not a problem if the channels are all the same or slower than the main bus. ```yaml +# Main I²C bus needs an ID so the multiplexer knows which upstream bus to use +i2c: + id: i2c0 + scl: SCL + sda: SDA + frequency: 400 kHz + # Example configuration entry tca9548a: - address: 0x70 - id: multiplex0 i2c_id: i2c0 channels: - bus_id: multiplex0channel0 channel: 0 - bus_id: multiplex0channel1 channel: 1 + frequency: 100 kHz # Individual I2C Devices sensor: @@ -36,17 +46,21 @@ sensor: ## Configuration variables -- **id** (**Required**, [ID](#config-id)): The id to use for this TCA9548A component. -- **address** (*Optional*, int): The I²C address of the Multiplexer. +- **id** (*Optional*, [ID](#config-id)): The ID for this TCA9548A component. + +- **address** (*Optional*, int): Manually specify the I²C address of the multiplexer. Defaults to `0x70`. -- **i2c_id** (*Optional*): The I²C Bus ID - Defaults to `false` +- **i2c_id** (**Required**, [ID](#config-id)): The upstream I²C bus ID to use. + +- **channels** (*Optional*): The virtual I²C bus channels + + - **bus_id** (**Required**, [ID](#config-id)): The id to use for this virtual I²C bus. -- **channels** (*Optional*): The I²C Bus Channels + - **channel** (**Required**): The channel (0-7) to use for this virtual I²C bus. - - **bus_id** (**Required**, [ID](#config-id)): The id to use for this virtual I2C Bus. - - **channel** (**Required**): The channel (0-7) to use for this virtual I2C Bus. + - **frequency** (*Optional*, float): The frequency for this virtual I²C bus. + Defaults to `0` (uses the main bus speed). ### See Also