Problem using TCA9548A

I'm trying to use an LCD display via a TCA9548A multiplexer because I will want to add other I2C devices. The display is fine when I link it directly to Arduino A4 and A5 but does nothing when I link it via the TCA9548A on any channel. Yes, I've checked all the wiring. It's now wired to SD2 and SC2, ie channel 2.
The code is:

//Simple I2C Test
#include <stdio.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
#include <Wire.h>                    // For I2C
#define TCAADDR 0x70                 // TCA9548A ddress
#define LiquidCrystal_I2C_ADDR 0x27

void setup() {
  Serial.begin(9600);  //don't know what this does
  screenBig();
}
void loop() {
}
void TCAselect(uint8_t i) {
  if (i > 7) return;
  Wire.beginTransmission(TCAADDR);
  Wire.write(1 << i);
  Wire.endTransmission();
}
void screenBig() {
  TCAselect(2);
  lcd.init();
  lcd.backlight();  
  lcd.begin(16, 2);
  lcd.setCursor(0,0);
  lcd.print("Hello World");
}

Any ideas what I'm doing wrong?

Since I2C is a shared bus and supports multiple devices at once, what's the purpose of adding the multiplexer?

The LCD displays I use have address selection pads that allow up to 8 LCD devices.
Which LCD display are you using? Does it have a driver board on the back that has a blue cube potentiometer?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.