Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #543076

Re: I2C cable

From Jan Panteltje <pNaOnStPeAlMtje@yahoo.com>
Newsgroups sci.electronics.design
Subject Re: I2C cable
Date 2019-05-12 07:10 +0000
Organization A noiseless patient Spider
Message-ID <qb8gu6$lpf$1@dont-email.me> (permalink)
References <qb40m902842@drn.newsguy.com> <qb44ki$r6l$1@dont-email.me> <GwKBE.13418$y65.5422@fx39.iad> <qb7vgs02cif@drn.newsguy.com>

Show all headers | View raw


 On a sunny day (11 May 2019 19:13:48 -0700) it happened Winfield Hill
<hill@rowland.harvard.edu> wrote in <qb7vgs02cif@drn.newsguy.com>:

>Clifford Heath wrote...
>>
>> Winfield Hill wrote:
>>>
>>> I miss-spoke, we're using an Atmel ARM SAM D21.
>>
>>> but datasheet says the I2C outputs have reduced
>>> slew-rates.   Hmm, the IO spec says 20-50ns with
>>> a 10 to 400pF load.  
>>
>> Presumably the slew-rate limiting depends on the
>> selected data rate, but the data sheet is pretty
>> quiet on that.
>
> Here's their spec, fall time, for 0.7 to 0.3 Vdd:
>
>                  typ  max
> Standard/Fast     20  50 ns
> Fast Mode +       15  50
> High Speed Mode   10  40
>
> Yes, it changes with speed setting, but not much.
> Slowest mode, dV/dt = 0.4 3.3V / 20ns = 66 mV/ns.
> I = C dV/dt, with 75pF, that's i = 5mA, during
> a 50ns transition.  This is what can kill using
> twisted-pair wires in a short USB cable.  If we
> have 75pF crosstalk with a 200pF load, that's
> still a 28% Vdd interference signal, which is
> smack on the 30% trouble threshold.  Why only
> slow to a fast 50ns transition with a 10us bit
> interval?  That's only 0.5%.  That's why I made
> more changes and added extra stuff.

The rise - and falltime spec has little meaning, because the i2c system works differently.

Data is sampled by the clock.
As long as you wait long enough after each transition, data will be stable,
and toggling the clock during stable data a million times due to oscillations in the transient will still read that data in correctly.

I always do i2c in software.
Some years ago I had this chip with a hardware i2c interface (was it a PIC? do not remember, yes I think it was),
and a datasheet that sounded really funny to me.
So did it in software as always and it worked perfectly
Sure enough in the chip errata the i2c hardware interface was mentioned as erratic, and fixed.

So here a 'shot' from a 2 channel i2c driver:
 http://www.panteltje.com/pub/iiclib.c
Note the IIC_BUS_DELAY, it is defined in iiclib.h:
 #define IIC_BUS_DELAY  1

But you can make it as long as you want (in case of lots of cable capacitance),
as long as transient oscillations are gone by the time you toggle the next I/O.
That is why
 busdly(IIC_BUS_DELAY);
is called afer each I/O pin change.
In fact on a Linux multitasker usleep() can change a lot....
 man usleep

On embedded use a loop, example PIC 18F code, iicbus delay:

iicdly:                             ; iic bus delay
    movlw   D'225'
    movwf   iic_delay_cnt
iicdly_loop:
    decfsz  iic_delay_cnt
    bra    iicdly_loop
    return

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-10 07:09 -0700
  Re:I2C cable Martin Rid <martin_riddle@verison.net> - 2019-05-10 10:25 -0400
    Re:I2C cable Martin Rid <martin_riddle@verison.net> - 2019-05-10 10:31 -0400
  Re: I2C cable "Tim Williams" <tiwill@seventransistorlabs.com> - 2019-05-10 10:16 -0500
    Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-10 09:02 -0700
      Re: I2C cable jrwalliker@gmail.com - 2019-05-10 10:13 -0700
        Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-10 10:50 -0700
          Re: I2C cable Steve Wilson <no@spam.com> - 2019-05-10 18:33 +0000
          Re: I2C cable upsidedown@downunder.com - 2019-05-10 23:21 +0300
            Re: I2C cable jrwalliker@gmail.com - 2019-05-10 14:22 -0700
              Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-10 15:00 -0700
                Re: I2C cable Lasse Langwadt Christensen <langwadt@fonz.dk> - 2019-05-11 06:01 -0700
                Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-11 07:04 -0700
                Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-11 14:23 -0700
                Re: I2C cable Rick C <gnuarm.deletethisbit@gmail.com> - 2019-05-11 15:02 -0700
                Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-11 15:18 -0700
                Re: I2C cable Rick C <gnuarm.deletethisbit@gmail.com> - 2019-05-11 15:43 -0700
                Re: I2C cable upsidedown@downunder.com - 2019-05-12 10:34 +0300
                Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-12 01:44 -0700
                Re: I2C cable Simon S Aysdie <gwhite@ti.com> - 2019-05-14 11:29 -0700
                Re: I2C cable Clifford Heath <no.spam@please.net> - 2019-05-12 11:19 +1000
                Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-11 19:13 -0700
                Re: I2C cable Clifford Heath <no.spam@please.net> - 2019-05-12 12:51 +1000
                Re: I2C cable Rick C <gnuarm.deletethisbit@gmail.com> - 2019-05-11 20:14 -0700
                Re: I2C cable Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-05-12 07:10 +0000
                Re: I2C cable Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-05-12 07:16 +0000
                Re: I2C cable Clifford Heath <no.spam@please.net> - 2019-05-12 19:38 +1000
                Re: I2C cable Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-05-12 12:10 +0000
                Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-12 06:20 -0700
                Re: I2C cable Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-05-12 14:05 +0000
                Re: I2C cable makolber@yahoo.com - 2019-05-13 10:20 -0700
              Re: I2C cable upsidedown@downunder.com - 2019-05-11 10:22 +0300
            Re: I2C cable "Tim Williams" <tiwill@seventransistorlabs.com> - 2019-05-10 17:22 -0500
              Re: I2C cable Rick C <gnuarm.deletethisbit@gmail.com> - 2019-05-10 15:32 -0700
                Re: I2C cable "Tim Williams" <tiwill@seventransistorlabs.com> - 2019-05-11 02:11 -0500
                Re: I2C cable Rick C <gnuarm.deletethisbit@gmail.com> - 2019-05-11 07:57 -0700
              Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-10 15:33 -0700
                Re: I2C cable Rick C <gnuarm.deletethisbit@gmail.com> - 2019-05-10 17:10 -0700
    Re: I2C cable John S <Sophi.2@invalid.org> - 2019-05-10 17:03 -0500
  Re: I2C cable Jasen Betts <jasen@xnet.co.nz> - 2019-05-11 05:25 +0000
    Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-11 05:08 -0700
      Re: I2C cable Martin Riddle <martin_ridd@verizon.net> - 2019-05-11 13:55 -0400
        Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-12 06:11 -0700
          Re: I2C cable Rick C <gnuarm.deletethisbit@gmail.com> - 2019-05-12 08:28 -0700
            Re: I2C cable "Tim Williams" <tiwill@seventransistorlabs.com> - 2019-05-13 18:07 -0500
              Re: I2C cable Winfield Hill <hill@rowland.harvard.edu> - 2019-05-14 02:19 -0700
  Re: I2C cable Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-05-11 14:36 +0000

csiph-web