10
\$\begingroup\$

My goal is to replace a DPST on pullup resistors with something simple, cheap and very small that can be activated with the I2C bus voltage. I thought that this might be a common enough requirement that I would find a simple IC for this task, but after hours searching through datasheets I am not finding a solution as ideal as my gut suggests should exist.

The question on how to Use GPIO for switchable Pullups of I2C has the basics of the thing I am trying to achieve on a very small PCB. I don't necessarily want to use a GPIO to turn the pullups on and off, my goal is flexibility of the design so the pullups could be turned on by a single jumper or a GPIO.

schematic

simulate this circuit – Schematic created using CircuitLab

Inspired by the Bus Pirate which does something similar using a CD4066BC, quad bilateral switch I found the TC7W66F, dual bilateral switch which vaguely fits my price and space goals but I imagined something similar to a SOT-23 package.

The question mentioned above has an answer suggesting using FETs and I did find some dual FET packages with source already tied together that seemed like they might work but I'm primarily a software guy and have to admit not feeling 100% comfortable using something like this without further advice, or if it would require further components killing my space desires?

\$\endgroup\$
6
  • 2
    \$\begingroup\$ Is there any reason why you have to use the switch at all and couldn't just connect the 'top' of each resistor to your I2C-PU point? \$\endgroup\$
    – brhans
    Commented Jan 20, 2016 at 0:48
  • \$\begingroup\$ @brhans, that works fine when you want the pullup, when you don't then you effectively have R1+R2 across your SDA and SCL lines which is not exactly desirable. \$\endgroup\$
    – DanSut
    Commented Jan 20, 2016 at 0:53
  • 4
    \$\begingroup\$ Why do you sometimes not want the pull-ups connected? I2C is pretty much designed around the pull-ups always being there. \$\endgroup\$
    – The Photon
    Commented Jan 20, 2016 at 1:00
  • \$\begingroup\$ @ThePhoton the PCB contains a couple of I2C components and can be plugged into other boards (where MCU and/or other I2C stuff live) that may or may not already be providing I2C pullup \$\endgroup\$
    – DanSut
    Commented Jan 20, 2016 at 1:03
  • 1
    \$\begingroup\$ @DanSut You would still have a problem when several breakout boards are plugged in and each has got pull-up resistors that are not under your control. Here's a write-up about this very issue. \$\endgroup\$ Commented Jan 20, 2016 at 1:08

4 Answers 4

16
\$\begingroup\$

I would suggest "prebiased" BJTs

Dual MOSFETs tend to have a lot of Drain-Source capacitance which will affect the rise time of your I2C bus. BJT switching transistors tend to have less. For example, these ones have Cob of only 3pF typically at 10V (it will be 2-3 times higher at low voltage, which they don't tell you and you're supposed to know) but that's still pretty modest. Add the pullup resistors to the collectors, the emitters to Vdd, and connect the bases to your /enable line and you're done (one part plus the resistors, and the package is only 2.0 x 2.1mm). Very cheap in volume, and not much worry about ESD.

enter image description here

schematic

simulate this circuit – Schematic created using CircuitLab


So why not MOSFETs?

They're lower resistance, right? Well the saturated BJTs will drop 50~100mV most likely at the currents you'll be using them (compares well with 4066 switches), and compare the output capacitance of an FDS6312P MOSFET (Coss)- typically several hundred pF near 0V, which is nearly as high as the 400pF maximum for all devices on the bus itself.

enter image description here

