8
\$\begingroup\$

I was thinking about doing a modules for a development board I did a few days ago that will include spi/i2c interfaces.

The problem is that I didn't included pull-up resistors in the MCU pins in the main board and was thinking to add them in the modules to make them more "generic" so every user could use them without need to add extra resistors in the prototype board.

But then I faced the next problem. If I add the pull-up resistos in the extra modules and I connect for example two or more modules to the same bus I'll get those resistors in parallel so the resistance will drop and will not accomplish their function.

But if I add the pull-up resistors to the main board I'll have those pins in the MCU always as active low.

So the main question is:

How to have multiple modules connected to the same bus having on each of them the pull-up resistors but not get them in parallel when you've more than one module? Is that possible?

Or the best solution here is enable the pullup resistors in the MCU and don't inlcude them in the modules?

Thanks.-

\$\endgroup\$
  • \$\begingroup\$ Create separate module which will contain pull-up resistors only :) \$\endgroup\$ – Alexandr Zarubkin Mar 15 at 14:13
13
\$\begingroup\$

I'll assume that the total length of each of your buses is under 1 meter, which is typical for plain I2C and SPI. Also, the bus capacitance is within the spec.

There should be only one (1) set of pull-up resistors. As a result, the best place for them is on the main controller board. Don't put the pull-ups on the modules.

If you want to have pull-up in some cases and not have them in other cases.

  • Do not populate the pull-up resistors, when you don't need them.
  • Design the main controller board such that pull-ups are connected to the signal lines through jumpers. Remove the shorting blocks, when you don't need the pull-ups.

edit: Frankly, I think it's a mistake that Sparkfun puts pull-ups on I2C slave modules. Unfortunately, not everyone who buys modules realizes that excessive pull-up can be a problem. It would be nicer if the controller boards (instead of slave peripheral boards) had pull-ups with solder jumpers. Oh... Wait... Arduino doesn't carry the (optional) pull-ups (although perhaps it should). So, let's schlep pull-ups everywhere. Easier initial out-of-the-box experience. But add a few slave modules and the bus will stop working.

update (May 2015) :
- Related discussion in comments in another thread.
- In their recent modules, SparkFun began to add solder blob jumpers between Vcc and the I2C pull-up resistors (example). That allows to disconnect the pull-ups more easily.

update (Dec 2015) :
Similar questions about troubleshooting I2C with multiple modules keep popping up on message boards. Attempt at an extended general response.

\$\endgroup\$
  • \$\begingroup\$ Yes actually my case fwas for a example. For example all rtc modules sold in some stores are including the pullup resitors so... how to deal with those modules in that case. Thats why I marked in bold the main question. :) \$\endgroup\$ – Sein Oxygen May 4 '13 at 0:48
  • 1
    \$\begingroup\$ @SeinOxygen If you have modules with pull-up resistors, plus the controller with it's own pull-ups, then all these resistors will appear in parallel and present a stiffer pull-up (smaller resistance). Suppose, you have a total of 3x (three) 2.2kΩ resistors as pull-ups. The total pull-up resistance is 733Ω. That violates I2C spec. What to do? Remove the extra pull-ups from the modules (perhaps, they should not have been there in the first place). \$\endgroup\$ – Nick Alexeev May 4 '13 at 1:04
  • \$\begingroup\$ @SeinOxygen More on I2C pull-up values in this thread. \$\endgroup\$ – Nick Alexeev May 4 '13 at 1:05
4
\$\begingroup\$

One option is to use SIL or DIL resistor packs, and fit them in sockets on each module. When building a system with multiple modules, pull them out of every module except the last. This saves a little board space over jumpers.

Variations on this theme can include FET switches to connect or disconnect the resistors, controlled by a single jumper, or a spare pin on the connector (so that if another module is plugged in, the resistors are automatically disconnected)

\$\endgroup\$

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.