8
\$\begingroup\$

Note : I am a beginner.

I noticed on the STM32-410RB datasheet page 100 (https://www.st.com/resource/en/datasheet/stm32f410rb.pdf), protection resistors were used in series on the SDA and SCL line. enter image description here

Further research showed that using protection resistors for devices connected to I2C is commonplace. How would I choose/calculate what resistor to to "protect devices" on the I2C bus or generally?

Could this method be: (input voltage - Forward voltage)/ Forward current ? This was the method I found for protecting and LED using a resistor in series, would this be the same for the I2C bus?

\$\endgroup\$

3 Answers 3

13
\$\begingroup\$

The series Rs resistors aren't for 'protection' pe se, the I2C spec notwithstanding (more about this below.) In any event, for Standard (100 KHz) and Fast (400 KHz) mode they're optional.

For the higher-speed I2C modes (1 and 3 Mbit) they are used as series damping to reduce ringing and thus improve signal integrity.

For that case, choose an Rs value such that the driver impedance (Rds(on)) and Rs together are roughly the same as the board trace impedance.

Typical Rs values are 22 to 33 Ohms, which when combined with the driver Rds(on) resistance, yields about 60-70 Ohms, a reasonably good match for typical trace routing.


MORE: The I2C spec states the reason for Rs is to suppress noise spikes, and that Rs is optional.

In reality, the limiting value for Rs depends on several factors:

  • Bus speed chosen
  • Max allowable risetime
  • Total bus capacitance
  • Strength of pull-up

The bigger your I2C bus (# devices, signal length), the stronger your pullup needs to be to overcome capacitance. Same with faster bus speed: to meet risetime, a stronger pullup is called for.

On the other hand, the driver Rds(on) resistance and Rs form a voltage divider with the pullup resistor Rpu. If Rs is made too large, the output low on the bus might not be low enough to meet the Vin(low) spec for the other devices on the bus. Design accordingly.

Finally, if ESD hardiness is a factor in your system (for example, if your I2C is going to a connector), don't rely on Rs to do this job. Instead, consider an I2C isolation device, and use TVS diodes on the lines for a more robust solution.

(Experience: set-top boxes with HDMI as well as on-board I2C.)

\$\endgroup\$
3
  • 1
    \$\begingroup\$ In the I2C specifications, they really are referred to as being series protection resistors. As an example the specification states that they protect the chips from high voltage spikes caused by CRT tube flash-over. It does show that Philips intended to use I2C devices inside TV sets. But you are right, they are handy for reducing ringing and reflections. \$\endgroup\$
    – Justme
    Jan 27, 2021 at 19:47
  • \$\begingroup\$ "Rpu (pullup), Rs and and the driver 'on' resistance, on the other hand, form a voltage divider." I am not entirely sure that Rs is in the picture here, at least if we assume that the input pin sinks little to no current, which is a safe bet in modern CMOS circuits. Would you add a schematic diagram supporting this point? \$\endgroup\$ Jan 28, 2021 at 13:07
  • 2
    \$\begingroup\$ The pin as an output sinks current. The driver Rds(on) + Rs forms an voltage divider with Rpu. This voltage is what the other devices see. \$\endgroup\$ Jan 28, 2021 at 15:51
5
\$\begingroup\$

Yes, current and voltage are the way to calculate these as per the I2C bus voltag and current specifications. Or more importantly, the voltage and current specs that the chips in your design have.

In practice you would open the I2C specifications to find a chart with some example values, or rather limits for maximum series resistance versus pull-up resistance.

The maximum series resistance value depends on the pull-up resistance values, and also bus capacitance.

In practice any value below 100 ohms should be fine. 22, 33 or 47 ohms should be quite typical values.

You may not even need the resistors at all so you could omit them, or use 0 ohm resistors. But in practice in a complex system with many I2C chips, they are really useful.

If you have the series resistors, it enables you to debug fault situations by disconnnecting a device from bus by temporarily removing the resistors. They also enable easy probing of the bus at the chip with an oscilloscope probe, if the chip has a very small pins. If the resistance is larger than 0 ohms, it also enables to probe which one or which all devices are pulling the bus low, as the current through the series resistor will develop a voltage over the resistor.

\$\endgroup\$
3
\$\begingroup\$

It all depends on your protection goal. From what voltage (or current) do you need protection? (e.g. 1000V?)

Typical (and well defined) scenarios are surge, burst or ESD protection. For these events, the serial protection resistors shown could be one piece of the solution, but you would need more than that (e.g. TVS diode).

Look up the max. allowed voltage and current for the I2C device in the datasheet. Your protection measures must satisfy these values for the defined protection goal.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ I have a frequent lock up condition when using I2C between two STM32F1* (also tried STM32411* and STM32446*): one controls motor directional relays & MOSFET power & the other sends motion commands & receives async state updates. If I disconnect the control line to the motor power (i.e. motor not powered) and trigger position sensors manually the I2C comms works flawlessly. With the motor enabled, mostly the async state updates are not received (neither CPU appears to freeze - just no comms until I reset the STM32 that is NOT directly controlling the motor). Would protection resisters help? \$\endgroup\$
    – Volksman
    Feb 22, 2021 at 4:35
  • 1
    \$\begingroup\$ Are the STMs both I2C master devices? I don‘t think that prot. resistors would help here. \$\endgroup\$ Feb 22, 2021 at 5:30
  • 2
    \$\begingroup\$ As an aside - I fixed the issue by placing a ferrite sleeve on each of the wires going to the motor! I haven't had a single I2C lock up or glitch since adding those. The ferrite sleeves seem to limit the current/EMF spikes in the wires going to the motor preventing them injecting noise on the I2C conductors. If I get some time I'll take them off again and try adding the protection resistors to see if they have the same effect (might be a cheaper option if I ever mass produce this thing). \$\endgroup\$
    – Volksman
    Feb 22, 2021 at 7:30
  • 1
    \$\begingroup\$ I have a full multi master mode where the natural state of any node is to listen in slave mode but if one wants to send an event (async) message they switch to master mode temporarily, send the message and then return to slave mode. I assumed the protection resistors worked equally well for nodes operating in either master or slave mode - they just seem to be added to the "node terminations" as a way of limiting ringing. Anyway - issue was fixed with ferrite sleeves over wires feeding current to the motor (see above comment). \$\endgroup\$
    – Volksman
    Feb 22, 2021 at 7:32

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.