TXS0108E Level shifter problems with I2C.

I am using the TXS0108E level shifter to connect I2C comms between a Teensy 4.1 master and an Arduino Nano slave.

I have damaged 2 Nano’s (dead SCL & SDA pins) and now trying to trouble shoot.

I have a couple of questions about ambiguities in the docs:

  1. The hookup guide says to disable the internal pullpup resistors in the connected devices, but it doesn’t clearly say why (or how). Is it possible that not disabling these resistors could kill the SCL/SDA pins in the nano?

  2. I have searched various forums and data sheets for how to disable the internal pull-up resistors as far as I can gather this is done by calling

Wire.begin(address); // wire begin as slave first

pinMode(SDA, INPUT); // set pins to input

pinMode(SCL, INPUT); // set pins to input

Is that sufficient? Is there anything that the other Wire transmit/receive functions do that will override these pinMode() calls? For example do I need to repeat this call pinMode() again after a transmit/recieve?

  1. The hookup guide mentions that the OE pin has to be tied to VA to enable the level shifter. But it doesn’t mention anything about when to do this. Should the OE pin be switched or permanently tied to VA? The hookup guide permanently ties it to Va but in the TXS0108E docs it mentions that for stable startup (Hi-Z) OE should initially be tied to ground.

Is it possible that the combination of OE permanently tied to VA and activated internal pullups in the NANO cause the SCL & SDA pins to experience an over current?

Would it be better to connect OE to a digital out on the Teensy and set it to low until all devices connected and powered up?

Running an Arduino Nano as a slave (peripheral), requires a completely different sketch/approach to instruct the Nano to react to the commands from the Teensy (master/controller). There are a number of articles about that. e.g. https://forum.arduino.cc/t/arduino-nano … ter/620844.

As for the OE (Output Enable), I would connect it constantly to VA as the Hookup guide mentions.

Thanks Paul. The Master/Slave code is already working, proven with a Mega as master without the level shifter. The code snippet above was missing the address as required in slave, edited now. Is that what triggered your response?

Any input on my other questions about the level shifter?

No need to do any pinMode commands when setting the slave. It is all handled by the Wire Library.

The slave code starts with adding the address to begin, to indicate running as slave/peripheral but also have :

Wire.onReceive(receiveEvent);
Wire.onRequest(sendEvent);

As for the level shifter, If the Arduino Nano has an ESP32 (there are many board called Arduino Nano), you should only have to down-level the MEGA TX to the Arduino RX from 5V to 3.3V. That can also be done with a bridge of 2 resistors.

Last remark: be aware that NOT all the boards/library support running in Slave mode.

The slave is already working. Tested without the level shifter with 5v master (Mega) and slave (Nano) microcontrollers. Wire.onReceive() Wire.onRequest() already working, that’s not the question.

The NANO is not the ESP32 version its a clone of the classic nano and its working in the setup without the level shifter.

The TXS0108E hookup guide recommends to disable the internal pullup resistors but doesn’t say how to do that.

Do not remove pull-up resistors. They are needed on the I2C lines and should be connected externally to the processor to both the SCL and the SDA line.

The I2c protocol is working with tri-state IO. Either the master or the slave can pull the SDA low to sent a ‘0’. But when they plan to send a ‘1’, they release the line and the pull-up resistor will pull the line high. The same is true for the SCL line, although the clock is only provided/ written by the master. The slave “reads” the SCL line.

Actually depending on how the TXS0108E works you might need to have pull-up resistors on BOTH the MEGA and the Nano

Why do you need a level shifter? Isn’t the Nano 5V on the IO port ?

The TXS0108E hookup guide recommends to disable the internal pullup resistors but doesn’t say how to do that. And I can’t find any other definitive guide as to how to do that.

(Level shifter is needed because the master is a Teensy41 (3.3v) and the slave is a Nano (5v). The TXS0108E has its own pull-up resistors on both sides so the protocol will work without the devices own internal pullups. Note, the internal pullups are way higher than the recommended resistance for I2C anyway)

Ah… forgot about the Teensy… indeed then it is needed. if the shifter has it’s pull-up resistors, no further action is needed normally. As long the sda/scl lines are short… higher resistor levels are not directly a problem.

I have not seen a Wire library that sets internal pull-up … always with external resistors…