5
\$\begingroup\$

Im working on a display project and have run into some I2C issues. The display is of 3.3V design, so I figured, no big deal, ill use a level shifter and be on my merry way. Well, sure enough the level shifter kind of worked, at least it looked good, until i put the scope on it. I am was running with a low voltage of about 1.6V during the slaves ACK. The devices worked, but this is not in spec and I can't rely on this working across multiple devices. So, I'm wondering if anyone knows of a way to sink the extra current during the ACK while not effecting the input waveform from the master.

The display can only sink 1mA, but for the level shifter to work appropriately I need to sink the current from the high side pull ups as well as the low side, so about 2.5mA in the current setup.

I have tried using a pnp transitor with the slave device connected to the base and the low side of the level shifter connected to the emtiter with the collector across a current limiting resistor to ground. I then tied the emitter to the slave with a resistor. This worked to pull the ACK to about .1V, but the series resistor in line from the emitter to the display distorts the waveform from the master too much to be comfortable.

So, if anyone has any other ideas I would be greatful. Perhaps there is a purpose made solution that I can't google my way into.

\$\endgroup\$
  • 1
    \$\begingroup\$ Add more info, please: link to the level shifter datasheet, pullup resistor values. Circuit diagram and oscilloscope screenshot would improve the quality of your question further. \$\endgroup\$ – Nick Alexeev Dec 22 '12 at 5:50
  • \$\begingroup\$ (Though you don't have enough rep to post pictures, just post links to the pictures. Somebody with enough rep will inline them into your post.) \$\endgroup\$ – Nick Alexeev Dec 22 '12 at 5:53
  • \$\begingroup\$ At this juncture, best I can tell you is use a different level shifter. I2C is a bit too involved for a simple hack like I think you're suggesting due to the bi-directional and open-drain/collector nature of its signaling scheme. As @Nick suggested, if you post the link to your current shifter, perhaps we could assist further. \$\endgroup\$ – DrFriedParts Dec 22 '12 at 5:58
  • \$\begingroup\$ nick just post URL without the http \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Dec 22 '12 at 9:28
  • \$\begingroup\$ Thanks everyone, I went to sleep and woke up with alot of infor to look at which is amazing. To answer a few questions, the Translator I have is the PCA9306, and the master side is at 5V. \$\endgroup\$ – Marcus Dec 22 '12 at 15:42
1
\$\begingroup\$

Level shifters for I2C devices are easy to make if you know the correct technique. Remember that the I2C physical interface layer uses open drain type drivers designed to pull to GND. A pullup resistor is used to place the signal line into the high level when the driver stops pulling down.

Your question did not give enough information to be able to know what voltage you need on the opposite side of the translator from the display. For purposes of an example I'll show the circuit to use for translating from a 5V I2C swing to a 3.3V I2C at your display. You will need to make two of these circuits, one for the SDA line and one for the SCL line.

enter image description here

The BSS138 is an N-channel MOSFET. In this circuit configuration the drain (D) goes to the interface side with the higher voltage. Likewise the source (S) goes to the lower voltage side. We tie the gate (G) to the lower of the two interface voltage levels. A resistor is added to help protect the gate from transients on the voltage rail. The 0.1uF capacitor is very important so that the gate of the MOSFET does not get disturbed by capacitive coupling of transitions on the drain or source.

Note that the body diode of the MOSFET plays an important role in the operation of this circuit. If you try to use this circuit with voltage levels less than 3.3V it may be necessary to utilize a N-FET with a lower VGSth than the 1.5V threshold offered by the BSS138.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Will that work with 1mA sink current? Hey I see you helped develop Xtree Gold ** Kudos to you** I was QDOS ][ fan in the 80's forerunner to Xtree and then everyone else in Eng got onboard. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Dec 22 '12 at 7:59
  • \$\begingroup\$ I wasn't sure what the display side low drive voltage would be at 1mA with FET drop voltage. Not sure where/why OP had 1.6V drop but perhaps from over current on his level shifter. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Dec 22 '12 at 8:18
  • \$\begingroup\$ @Richman - We do this type of level shifter on server computer boards all the time. They are also used for isolators between 3.3V standby rail devices and other devices on the normal switched 3.3V DC supply rail. These FET type buffers are very practical as the dual FET needed to level shift or isolate an SMBus or I2C bus both come in once very tiny SOT-363 package. Add a few 0402 resistors and a capacitor or two and it works nicely. Obviously the drivers on each end of the bus need to be able to pulldown the current from the pullups on each side. It may require raising the resistor values. \$\endgroup\$ – Michael Karas Dec 22 '12 at 9:17
  • \$\begingroup\$ yes it looks fine .. was a bit worried about -40'C threshold near 2V and OPs 1mA drive limit sink the resistors at both ends exceeds 1mA and voltage margins suffer,. but for "ground benign" (military jargon) for indoor apps.... no problemo ( strike that worry with Concerned) What me worry? ;} I'm retired \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Dec 22 '12 at 9:24
  • \$\begingroup\$ I have tried this method of level shifting with the bsn20's, this resulted in a simla issue of the display not being able to sink enough current. I will look at the the BSS138 and compare it to the BSN20 and reconsider whats going on. Thanks for the advice on the gate resistor and cap. \$\endgroup\$ – Marcus Dec 22 '12 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.