Difficulty with i2c level conversion from 3.3V to 1.8V - Page 1
Forum section: electronics / beginners

author: desertgreg
author_rank: Contributor
timestamp: October 06, 2023, 04:19:05 pm
content: I implemented a circuit to convert i2c signals from 3.3V to 1.8V (using examples). I'm testing the circuit by sending 3.3V i2c data in and then measuring the 1.8V i2c signals (with nothing else connected to the 1.8V output side currently if that matters). The wierd thing I can't figure out is when the 3.3V side is pulled low, the 1.8V side only goes down to 0.6V. Can someone explain why the 1.8V side doesn't get all the way to zero volts?This is my second try to get this fully working. On my first try I had a mosfet with a slightly higher Vgs so I thought this mosfet with Vgs of 1V would fix the problem but it didn't. Thanks!

author: madires
author_rank: Super Contributor
timestamp: October 06, 2023, 05:07:55 pm
content: It's V_f of the MOSFET's body diode.

author: desertgreg
author_rank: Contributor
timestamp: October 06, 2023, 05:53:55 pm
content: What I thought would happen (based on explanations I've read elsewhere) is that once the low side gets down to 0.6v (body diode voltage) the mosfet should turn on and then it would go down to 0V. Since its not doing that, does that mean the mosfet is not conducting?Here's the datasheet for the mosfet, I might not be interpreting it correctly:https://assets.nexperia.com/documents/data-sheet/PMF63UNE.pdfIt says the highest value for Vgsth is 1V so if source is 0.6V and G is 1.8V shouldn't the mosfet be allowing current to flow?

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 06, 2023, 06:39:46 pm
content: When the 3V3 side of the Fet is pulled low, it first pulls the 1V8 side low through the body diode of the FET. which explains why it goes to only 600mV.According to the datasheet, the threshold voltage of your Fet is between 450mV and 1V, so there should be enough gate voltage to open the fet and let Rdson "short" the body diode so the source goes lower again, but apparently that does not happen. So start with measuring what the actual gate to source voltage is when the 3V3 side is pulled low.I recommend to also put a fet on a breadboard or something and measure the actual threshold voltage when it turns on.Also, you should study the circuit further so yo fully understand how it (should) work. It's a quite clever trick from some Philips application note from 20 or so years ago.But also (again). margins and tolerances become more difficult to manage with such low voltages. It may be better to use a dedicate level translation IC for this low voltage bus. Or open the trick bag. Raise the gate a bit above the 1V8 level to shift the threshold when the Fet switches a little bit.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 06, 2023, 06:42:48 pm
content: Quote from: desertgreg on October 06, 2023, 05:53:55 pmYes, but what if your nominal 1V8 is only 1.65V in reality and you loose a bit of voltage over track resistance (can be both power or signal)

author: desertgreg
author_rank: Contributor
timestamp: October 06, 2023, 08:01:18 pm
content: Yeah, it must be right on the edge of working. The 1v8 can be seen in the high parts of the graph so its pretty close or over 1.8V. So there is a 1.2V difference between gate and source and it looks like every once in a while the mosfet actually starts conducting at least on the SDA signal. So the mosfet doesn't conduct at VGs=1.2V even though the datasheet has:VGSth gate-source threshold voltage min: 0.45 typ: 0.7 max: 1 V (Table 7, page 6).Am I reading that part of the datasheet wrong? I agree, after seeing how tempermental this is, I will probably use a dedicated IC for this part of the circuit. But it would be nice to finish understanding this too. Thanks for helping!

author: Peabody
author_rank: Super Contributor
timestamp: October 06, 2023, 08:30:38 pm
content: I guess the other possibility is that the mosfet has turned on but the SCL line is drawing so much current through the two pullup resistors, plus any other pullup resistors that may be on that line on either side, that its output-low voltage is now above ground by 0.6V. It might be worth testing 10K resistors just to see if it makes any difference.

author: Zero999
author_rank: Super Contributor
timestamp: October 06, 2023, 09:10:34 pm
content: Why are you using a MOSFET, rather than a BJT?A BJT would be better, because it has no body diode to worry about and will switch at 0.6V, without having to get special low threshold parts.

author: desertgreg
author_rank: Contributor
timestamp: October 06, 2023, 11:44:31 pm
content: The BJT circuit certainly looks promising. But when I recreated it Circuit Lab, when both sides are floating, they both get pulled to around 2.6V so that would be a problem for the 1.8V i2c side. (do you see that in your simulator?) I didn't come up with the mosfet circuit either, I'm just having some difficulty applying it to a 1.8V signal.

author: Zero999
author_rank: Super Contributor
timestamp: October 07, 2023, 01:00:12 pm
content: Quote from: desertgreg on October 06, 2023, 11:44:31 pmThat's because I mistakenly connected R2 to 3.3V, rather than 1.8V. I've corrected the schematic attached to my previous post.Here's a plot of the output using LTSpice.