ebeowulf17
- Joined Aug 12, 2014
- 3,307
This TI paper describing the I2C bus might be helpful:Hey,
Thanks for the quick replies. I see what you mean about the protocol and hardware being different. I'm not that good with encoding protocol libraries. The project involves 1 x master (esp32) and 3 x slaves (VL53LOX). Unfortunately the expressly use I2C. I was considering putting an Arduino nano on each of the LV53OX devices then use RS485, but I feel like, logic 'NOT' gates and opamps transmitting I2C would be more elegant, smaller and easier.
Sorry about the slow reply, I'm in Australia and sent the last message at my bed time.
I've drawn a rough diagram of what I was talking about. Let me know what you think. Sorry, I couldn't find NOT gates so I've tied the 2 inputs of some NAND gates to make them functional NOT gates.
View attachment 181270
http://www.ti.com/lit/an/slva704/slva704.pdf
Among other things, it describes how every I2C device uses open drain outputs to connect to both lines, with pull up resistors providing the high signal, and every device only having the ability to pull it low. Since no device is capable of driving line high, there's no risk of ever shorting a high output on one device and a low output on another.
Your scheme doesn't include pull up resistors, meaning it currently has no way to drive signals high. At first glance I don't see how to add those pull ups without interfering with the output resistors on your op amps. (I'm not saying there isn't a way to get it done, just that I'm not seeing it.) Basically I'm not seeing how each device can switch between driving the line and releasing the line in your scheme.
There may be a way to fix this into something workable, but I don't think you're there yet. If you read through the TI doc above, I think you'll see why.
Also, looks like SparkFun may have a ready-made solution for you that doesn't require more microcontrollers:
https://www.sparkfun.com/products/14589
I don't want to take away the fun of creating your own solution, which can be very satisfying, but if you just want to get the job done, these boards might do it. And of course if you don't want to pay someone else for their board layout, you can always just get the chips yourself and incorporate them into your design:
https://www.nxp.com/docs/en/data-sheet/PCA9615.pdf