2
\$\begingroup\$

I want to communicate between ATmega328P chips over I2C. I have found this bus extender which allows a max capacitance of 3000pF.

I found this data-wire, which has a mutual line capacitance of 25pf/ft @ 1kHz.

But I2C communication runs at 100kHz (by default). (How) can I calculate the line capacitance of this type of wire at 100kHz? Or in other words what is the maximum length I can span with this type of wire between two extenders?

\$\endgroup\$
3
  • \$\begingroup\$ how far do you want to go ? \$\endgroup\$ Feb 28, 2018 at 7:45
  • \$\begingroup\$ If you are looking for a mathematical answer, i would suggest this article, although its mainly about Pull-up resistors, there are formulas with which you could calculate Bus capacitance when Pullup resitance and frequency is given. \$\endgroup\$
    – Abel Tom
    Feb 28, 2018 at 7:54
  • \$\begingroup\$ I think I need max 20m between units, but total length of can be up to 50m (first to last device in the chain) \$\endgroup\$
    – mvermand
    Feb 28, 2018 at 12:44

3 Answers 3

5
\$\begingroup\$

Here are a couple of extracts from the P82B715 data sheet: -

enter image description here

Also note that line capacitance is a physical property of the wire and not related to operating frequency until you get into UHF or above: -

enter image description here

Cable picture source.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you Andy. I have tried to calculate the pF/feet for a 30AWG silicone rubber cable. The parameters are: (epsilon=3.5, core diameter=0.25mm, total diameter including insulator = 1.3mm). I get a capacitance of around 9pF/ft. Is that correction and do I need to multiple it by 2 to account for both I2C lines? \$\endgroup\$ Jan 16, 2022 at 9:47
  • \$\begingroup\$ Try comparing it with the specification for the cable. It should have a data sheet if it's from a reputable supplier. \$\endgroup\$
    – Andy aka
    Jan 16, 2022 at 10:23
  • \$\begingroup\$ it is not a reputable supplier but I'll think of getting one, thanks :) \$\endgroup\$ Jan 16, 2022 at 10:35
2
\$\begingroup\$

I have recently discovered that a full i2c master compensates for the capacitance. It comes at cost of bitrate, which slows down if the rising edges are too long. But other than that it works very nice to me.

https://www.i2c-bus.org/clock-stretching/ look for bandwidth paragraphs

Edit:

I2C anyway isn't meant to work for long distance. It's inter IC, hinting it's for a PCB level communication. For 20m it makes sense to use RS485 or RS422, or other differential lines. And proper filtering is required.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ I don't see how clock stretching would help in this case. Clock stretching is meant to give the slave some means to slow down the master if it can't keep up with processing the incoming data for example. \$\endgroup\$
    – Rev
    Feb 28, 2018 at 13:04
  • \$\begingroup\$ Clock stretching holds the internal counter until SCL rises to 1, with no timeout. That means, if the line capacitance is high, it will wait until clock is high as long as it takes. At cost of bandwidth. I have just tested it, works perfectly. O only can't know, is it implemented same way in your master. \$\endgroup\$
    – user76844
    Feb 28, 2018 at 13:07
  • \$\begingroup\$ To all people who don't see- check the facts. I don't care for your downvotes, but you prevent others from knowing more than yourself. \$\endgroup\$
    – user76844
    Feb 28, 2018 at 13:44
0
\$\begingroup\$

The pF/ft due to dielectric constant and gap will not change for I2C.

The 1kHz is just the verified test f.

3000 pF / 25 pF/ft = 120 ft. How far do you need to go?

It might drop a bit at 1GHz. but will never be used for that.

100 kHz has about 3 us max rise time with 0.4Vpp min swing at Vcm

Cable Capacitance limit is due to 3mA High Speed current limit.

3mA?=Ic=CdV/dt= 3000 * e^-12 * ?V/3e-6
Solve for V if interested which must be > 0.4V.

\$\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.