\$\endgroup\$
4
  • 3
    \$\begingroup\$ +1 for comparing the FET output capacitance to the I2C bus maximum. Well done. \$\endgroup\$
    – bitsmack
    Commented Jan 20, 2016 at 3:10
  • 3
    \$\begingroup\$ +1 Interesting comparison. Definitely worth considering over the MOSFETs. Given they have pretty much identical size/pinout you could do one design and have an easy choice as to which best suits the requirements. This approach would also eliminate any necessary pull-up resistor reducing the circuit down to just one component \$\endgroup\$ Commented Jan 20, 2016 at 3:21
  • 1
    \$\begingroup\$ I never even considered the capacitance factor so this answer is much appreciated in educating me. The CBT3306 switches I was looking at don't graph capacitance like this, so do I assume as they are built using FETs that I they will see the same issue in the way I'd be using them? \$\endgroup\$
    – DanSut
    Commented Jan 21, 2016 at 13:26
  • 2
    \$\begingroup\$ @DanSut Actually they don't look terrible at all 6.45pF typical at 3V, so still should be tolerable at low voltage (maybe ~20pF). Very low series impedance (5 ohms), but that's irrelevant here- not so if the switch is in series. The problem is that many dual MOSFETs are designed to have very low Rds(on) and to carry amperes of current, so they're ill-suited. It's not so much that MOSFETs are used (4066 are MOSFETs too) it's that they are big MOSFETs. You can think of them as scores of little MOSFETs in parallel so the resistance decreases with 1/n and the capacitance is proportional to n. \$\endgroup\$ Commented Jan 21, 2016 at 15:28
5
\$\begingroup\$

One option is two P-Channel MOSFETS. These can be connected as follows:

schematic

simulate this circuit – Schematic created using CircuitLab

Basically, if you use logic level MOSFETS you can feed the EN_n (not-enable) signal with +V volts to disable the pull-up resistors, and 0V to enable them. When disabled the resistors will essentially not be there. You will have body diodes from the I2C lines to V+, but those shouldn't cause any issue.

As @bitsmack points out, you could also add an optional pull-up resistor (R3) on the EN_n pin which would keep the MOSFETS disabled if the pin is left floating. This would allow the input to be open drain - simply short to ground to enable, or leave floating to disable.

It is possible to get very small (SOT23-6 or SOT23-5) packages which contain two P-Ch MOSFETS (e.g. this) which can then be wired up as shown above - usually they are arranged in ways which make routing quite simple. You can basically join the gates together and sources together making a very small essentially 4-pin package. Even if you throw in the pull-up resistor as say an 0603, the whole circuit would probably be smaller than a 2x2pin 0.1" jumper.

\$\endgroup\$
3
  • \$\begingroup\$ @dansut If you do this, I suggest putting a pullup resistor from each MOSFET's gate to V+... This way the I2C pullups won't turn on before your EN_n signal is asserted (i.e. before the microcontroller configures and asserts its pin state) \$\endgroup\$
    – bitsmack
    Commented Jan 20, 2016 at 2:16
  • \$\begingroup\$ @bitsmack one would do as the gates would be directly connected. I'll add it in to the circuit as it would mean that the whole thing could be controlled in an open drain kind of a way. \$\endgroup\$ Commented Jan 20, 2016 at 2:18
  • \$\begingroup\$ Yes, very true :) \$\endgroup\$
    – bitsmack
    Commented Jan 20, 2016 at 2:20
4
\$\begingroup\$

Practical approach

All the breakout boards I'm plugging together are under my control [...]

Keep it simple. Rip out the I2C pull-up resistors from every breakout board that you have. Install pull-up resistors with reasonable values on the microcontroller board.

my basic desire is to be able to turn-on the PU where I want it with a single jumper rather than 2

Trying to reduce the number of jumpers from 2 to one is lots of do beyond diminishing returns, if I may say so myself.

If a practical approach does not appeal

You can do something along the lines of active constant-current pull-up circuit.

active constant-current I2C pull-up

\$I=\cfrac{V_Z-0.65}{R_{307}}\$

\$R_{307}=R_{308}\$

Any general-purpose small-signal PNP transistor would do.

\$\endgroup\$
1
  • \$\begingroup\$ In the back of my mind I knew that I would probably get an answer like your practical one - I appreciate your answer and reasoning and it may be the direction I eventually take. Thanks also for providing the alternative, investigating this will undoubtably improve my knowledge in this area. \$\endgroup\$
    – DanSut
    Commented Jan 20, 2016 at 13:21
2
\$\begingroup\$

How about just using an I2C bus accelerator with an enable, like the LTC4300A-1 enter image description here

This can isolate parts of the bus, and is meant to do so. The downside is that you need your pullups on both sides. The upside is you wouldn't have to wonder!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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