Forums

I2C cable

Started by Winfield Hill May 10, 2019
jrwalliker@gmail.com wrote...
> > On Friday, 10 May 2019, upsid...@downunder.com wrote: > >> After all, 100 kHz is a quite low frequency. > > But the falling edges can be fast enough for transmission line > effects to be important when the cable is a few metres long. > Double clocking due to reflections makes a mess of i2c. > > Using the lowest possible pullup resistors or using active > pullup that approximates to a constant current clamped at > Vcc can help with noise immunity in the high state.
Right, John. Fast falling edges are worrisome. Even more-so, as I'm driving I2C with a fast STM processor. I regret my PCB doesn't have a place for source resistors, or anything (in this rev anyway). I'm using 10k pullups on each end (5k net), and added a spot on the PCB for an additional pullup resistor for SCL.** My flat P6C4 cable has SCL and SDA separated 80 mils, by power and ground. ** A newby on an EE forum claimed he got good results for 15m, with 10k for SDA, and 2k or somesuch, for SCL. -- Thanks, - Win
On 5/10/2019 10:16 AM, Tim Williams wrote:
> Just for lab use?� Or is this part of the flex or beehive question from > earlier? > > I'd be loathe to suggest anything not shielded at least in some > rudimentary way.� There are lots of styles of flat or round > multiconductor cable that would do, and then a regular header will do on > the end, or modular connectors if you like those.
Do you mean loath by any chance? Just being a bit pedantic.
<upsidedown@downunder.com> wrote in message 
news:bsmbded0mhgetsajtjm98k93vn8n6suj3a@4ax.com...
>> OK, John, yes, crosstalk is the big concern. And, hey, >> CAT5 is UTP, unshielded twisted-pair, not shielded. > > Why do you need shielding ? > > Put clock in one twisted pair, data in an other pair and Vdd/Gnd in > the third pair.
The signals themselves might not need shielding, but that ignores ambient noise. We're considering a clock signal here, so we need to be wary of fast changes from external sources. I2C is supposed to discard rapid changes -- interfaces are supposed to sample (at fairly high rate) and filter (to avoid noise), but, who knows. Not everyone follows the standard properly, y'know? Twisted pair, used in unbalanced mode, still helps relative to doing nothing at all, but it isn't much on immunity. Tim -- Seven Transistor Labs, LLC Electrical Engineering Consultation and Design Website: https://www.seventransistorlabs.com/
On Friday, May 10, 2019 at 6:22:09 PM UTC-4, Tim Williams wrote:
> <upsidedown@downunder.com> wrote in message > news:bsmbded0mhgetsajtjm98k93vn8n6suj3a@4ax.com... > >> OK, John, yes, crosstalk is the big concern. And, hey, > >> CAT5 is UTP, unshielded twisted-pair, not shielded. > > > > Why do you need shielding ? > > > > Put clock in one twisted pair, data in an other pair and Vdd/Gnd in > > the third pair. > > The signals themselves might not need shielding, but that ignores ambient > noise. We're considering a clock signal here, so we need to be wary of fast > changes from external sources. > > I2C is supposed to discard rapid changes -- interfaces are supposed to > sample (at fairly high rate) and filter (to avoid noise), but, who knows. > Not everyone follows the standard properly, y'know?
I thought I had read the standard once some time ago and don't recall that it is intended to be sampled like a UART. Is that literally in the spec or does it say some amount of noise is to be rejected and not seen as a start condition or clock edge? -- Rick C. - Get a 1,000 miles of free Supercharging - Tesla referral code - https://ts.la/richard11209
Tim Williams wrote...
> > The signals themselves might not need shielding, > but that ignores ambient noise. We're considering > a clock signal here, so we need to be wary of fast > changes from external sources.
Agreed, but I only have 24 to 36-inches of cable, and beehives are in electrically-quiet places. Also, it's OK if we occasionally get a bad data transmission. We'll see how it works out. -- Thanks, - Win
On Friday, May 10, 2019 at 6:33:46 PM UTC-4, Winfield Hill wrote:
> Tim Williams wrote... > > > > The signals themselves might not need shielding, > > but that ignores ambient noise. We're considering > > a clock signal here, so we need to be wary of fast > > changes from external sources. > > Agreed, but I only have 24 to 36-inches of cable, > and beehives are in electrically-quiet places. > > Also, it's OK if we occasionally get a bad data > transmission. We'll see how it works out.
Uh, be careful what you wish for. If you are using proper I2C it has a hang condition which the Intel SMBus doesn't since it includes a time out. I don't use I2C or SMBus so I can't say how significant this is, but Intel added the timeout for a reason. I assume your hives are relatively remote. How much impact will it have if you have to go to them once a month to reboot everything to unhang the I2C bus? -- Rick C. + Get a 1,000 miles of free Supercharging + Tesla referral code - https://ts.la/richard11209
On 2019-05-10, Winfield Hill <hill@rowland.harvard.edu> wrote:
> We need a 1-meter length of 100kHz (or slower) > I2C onnection. It'd be nice to use a pre-made > cable: micro-USB, 4-wire RJ11, or RJ45 ethernet. > Some considerations: SCL and SDA crosstalk(?), > high ground capacitance. Also need 3.3V, Gnd.
do you need UV resistant? weatherproof?
> Micro-USB: SCL and SDA twisted together, bad?
yes bad, maybe put SDA on white as SCL on red and +3 on green
> RJ11: flat, SCL and SDA on outside lines?
or SDA-0-scl-3.3 or RJ12 0-SDA-0-3.3-SCL-0
> RJ45: SCL and SDA shielded from each other.
meh. -- When I tried casting out nines I made a hash of it.
"Rick C" <gnuarm.deletethisbit@gmail.com> wrote in message 
news:0be3e775-67ce-4a39-891a-a2b9330fd7a5@googlegroups.com...
> > I thought I had read the standard once some time ago and don't recall that > it is intended to be sampled like a UART. Is that literally in the spec > or does it say some amount of noise is to be rejected and not seen as a > start condition or clock edge? >
It's been so long since I looked at the standard in that much detail. But some kind of minor filtering is required. A digital filter would be a typical implementation. If you have, say, MCU peripherals that require fairly high clocks relative to the data rate (i.e., "400kHz"), say a 16x or higher prescaler, that's probably what's being done. In a correct implementation, the "400kHz" isn't, it's just the average when everything is behaving as it should, activating and releasing SCK in a timely manner, and with pull-up, capacitance and rise time in spec. Tim -- Seven Transistor Labs, LLC Electrical Engineering Consultation and Design Website: https://www.seventransistorlabs.com/
On Fri, 10 May 2019 14:22:38 -0700 (PDT), jrwalliker@gmail.com wrote:

