~~NOCACHE~~ ====== lamaPLC: TCA9548A (HW617); Low-Voltage 8-Channel I²C Switch Module ====== {{ :sensor:tca9548a_2.png?180|TCA9548A (HW617)}} The TCA9548A device features eight bidirectional switches that can be controlled via the I²C bus. The upstream SCL/SDA pair connects to eight downstream channels. Any individual channel or combination of channels can be selected by programming the control register. These downstream channels resolve I²C target address conflicts. For example, if eight identical digital temperature sensors are required in the application, one sensor can be connected to each channel: 0-7. {{:sensor:tca9548a_3.png|TCA9548A (HW617)}} {{page>:tarhal}} ===== Technical data ===== * 1-to-8 Bidirectional translating switches * [[com:basic_i2c|I²C]] Bus and SMBus compatible * Active-low reset input * Three address pins, allowing up to eight TCA9548A devices on the I²C bus * Channel selection through an I2C Bus, in any combination * Power up with all switch channels deselected * Low RON switches * Allows voltage-level translation between 1.8V, 2.5V, 3.3V, and 5V buses * No glitch on power up * Supports hot insertion * Low standby current * Operating power-supply voltage range of **1.65 to 5.5 V** * 5-V Tolerant inputs * 0 to 400kHz Clock frequency * Latch-up performance exceeds 100mA per JESD 78, class II ===== Device Address ===== {{:sensor:tca9548a_4.png|TCA9548A (HW617) Device Address}} The last bit of the target address defines the operation (read or write) to be performed. When it is high (1), a read is selected, while a low (0) selects a write operation. Shows the TCA9548A address reference: {{:sensor:tca9548a_5.png|TCA9548A (HW617) Device Address}} ===== Arduino ===== To call the module, you only need the "wire" library. The code below scans the module, for example: /** * TCA9548 I2CScanner.ino -- I2C bus scanner for Arduino * * Based on https://playground.arduino.cc/Main/I2cScanner/ * */ #include "Wire.h" #define TCAADDR 0x70 void tcaselect(uint8_t i) { if (i > 7) return; Wire.beginTransmission(TCAADDR); Wire.write(1 << i); Wire.endTransmission(); } // standard Arduino setup() void setup() { while (!Serial); delay(1000); Wire.begin(); Serial.begin(115200); Serial.println("\nTCAScanner ready!"); for (uint8_t t=0; t<8; t++) { tcaselect(t); Serial.print("TCA Port #"); Serial.println(t); for (uint8_t addr = 0; addr<=127; addr++) { if (addr == TCAADDR) continue; Wire.beginTransmission(addr); if (!Wire.endTransmission()) { Serial.print("Found I2C 0x"); Serial.println(addr,HEX); } } } Serial.println("\ndone"); } void loop() { } More codes on the Adafruit website: https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/arduino-wiring-and-test ====== Source ====== https://www.ti.com/lit/ds/symlink/tca9548a.pdf ===== I²C topics on lamaPLC ===== {{topic>i2c}} \\ \\ {{tag>TCA9548A HW617 I2C switch communication expansion_board Arduino}} \\ This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}