"Joe G (Home)" <joe.g@optusnet.com.au> wrote in message
news:4b6fecc1$0$3003$afc38c87@news.optusnet.com.au...
> Hi All,
>
> SPI is more simplistic in internal IC hardware design than I2c. If the
> SPI data bus receive garbage (spikes or noise) you can pull the chip
> select high and start clocking the data in/out again.
>
> SPI has
> /CS chip select
> Clock
> Data out
> Data in
>
> I2C has
> Clock
> Data
>
> Question
> ========
> If an I2C bus receives garbage, how does one tell a I2C receiver to
> "reset" and start again, as there is only a clock and data line.
>
> Thanks in Advance.
>
> Joe
>
>
Thanks all for your comments.
Joe
Reply by Tilmann Reh●February 10, 20102010-02-10
Paul Carpenter schrieb:
>> >> The correct way to RESET the I2C buss, is to do a repeat-START, then a STOP.
>> >
>> > Please note that you simply can't apply a (repeated) start condition
>> > when a device continuously holds SDA low. In such cases, you first have
>> > to provide SCL pulses until SDA gets high again, then do start-stop.
>> >
>>
>> _If_ it lets go at all. I've seen cases where it didn't and a power
>> cycle was required :-(
>
> Especially if the slave device is doing a clock stretch, holding SCL low.
I have always carefully selected only such I2C slaves that don't do
clock stretching... :-)
Tilmann
Reply by Joerg●February 9, 20102010-02-09
Paul Carpenter wrote:
> In article <7tedm4Fam1U1@mid.individual.net>, invalid@invalid.invalid
> says...
>> Tilmann Reh wrote:
>>> don schrieb:
>>>
>>>> The correct way to RESET the I2C buss, is to do a repeat-START, then a STOP.
>>> Please note that you simply can't apply a (repeated) start condition
>>> when a device continuously holds SDA low. In such cases, you first have
>>> to provide SCL pulses until SDA gets high again, then do start-stop.
>>>
>> _If_ it lets go at all. I've seen cases where it didn't and a power
>> cycle was required :-(
>
> Especially if the slave device is doing a clock stretch, holding SCL low.
>
Sort of the eternal stretch :-)
I like SPI a lot more although I2C does have the advantage of being able
to hang it all onto the same serial bus. But that can at the same time
cause hang-ups while SPI never hung on me.
--
Regards, Joerg
http://www.analogconsultants.com/
"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply by Paul Carpenter●February 9, 20102010-02-09
In article <7tedm4Fam1U1@mid.individual.net>, invalid@invalid.invalid
says...
> Tilmann Reh wrote:
> > don schrieb:
> >
> >> The correct way to RESET the I2C buss, is to do a repeat-START, then a STOP.
> >
> > Please note that you simply can't apply a (repeated) start condition
> > when a device continuously holds SDA low. In such cases, you first have
> > to provide SCL pulses until SDA gets high again, then do start-stop.
> >
>
> _If_ it lets go at all. I've seen cases where it didn't and a power
> cycle was required :-(
> don schrieb:
>
>> The correct way to RESET the I2C buss, is to do a repeat-START, then a STOP.
>
> Please note that you simply can't apply a (repeated) start condition
> when a device continuously holds SDA low. In such cases, you first have
> to provide SCL pulses until SDA gets high again, then do start-stop.
>
_If_ it lets go at all. I've seen cases where it didn't and a power
cycle was required :-(
--
Regards, Joerg
http://www.analogconsultants.com/
"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply by Tilmann Reh●February 9, 20102010-02-09
don schrieb:
> The correct way to RESET the I2C buss, is to do a repeat-START, then a STOP.
Please note that you simply can't apply a (repeated) start condition
when a device continuously holds SDA low. In such cases, you first have
to provide SCL pulses until SDA gets high again, then do start-stop.
Tilmann
Reply by don●February 8, 20102010-02-08
Tilmann Reh wrote:
> Meindert Sprang schrieb:
>
>>> If an I2C bus receives garbage, how does one tell a I2C receiver to
>> "reset"
>>> and start again, as there is only a clock and data line.
>> By generating a premature stop condition.
>
> ...and if one of the devices eventually blocks the bus with SDA=low
> (this can happen when a read access is aborted), apply SCL pulses until
> SDA goes high.
>
> Tilmann
The correct way to RESET the I2C buss, is to do a repeat-START, then a STOP.
Works every time.
don
Reply by Tilmann Reh●February 8, 20102010-02-08
Meindert Sprang schrieb:
>> If an I2C bus receives garbage, how does one tell a I2C receiver to
> "reset"
>> and start again, as there is only a clock and data line.
>
> By generating a premature stop condition.
...and if one of the devices eventually blocks the bus with SDA=low
(this can happen when a read access is aborted), apply SCL pulses until
SDA goes high.
Tilmann
Reply by Meindert Sprang●February 8, 20102010-02-08
"Joe G (Home)" <joe.g@optusnet.com.au> wrote in message
news:4b6fecc1$0$3003$afc38c87@news.optusnet.com.au...
> Hi All,
>
> SPI is more simplistic in internal IC hardware design than I2c. If the
SPI
> data bus receive garbage (spikes or noise) you can pull the chip select
high
> and start clocking the data in/out again.
>
> SPI has
> /CS chip select
> Clock
> Data out
> Data in
>
> I2C has
> Clock
> Data
>
> Question
> ========
> If an I2C bus receives garbage, how does one tell a I2C receiver to
"reset"
> and start again, as there is only a clock and data line.
By generating a premature stop condition.
Meindert
Reply by Joe G (Home)●February 8, 20102010-02-08
Hi All,
SPI is more simplistic in internal IC hardware design than I2c. If the SPI
data bus receive garbage (spikes or noise) you can pull the chip select high
and start clocking the data in/out again.
SPI has
/CS chip select
Clock
Data out
Data in
I2C has
Clock
Data
Question
========
If an I2C bus receives garbage, how does one tell a I2C receiver to "reset"
and start again, as there is only a clock and data line.
Thanks in Advance.
Joe