Background: I'm attempting to control a stepper driver (+5V logic) with an esp32 module (+3V3 logic). The A4988 datasheet claims to operate at +3V3. And indeed it did ... poorly. It works great at +5V. My idea was to add an I2C port expander (MCP2008) at +5V side then level-shift the [+3V3] I2C bus rather than level-shifting each of the 7 nets I need to operate the driver.
The Problem: Adding the MOSFET level shifts to the I2C bus causes one of my low-side I2C devices (MPU6050) to quit working. The other two low-side devices (SSD3-3306 OLED & WiiNunchuk) work as expected. The high-side port expander also works as expected. If I remove the level shift and run everything on +3V3 logic, then everything works. I suspect that this answer may apply here. But, I'm unsure why only 1 of 3 devices fails (all of which run at the MCU's logic level); and the one device with +5V logic also functions as expected.
I've tried multiple MPU6050s, multiple esp32s (adafruit's HUZZAH32 feather & Doit Devkit1), and multiple level-shift modules. All have the same result. I've also tried with different pull-up values: 2k2, 3k9, 4k7, and none (relying solely on the ones one the level-shift module). I should also mention I have the same results on my PCB version as the breadboarded version. Although even the PCB version does still rely on wires that I crimped myself, I did try ridiculously short wires (about 30mm) as well as swapping them between devices. I also tried without the OLED & Nunchuk devices. I tried the standard 100 kbit/s clock speed as well as the 400 kbit/s full speed.
The Question: I actually have two:
- Is there an easy fix or will I need an I2C specific level-shifting IC like the TCA980x?
- Can anyone explain why the MPU6050 has an issue with the BSS138 level-shift module sharing the I2C bus?