>On Friday, 10 May 2019 21:21:07 UTC+1, upsid...@downunder.com wrote: > >> After all, 100 kHz is a quite low frequency. > >But the falling edges can be fast enough for transmission line >effects to be important when the cable is a few metres long. >Double clocking due to reflections makes a mess of i2c.
The OP had only a 1 m long line, the two way CAT5 cable propagation delay is about 0.01 us. While the fall time can be short, the rise time with 400 pF stray capacitances is up to 1 us and according to the I2C standard, the signal must remain stable for 4 us. No doubt, each receiver must have some hysteresis (Schmitt trigger). In a missmatched line, the reflected signal causes over/ndershot.
> >Using the lowest possible pullup resistors or using active pullup >that approximates to a constant current clamped at Vcc can help with >noise immunity in the high state.
Use series termination on each node to tame the reflections.
> >John >
Jasen Betts wrote...
> > On 2019-05-10, Winfield Hill wrote: >> We need a 1-meter length of 100kHz (or slower) >> I2C onnection. It'd be nice to use a pre-made >> cable: micro-USB, 4-wire RJ11, or RJ45 ethernet. >> Some considerations: SCL and SDA crosstalk(?), >> high ground capacitance. Also need 3.3V, Gnd. > > do you need UV resistant? weatherproof?
It'd be nice, but otherwise I'll wrap everything with rubber mastic electrical tape, or some such.
>> Micro-USB: SCL and SDA twisted together, bad? > > yes bad, maybe put SDA on white as SCL on red > and +3 on green > >> RJ11: flat, SCL and SDA on outside lines? > > or SDA-0-scl-3.3 > > or RJ12: 0-SDA-0-3.3-SCL-0
This is my choice: RJ12 6P6C connector, except 3.3-SDA-3.3-0-SCL-0 (3.3 and 0 are equivalent) Flat 6P6C cables from Amazon, $4 each. An RJ12 connector at each end, series damping resistors. A bit of a kludge, but beehive clock is ticking.
>> RJ45: SCL and SDA shielded from each other. > > meh.
Mounted RJ45 connector, but too big, cable too stiff, unsure of how the shielded variant works. Went to smaller, simpler RJ12 instead. -- Thanks, - Win