I2C can reach up 1Mbps with fast mode+ and 3.4Mbps with High Speed mode. I just want to ask if it is possible to use 3.4Mbps mode with longer cable and what is the max. possible cable length.
-
2\$\begingroup\$ I'd suggest you avoid using I2C for long distances - bus lockup is a design feature, so unless you can mitigate this possibility you'll be plagued with problems. Keep I2C on the pcb. \$\endgroup\$– KartmanJul 20, 2022 at 12:36
-
1\$\begingroup\$ I used to have 100k~400kHz i2c wires between proto boards. My experience is that I should keep length less than 30cm (not 30m!), and not too many devices on the bus, with a total impedance of 400pF. \$\endgroup\$– tlfong01Jul 20, 2022 at 12:56
2 Answers
Doesn't seem to be possible. As Kartman suggested in his comment, you should avoid using I2C for long-distance communications. If it was possible a lot of other communication protocols wouldn't be invented or at least wouldn't be popular today, believe me.
Anyway, generally the pull-up resistor and the cable capacitance plays a huge role at maximum frequency. For on-board FM and FM+ 1k-ish pull-up resistors work fine but you can't use this value if the line capacitance is high. Just as an example, if you use a 30-m-long cable with a capacitance of 5pF / metre then a LPF with a cut-off frequency of ~1 MHz will be formed. This will affect the rise time and pulse shape of the signals. You can decrease the pull-up resistances but this will affect the transceiver's power dissipation and you don't want to exceed the max ratings.
If placing repeaters at every, say, 1 metre seems reasonable/practicle then you can use I2C FM+ at even kilometre-long communications.
No, it is not possible to use a 30m cable for FM+ or higher modes.
FM+ allows for 550pF of bus capacitance and HS mode allows for 100pF for 3.4 MHz and up to 400pF for up to 1.7 MHz.
It is unlikely that you can find a cable with such low capacitance that would allow for anything else than a couple of meters before the total bus capacitance, including PCB, connector and IC pin capacitance hits the limit and requires to slow down the communication speed.
I would estimate based on existing bus implementations such as DDC that 30m would be viable at maybe up to 100 kHz, as even if the standard requires certain rise times and bus capacitance, it allows longer rise times and higher capacitance which allows to slow down the clock.