Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions content/components/tca9548a.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down