Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

For large values of one, one equals two, for small values of two.


devel / comp.arch.embedded / Re: I2C Communication between two Microcontrollers

SubjectAuthor
* I2C Communication between two MicrocontrollersNeelakantappa M
+- Re: I2C Communication between two Microcontrollerspozz
+- Re: I2C Communication between two MicrocontrollersRichard Damon
`* Re: I2C Communication between two MicrocontrollersDavid Brown
 `* Re: I2C Communication between two Microcontrollerspozz
  `* Re: I2C Communication between two MicrocontrollersStephen Pelc
   +* Re: I2C Communication between two Microcontrollerspozz
   |+- Re: I2C Communication between two MicrocontrollersStef
   |`- Re: I2C Communication between two MicrocontrollersStephen Pelc
   `* Re: I2C Communication between two MicrocontrollersDavid Brown
    `* Re: I2C Communication between two Microcontrollerschris
     `* Re: I2C Communication between two MicrocontrollersDimiter_Popoff
      `* Re: I2C Communication between two MicrocontrollersRichard Damon
       `* Re: I2C Communication between two MicrocontrollersMike Perkins
        `- Re: I2C Communication between two MicrocontrollersRichard Damon

1
I2C Communication between two Microcontrollers

<9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=954&group=comp.arch.embedded#954

  copy link   Newsgroups: comp.arch.embedded
X-Received: by 2002:a05:6214:dca:b0:473:bde:8495 with SMTP id 10-20020a0562140dca00b004730bde8495mr970547qvt.40.1657027709860;
Tue, 05 Jul 2022 06:28:29 -0700 (PDT)
X-Received: by 2002:a81:794a:0:b0:31b:68c5:fd8f with SMTP id
u71-20020a81794a000000b0031b68c5fd8fmr40600329ywc.14.1657027709586; Tue, 05
Jul 2022 06:28:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.embedded
Date: Tue, 5 Jul 2022 06:28:29 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=203.192.251.4; posting-account=TFN5HQoAAAB82aI7kTO0hvx_fF9j3Z3p
NNTP-Posting-Host: 203.192.251.4
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
Subject: I2C Communication between two Microcontrollers
From: neelakan...@gmail.com (Neelakantappa M)
Injection-Date: Tue, 05 Jul 2022 13:28:29 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 2
 by: Neelakantappa M - Tue, 5 Jul 2022 13:28 UTC

I want to test the I2C protocol between two STM32 (STM32L152RC) microcontrollers. Can somebody guide me on how to do it or suggest tutorials?

I have seen some online portals where they are communicating between a microcontroller and any sensor. That I have done already. Now I want to test it between two MCU boards.

Re: I2C Communication between two Microcontrollers

<ta1hej$3nols$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=955&group=comp.arch.embedded#955

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: pozzu...@gmail.com (pozz)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Tue, 5 Jul 2022 16:22:12 +0200
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <ta1hej$3nols$1@dont-email.me>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 5 Jul 2022 14:22:11 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b810731ceca625d0ccf20f4eb9c8109c";
logging-data="3924668"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19A9FqArTeJYfAqGTrPrhfyH+x6oQIEcTA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:lwMNZmV9/PB7emosPEK9+uqn2VY=
In-Reply-To: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
 by: pozz - Tue, 5 Jul 2022 14:22 UTC

Il 05/07/2022 15:28, Neelakantappa M ha scritto:
> I want to test the I2C protocol between two STM32 (STM32L152RC) microcontrollers. Can somebody guide me on how to do it or suggest tutorials?
>
> I have seen some online portals where they are communicating between a microcontroller and any sensor. That I have done already. Now I want to test it between two MCU boards.

I don't know very well these MCUs, but I think ST ecosystem gives you
all the examples that you need to start understanding I2C communication
between two MCUs.

Of course, you need an example of master I2C and an example of slave I2C.

Re: I2C Communication between two Microcontrollers

<xv6xK.388849$X_i.114294@fx18.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=956&group=comp.arch.embedded#956

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.11.0
Subject: Re: I2C Communication between two Microcontrollers
Content-Language: en-US
Newsgroups: comp.arch.embedded
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
From: Rich...@Damon-Family.org (Richard Damon)
In-Reply-To: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 8
Message-ID: <xv6xK.388849$X_i.114294@fx18.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 5 Jul 2022 22:33:01 -0400
X-Received-Bytes: 1430
 by: Richard Damon - Wed, 6 Jul 2022 02:33 UTC

On 7/5/22 9:28 AM, Neelakantappa M wrote:
> I want to test the I2C protocol between two STM32 (STM32L152RC) microcontrollers. Can somebody guide me on how to do it or suggest tutorials?
>
> I have seen some online portals where they are communicating between a microcontroller and any sensor. That I have done already. Now I want to test it between two MCU boards.

The key is (at least) one of the MCU's needs a I2C driver that responds
as a slave device. Then the other one, the master, can send a I2C
command and possibly get an answer.

Re: I2C Communication between two Microcontrollers

<ta3b8u$3vja9$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=957&group=comp.arch.embedded#957

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Wed, 6 Jul 2022 08:49:01 +0200
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <ta3b8u$3vja9$1@dont-email.me>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 6 Jul 2022 06:49:02 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b1ce37694be6cb9f6c25bb05e155ed80";
logging-data="4181321"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZxoUODtK86jwSPLn0EtYKgWXTichCv2Y="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:2iaVnqXz4sFQSgMWWmV+UN0LCnY=
In-Reply-To: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Wed, 6 Jul 2022 06:49 UTC

On 05/07/2022 15:28, Neelakantappa M wrote:
> I want to test the I2C protocol between two STM32 (STM32L152RC)
> microcontrollers. Can somebody guide me on how to do it or suggest
> tutorials?
>
> I have seen some online portals where they are communicating between
> a microcontroller and any sensor. That I have done already. Now I
> want to test it between two MCU boards.

I am always a little sceptical about using I²C between microcontrollers,
and a lot more sceptical about using it between boards. It can be good
enough in simple cases, but all too often I have seen systems that
started out simple, and ended up trying to do far too much with I²C.

It is a protocol that works well with a microcontroller as the master
communicating with slow slave devices (simple ADC/DACs, small EEPROMs,
etc.) on the same board. It works poorly when you need more data
transfer or higher speeds, and can be quite inefficient on many
microcontrollers when they are acting as slaves.

It is also less than ideal for off-board traffic. For short range, with
closely coupled ground and little electrical noise, it can work fine -
but it does not work well over longer distances, and multi-master (or
even multi-slave, with microcontroller slaves) can be very awkward. I
have seen systems where I²C has been used for bigger inter-card buses,
and the effort required to make it stable, noise-free and reliable meant
it was more costly and complex than alternatives such as CAN or RS-485
would have been.

So my advice here is to think about where you are going in the future.
I²C might be the most convenient protocol between two cards on your
desk. But will it be the best choice for the final product - or its
future versions? Obviously only you can answer that, but if it is not,
then it is better to think about it now than later.

Re: I2C Communication between two Microcontrollers

<ta3evo$3vtt1$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=958&group=comp.arch.embedded#958

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: pozzu...@gmail.com (pozz)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Wed, 6 Jul 2022 09:52:23 +0200
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <ta3evo$3vtt1$1@dont-email.me>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
<ta3b8u$3vja9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 6 Jul 2022 07:52:24 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="9a634652af3ab5f67f5cc6b4ef355483";
logging-data="4192161"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rSrEZxhCkxNHqW2EPBZeGEcd3+0ERLiA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:wn9R/FgkHR4+Cb3JTskNXW5hgww=
In-Reply-To: <ta3b8u$3vja9$1@dont-email.me>
 by: pozz - Wed, 6 Jul 2022 07:52 UTC

Il 06/07/2022 08:49, David Brown ha scritto:
> On 05/07/2022 15:28, Neelakantappa M wrote:
>> I want to test the I2C protocol between two STM32 (STM32L152RC)
>> microcontrollers. Can somebody guide me on how to do it or suggest
>> tutorials?
>>
>> I have seen some online portals where they are communicating between
>> a microcontroller and any sensor. That I have done already. Now I
>> want to test it between two MCU boards.
>
> I am always a little sceptical about using I²C between microcontrollers,
> and a lot more sceptical about using it between boards.  It can  be good
> enough in simple cases, but all too often I have seen systems that
> started out simple, and ended up trying to do far too much with I²C.
>
> It is a protocol that works well with a microcontroller as the master
> communicating with slow slave devices (simple ADC/DACs, small EEPROMs,
> etc.) on the same board.  It works poorly when you need more data
> transfer or higher speeds, and can be quite inefficient on many
> microcontrollers when they are acting as slaves.
>
> It is also less than ideal for off-board traffic.  For short range, with
> closely coupled ground and little electrical noise, it can work fine -
> but it does not work well over longer distances, and multi-master (or
> even multi-slave, with microcontroller slaves) can be very awkward.  I
> have seen systems where I²C has been used for bigger inter-card buses,
> and the effort required to make it stable, noise-free and reliable meant
> it was more costly and complex than alternatives such as CAN or RS-485
> would have been.
>
> So my advice here is to think about where you are going in the future.
> I²C might be the most convenient protocol between two cards on your
> desk.  But will it be the best choice for the final product - or its
> future versions?  Obviously only you can answer that, but if it is not,
> then it is better to think about it now than later.

I agree with David for all points, considering that I2C and UART need
both only two pins (at least for single master and single slave) and
that modern MCUs most probably can configure pins for I2C or UART.

Moreover I add I hate I2C even for simple slave devices, such as EEPROM
or ADCs/DACs. I prefer much more a simple SPI, even if I have to waste a
pin for every slave.

I found that I2C peripherals embedded in most of MCUs are very complex
and most of the time they aren't reliable.
After some testing, I usually decide to write a bit-banging I2C code.

Re: I2C Communication between two Microcontrollers

<ta3h2e$47a$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=959&group=comp.arch.embedded#959

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: step...@vfxforth.com (Stephen Pelc)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Wed, 6 Jul 2022 08:27:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <ta3h2e$47a$1@dont-email.me>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com> <ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 6 Jul 2022 08:27:59 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="62af9d0a9a6f4a5b9ee30aa46d1b0196";
logging-data="4330"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ZoKpuSeKlBnPEERdGDdDh"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:TQ2kshu2s2eQ5dmTLFgxrOqwcX4=
X-Usenapp: v1.22/l - Full License
 by: Stephen Pelc - Wed, 6 Jul 2022 08:27 UTC

On 6 Jul 2022 at 09:52:23 CEST, "pozz" <pozzugno@gmail.com> wrote:

> I found that I2C peripherals embedded in most of MCUs are very complex
> and most of the time they aren't reliable.
> After some testing, I usually decide to write a bit-banging I2C code.

I have to agree here. I2C is conceptually simple, bu it is an edge triggered
protocol and is very sensitive to noise unless you use buffer devices. It
is excellent for master devices, but writing the slave software is much more
complex to cover all cases.

A client of ours carefully wrote hardware drivers for their CPUs and put
them on test. They saw one failure every hour or so. They then reverted
to the bit-bang drivers supplied by us with the compiler. No failures in two
weeks.

I have looked at these problems every few years or so, and the problem
for hardware drivers has always been fast noise pulses on the I2C lines.
By fast I mean up to several 10s of nanoseconds at a volt or so.

On the other hand we once did a hospital autoclave for which all I/O was
over I2C and it was rock solid ... but we used the recommended buffer
chips everywhere.

Stephen
--
Stephen Pelc, stephen@vfxforth.com
MicroProcessor Engineering, Ltd. - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, +44 (0)78 0390 3612, +34 649 662 974
http://www.mpeforth.com - free VFX Forth downloads

Re: I2C Communication between two Microcontrollers

<ta3k53$dh4$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=960&group=comp.arch.embedded#960

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: pozzu...@gmail.com (pozz)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Wed, 6 Jul 2022 11:20:34 +0200
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <ta3k53$dh4$1@dont-email.me>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
<ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me>
<ta3h2e$47a$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 6 Jul 2022 09:20:35 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="9a634652af3ab5f67f5cc6b4ef355483";
logging-data="13860"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18e369Yor+IDW57r0hBJmoWRLi+9rvcdxw="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:HDSERhu40QlNUS8Dthv23S7DHvM=
In-Reply-To: <ta3h2e$47a$1@dont-email.me>
 by: pozz - Wed, 6 Jul 2022 09:20 UTC

Il 06/07/2022 10:27, Stephen Pelc ha scritto:
> On 6 Jul 2022 at 09:52:23 CEST, "pozz" <pozzugno@gmail.com> wrote:
>
>> I found that I2C peripherals embedded in most of MCUs are very complex
>> and most of the time they aren't reliable.
>> After some testing, I usually decide to write a bit-banging I2C code.
>
> I have to agree here. I2C is conceptually simple, bu it is an edge triggered
> protocol and is very sensitive to noise unless you use buffer devices.

Sorry for my stupid question, what do you mean with buffer devices?
When you have master and slave on the same board, you put a wire between
SDA/SCL pins and a couple of pull-up resistors.

> It
> is excellent for master devices, but writing the slave software is much more
> complex to cover all cases. >
> A client of ours carefully wrote hardware drivers for their CPUs and put
> them on test. They saw one failure every hour or so. They then reverted
> to the bit-bang drivers supplied by us with the compiler. No failures in two
> weeks.

Same for me. I2C hardware peripherals don't add any pro against a
bit-bang solution (I'm talking always for masters), at least if you
write blocking code that waits for the end of I2C transaction.

> I have looked at these problems every few years or so, and the problem
> for hardware drivers has always been fast noise pulses on the I2C lines.
> By fast I mean up to several 10s of nanoseconds at a volt or so.

Yes, I think one solution is to reset and reconfigure the peripheral (if
possible) when the software detects some problems.

> On the other hand we once did a hospital autoclave for which all I/O was
> over I2C and it was rock solid ... but we used the recommended buffer
> chips everywhere.

Again, what are buffer chips?

Re: I2C Communication between two Microcontrollers

<ta3m05$ilp$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=961&group=comp.arch.embedded#961

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Wed, 6 Jul 2022 11:52:05 +0200
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <ta3m05$ilp$1@dont-email.me>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
<ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me>
<ta3h2e$47a$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 6 Jul 2022 09:52:05 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b1ce37694be6cb9f6c25bb05e155ed80";
logging-data="19129"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197GtLDeM5p6LNU86AvN9Cq6NEyFpf9R2I="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:gHZQZeVVNdtCzfCCLd36SlQw92g=
In-Reply-To: <ta3h2e$47a$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Wed, 6 Jul 2022 09:52 UTC

On 06/07/2022 10:27, Stephen Pelc wrote:
> On 6 Jul 2022 at 09:52:23 CEST, "pozz" <pozzugno@gmail.com> wrote:
>
>> I found that I2C peripherals embedded in most of MCUs are very complex
>> and most of the time they aren't reliable.
>> After some testing, I usually decide to write a bit-banging I2C code.
>
> I have to agree here. I2C is conceptually simple, bu it is an edge triggered
> protocol and is very sensitive to noise unless you use buffer devices. It
> is excellent for master devices, but writing the slave software is much more
> complex to cover all cases.
>

A key problem for I²C is the multi-drop nature of the lines. The edges
themselves are not the big problem, it is the weak pull-up that leaves
the lines very susceptible to noise and interference. SPI has edges, as
do most protocols with a clock signal, but there the master drives high
and low, giving a far more "solid" line.

I²C can be fine in simple cases, but there are several less-used
features that complicate it, especially when used together. That
includes multi-master, clock stretching, 10-bit addressing, and newer
faster speeds. Good luck trying to make a microcontroller slave that
works with all of that!

There is also the possibility of bus hang and invalid states. This can
hit you during development - if you stop your microcontroller and
restart it (perhaps with a new program version) in the middle of an I²C
transaction, you can leave the slaves stuck - they may need a reset or
power-cycle to recover.

Re: I2C Communication between two Microcontrollers

<nnd$00375316$163e44df@409ca85c28816895>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=962&group=comp.arch.embedded#962

  copy link   Newsgroups: comp.arch.embedded
Newsgroups: comp.arch.embedded
From: me...@this.is.invalid (Stef)
Subject: Re: I2C Communication between two Microcontrollers
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
<ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me>
<ta3h2e$47a$1@dont-email.me> <ta3k53$dh4$1@dont-email.me>
Mail-Copies-To: nobody
User-Agent: slrn/1.0.3 (Linux)
Message-ID: <nnd$00375316$163e44df@409ca85c28816895>
Organization: Newsxs
Date: Wed, 06 Jul 2022 13:43:17 +0200
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp003.abavia.com!news.newsxs.nl!not-for-mail
Lines: 33
Injection-Date: Wed, 06 Jul 2022 13:43:17 +0200
Injection-Info: news.newsxs.nl; mail-complaints-to="abuse@newsxs.nl"
X-Received-Bytes: 2093
 by: Stef - Wed, 6 Jul 2022 11:43 UTC

On 2022-07-06 pozz wrote in comp.arch.embedded:
> Il 06/07/2022 10:27, Stephen Pelc ha scritto:
>> On 6 Jul 2022 at 09:52:23 CEST, "pozz" <pozzugno@gmail.com> wrote:
>>
>>> I found that I2C peripherals embedded in most of MCUs are very complex
>>> and most of the time they aren't reliable.
>>> After some testing, I usually decide to write a bit-banging I2C code.
>>
>> I have to agree here. I2C is conceptually simple, bu it is an edge triggered
>> protocol and is very sensitive to noise unless you use buffer devices.
>
> Sorry for my stupid question, what do you mean with buffer devices?
> When you have master and slave on the same board, you put a wire between
> SDA/SCL pins and a couple of pull-up resistors.

Try a google search for "I2C buffer". ;-)

There are plenty.

I would not choose I2C for connection between 2 parts of a device, but
we have an existing device that uses I2C over a 2 meter cable and that
works quite well. There is an I2C multiplexer (PCA9548A) in the remote
part to select one of 8 I2C devices. (all same, so same adresses, so
cannot use adressing to select a device). This device uses this buffer
on both sides of the cable:

https://www.ti.com/product/P82B96

--
Stef

I want another RE-WRITE on my CEASAR SALAD!!

Re: I2C Communication between two Microcontrollers

<ta4atm$2mqt$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=963&group=comp.arch.embedded#963

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!news.freedyn.de!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: step...@vfxforth.com (Stephen Pelc)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Wed, 6 Jul 2022 15:49:11 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <ta4atm$2mqt$1@dont-email.me>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com> <ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me> <ta3h2e$47a$1@dont-email.me> <ta3k53$dh4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 6 Jul 2022 15:49:11 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="62af9d0a9a6f4a5b9ee30aa46d1b0196";
logging-data="88925"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19THYfSxNFREuxav3mgzo/6"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:6MtOUemex22dOSvVRXvwNRzJUHc=
X-Usenapp: v1.22/l - Full License
 by: Stephen Pelc - Wed, 6 Jul 2022 15:49 UTC

On 6 Jul 2022 at 11:20:34 CEST, "pozz" <pozzugno@gmail.com> wrote:

>> On the other hand we once did a hospital autoclave for which all I/O was
>> over I2C and it was rock solid ... but we used the recommended buffer
>> chips everywhere.
>
> Again, what are buffer chips?

When the distance is further than normal (see spec) or the environment
is very electrically noisy, you need buffer chips to eliminate/reduce
noise problems, e.g.
https://www.nxp.com/products/interfaces/ic-spi-i3c-interface-devices/ic-bus-repeaters-hubs-extenders:MC_41849

In the autoclave, there were a number of switched mains devices.

The other application was in a powered railway carriage.

Stephen
--
Stephen Pelc, stephen@vfxforth.com
MicroProcessor Engineering, Ltd. - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, +44 (0)78 0390 3612, +34 649 662 974
http://www.mpeforth.com - free VFX Forth downloads

Re: I2C Communication between two Microcontrollers

<ta7129$1vbf$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=964&group=comp.arch.embedded#964

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!jazQyxryRFiI4FEZ51SAvA.user.46.165.242.75.POSTED!not-for-mail
From: chris-no...@tridac.net (chris)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Thu, 07 Jul 2022 17:19:21 +0100
Organization: Aioe.org NNTP Server
Message-ID: <ta7129$1vbf$1@gioia.aioe.org>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com> <ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me> <ta3h2e$47a$1@dont-email.me> <ta3m05$ilp$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="64879"; posting-host="jazQyxryRFiI4FEZ51SAvA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; SunOS sun4u; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: chris - Thu, 7 Jul 2022 16:19 UTC

On 07/06/22 10:52, David Brown wrote:
> On 06/07/2022 10:27, Stephen Pelc wrote:
>> On 6 Jul 2022 at 09:52:23 CEST, "pozz" <pozzugno@gmail.com> wrote:
>>
>>> I found that I2C peripherals embedded in most of MCUs are very complex
>>> and most of the time they aren't reliable.
>>> After some testing, I usually decide to write a bit-banging I2C code.
>>
>> I have to agree here. I2C is conceptually simple, bu it is an edge
>> triggered
>> protocol and is very sensitive to noise unless you use buffer devices. It
>> is excellent for master devices, but writing the slave software is
>> much more
>> complex to cover all cases.
>>
>
> A key problem for I²C is the multi-drop nature of the lines. The edges
> themselves are not the big problem, it is the weak pull-up that leaves
> the lines very susceptible to noise and interference. SPI has edges, as
> do most protocols with a clock signal, but there the master drives high
> and low, giving a far more "solid" line.
>
> I²C can be fine in simple cases, but there are several less-used
> features that complicate it, especially when used together. That
> includes multi-master, clock stretching, 10-bit addressing, and newer
> faster speeds. Good luck trying to make a microcontroller slave that
> works with all of that!
>
> There is also the possibility of bus hang and invalid states. This can
> hit you during development - if you stop your microcontroller and
> restart it (perhaps with a new program version) in the middle of an I²C
> transaction, you can leave the slaves stuck - they may need a reset or
> power-cycle to recover.

The original Iic from Philips was for consumer equipment and has
worked well for that sort of application, but it's not robust enough
for professional work imho. I would never use it unless an io
device needed it, such early Teletext devices. As you say spi
is a far better sorted design...

Chris

Re: I2C Communication between two Microcontrollers

<ta72r2$e8jd$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=965&group=comp.arch.embedded#965

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dp...@tgi-sci.com (Dimiter_Popoff)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Thu, 7 Jul 2022 19:49:38 +0300
Organization: TGI
Lines: 65
Message-ID: <ta72r2$e8jd$1@dont-email.me>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
<ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me>
<ta3h2e$47a$1@dont-email.me> <ta3m05$ilp$1@dont-email.me>
<ta7129$1vbf$1@gioia.aioe.org>
Reply-To: dp@tgi-sci.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 7 Jul 2022 16:49:38 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c3dbab2fb6dffc9281bc48906f5c6138";
logging-data="467565"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186BPL0YcE8djWpT02l+ha4ByuUzKQ1xXc="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Cancel-Lock: sha1:9OXQVkisFZ6rS0fDNO9Rt6iy2qY=
In-Reply-To: <ta7129$1vbf$1@gioia.aioe.org>
Content-Language: en-US
 by: Dimiter_Popoff - Thu, 7 Jul 2022 16:49 UTC

On 7/7/2022 19:19, chris wrote:
> On 07/06/22 10:52, David Brown wrote:
>> On 06/07/2022 10:27, Stephen Pelc wrote:
>>> On 6 Jul 2022 at 09:52:23 CEST, "pozz" <pozzugno@gmail.com> wrote:
>>>
>>>> I found that I2C peripherals embedded in most of MCUs are very complex
>>>> and most of the time they aren't reliable.
>>>> After some testing, I usually decide to write a bit-banging I2C code.
>>>
>>> I have to agree here. I2C is conceptually simple, bu it is an edge
>>> triggered
>>> protocol and is very sensitive to noise unless you use buffer
>>> devices. It
>>> is excellent for master devices, but writing the slave software is
>>> much more
>>> complex to cover all cases.
>>>
>>
>> A key problem for I²C is the multi-drop nature of the lines. The edges
>> themselves are not the big problem, it is the weak pull-up that leaves
>> the lines very susceptible to noise and interference. SPI has edges, as
>> do most protocols with a clock signal, but there the master drives high
>> and low, giving a far more "solid" line.
>>
>> I²C can be fine in simple cases, but there are several less-used
>> features that complicate it, especially when used together. That
>> includes multi-master, clock stretching, 10-bit addressing, and newer
>> faster speeds. Good luck trying to make a microcontroller slave that
>> works with all of that!
>>
>> There is also the possibility of bus hang and invalid states. This can
>> hit you during development - if you stop your microcontroller and
>> restart it (perhaps with a new program version) in the middle of an I²C
>> transaction, you can leave the slaves stuck - they may need a reset or
>> power-cycle to recover.
>
> The original Iic from Philips was for consumer equipment and has
> worked well for that sort of application, but it's not robust enough
> for professional work imho. I would never use it unless an io
> device needed it, such early Teletext devices. As you say spi
> is a far better sorted design...
>
> Chris

I basically agree but things are not that bad as long as one
does not push things too far. For me the worst part has been dealing
with in-built I2C controllers, used two and both worked but each
took me *days* to defeat - unlike the first time I used I2C
some decades ago, bitbanging it from a HC11, which took me
only an hour or two. Never used an MCU as an I2C slave yet, may
do so soon but who knows.
The peripherals I have used - some eeprom, RTC, ADC and perhaps
some I can't think of now have all behaved; of course one has to
deal with hanged bus situations, I have not seen a part which
needs repower to get fixed (must have been lucky I guess).
I have managed to upset the bus, being open drain, routing it
too close to a flyback convertor switch, the latter doing 100V
excursions "pretty fast" (tens of ns for the 100V I think).
Changing the pullups on the I2c from 2k to 1k fixed that
(still not that much of "too close", some luck again :).

======================================================
Dimiter Popoff, TGI http://www.tgi-sci.com
======================================================
http://www.flickr.com/photos/didi_tgi/

Re: I2C Communication between two Microcontrollers

<tpNxK.325851$ntj.46379@fx15.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=966&group=comp.arch.embedded#966

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.11.0
Subject: Re: I2C Communication between two Microcontrollers
Content-Language: en-US
Newsgroups: comp.arch.embedded
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
<ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me>
<ta3h2e$47a$1@dont-email.me> <ta3m05$ilp$1@dont-email.me>
<ta7129$1vbf$1@gioia.aioe.org> <ta72r2$e8jd$1@dont-email.me>
From: Rich...@Damon-Family.org (Richard Damon)
In-Reply-To: <ta72r2$e8jd$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 80
Message-ID: <tpNxK.325851$ntj.46379@fx15.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Thu, 7 Jul 2022 23:22:01 -0400
X-Received-Bytes: 5132
 by: Richard Damon - Fri, 8 Jul 2022 03:22 UTC

On 7/7/22 12:49 PM, Dimiter_Popoff wrote:
> On 7/7/2022 19:19, chris wrote:
>> On 07/06/22 10:52, David Brown wrote:
>>> On 06/07/2022 10:27, Stephen Pelc wrote:
>>>> On 6 Jul 2022 at 09:52:23 CEST, "pozz" <pozzugno@gmail.com> wrote:
>>>>
>>>>> I found that I2C peripherals embedded in most of MCUs are very complex
>>>>> and most of the time they aren't reliable.
>>>>> After some testing, I usually decide to write a bit-banging I2C code.
>>>>
>>>> I have to agree here. I2C is conceptually simple, bu it is an edge
>>>> triggered
>>>> protocol and is very sensitive to noise unless you use buffer
>>>> devices. It
>>>> is excellent for master devices, but writing the slave software is
>>>> much more
>>>> complex to cover all cases.
>>>>
>>>
>>> A key problem for I²C is the multi-drop nature of the lines. The edges
>>> themselves are not the big problem, it is the weak pull-up that leaves
>>> the lines very susceptible to noise and interference. SPI has edges, as
>>> do most protocols with a clock signal, but there the master drives high
>>> and low, giving a far more "solid" line.
>>>
>>> I²C can be fine in simple cases, but there are several less-used
>>> features that complicate it, especially when used together. That
>>> includes multi-master, clock stretching, 10-bit addressing, and newer
>>> faster speeds. Good luck trying to make a microcontroller slave that
>>> works with all of that!
>>>
>>> There is also the possibility of bus hang and invalid states. This can
>>> hit you during development - if you stop your microcontroller and
>>> restart it (perhaps with a new program version) in the middle of an I²C
>>> transaction, you can leave the slaves stuck - they may need a reset or
>>> power-cycle to recover.
>>
>> The original Iic from Philips was for consumer equipment and has
>> worked well for that sort of application, but it's not robust enough
>> for professional work imho. I would never use it unless an io
>> device needed it, such early Teletext devices. As you say spi
>> is a far better sorted design...
>>
>> Chris
>
> I basically agree but things are not that bad as long as one
> does not push things too far. For me the worst part has been dealing
> with in-built I2C controllers, used two and both worked but each
> took me *days* to defeat - unlike the first time I used I2C
> some decades ago, bitbanging it from a HC11, which took me
> only an hour or two.  Never used an MCU as an I2C slave yet, may
> do so soon but who knows.
> The peripherals I have used - some eeprom, RTC, ADC and perhaps
> some I can't think of now have all behaved; of course one has to
> deal with hanged bus situations, I have not seen a part which
> needs repower to get fixed (must have been lucky I guess).
> I have managed to upset the bus, being open drain, routing it
> too close to a flyback convertor switch, the latter doing 100V
> excursions "pretty fast" (tens of ns for the 100V I think).
> Changing the pullups on the I2c from 2k to 1k fixed that
> (still not that much of "too close", some luck again :).
>
> ======================================================
> Dimiter Popoff, TGI             http://www.tgi-sci.com
> ======================================================
> http://www.flickr.com/photos/didi_tgi/

My experience is that to handle a "stuck" I2C bus, sometimes you need to
be able to turn "off" the I2C controller and manually "bit-bang" up to
(generally) 8 I2C clock pulses, until the slave that is stuck lets go of
the I2C Data line, then you can force a START-STOP code (by pulling the
data line low then high with the clock high) to get the bus into a
usable state.

If that doesn't work, then you have a non-conforming device.

I do remember one time working with a slave that if you addressed it too
soon after power up, it would go into clock streach mode (pulling down
the clock) but never leave that mode. For that case the only option was
to power down that device, and then power it back up and wait long enough.

Re: I2C Communication between two Microcontrollers

<tck0pr$2v6iq$1@news2.open-news-network.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=982&group=comp.arch.embedded#982

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!hirsch.in-berlin.de!news.bgeserver.de!news.arnold-schiller.de!news2.open-news-network.org!.POSTED.host-92-12-107-251.as13285.net!not-for-mail
From: spa...@spam.com (Mike Perkins)
Newsgroups: comp.arch.embedded
Subject: Re: I2C Communication between two Microcontrollers
Date: Fri, 5 Aug 2022 22:07:07 +0100
Organization: news2.open-news-network.org
Message-ID: <tck0pr$2v6iq$1@news2.open-news-network.org>
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
<ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me>
<ta3h2e$47a$1@dont-email.me> <ta3m05$ilp$1@dont-email.me>
<ta7129$1vbf$1@gioia.aioe.org> <ta72r2$e8jd$1@dont-email.me>
<tpNxK.325851$ntj.46379@fx15.iad>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 5 Aug 2022 21:07:07 -0000 (UTC)
Injection-Info: news2.open-news-network.org; posting-host="host-92-12-107-251.as13285.net:92.12.107.251";
logging-data="3119706"; mail-complaints-to="abuse@bgeserver.de"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Content-Language: en-GB
In-Reply-To: <tpNxK.325851$ntj.46379@fx15.iad>
 by: Mike Perkins - Fri, 5 Aug 2022 21:07 UTC

On 08/07/2022 04:22, Richard Damon wrote:
> On 7/7/22 12:49 PM, Dimiter_Popoff wrote:
>> On 7/7/2022 19:19, chris wrote:
>>> On 07/06/22 10:52, David Brown wrote:
>>>> On 06/07/2022 10:27, Stephen Pelc wrote:
>>>>> On 6 Jul 2022 at 09:52:23 CEST, "pozz" <pozzugno@gmail.com> wrote:
>>>>>
>>>>>> I found that I2C peripherals embedded in most of MCUs are very
>>>>>> complex
>>>>>> and most of the time they aren't reliable.
>>>>>> After some testing, I usually decide to write a bit-banging I2C code.
>>>>>
>>>>> I have to agree here. I2C is conceptually simple, bu it is an edge
>>>>> triggered
>>>>> protocol and is very sensitive to noise unless you use buffer
>>>>> devices. It
>>>>> is excellent for master devices, but writing the slave software is
>>>>> much more
>>>>> complex to cover all cases.
>>>>>
>>>>
>>>> A key problem for I²C is the multi-drop nature of the lines. The edges
>>>> themselves are not the big problem, it is the weak pull-up that leaves
>>>> the lines very susceptible to noise and interference. SPI has edges, as
>>>> do most protocols with a clock signal, but there the master drives high
>>>> and low, giving a far more "solid" line.
>>>>
>>>> I²C can be fine in simple cases, but there are several less-used
>>>> features that complicate it, especially when used together. That
>>>> includes multi-master, clock stretching, 10-bit addressing, and newer
>>>> faster speeds. Good luck trying to make a microcontroller slave that
>>>> works with all of that!
>>>>
>>>> There is also the possibility of bus hang and invalid states. This can
>>>> hit you during development - if you stop your microcontroller and
>>>> restart it (perhaps with a new program version) in the middle of an I²C
>>>> transaction, you can leave the slaves stuck - they may need a reset or
>>>> power-cycle to recover.
>>>
>>> The original Iic from Philips was for consumer equipment and has
>>> worked well for that sort of application, but it's not robust enough
>>> for professional work imho. I would never use it unless an io
>>> device needed it, such early Teletext devices. As you say spi
>>> is a far better sorted design...
>>>
>>> Chris
>>
>> I basically agree but things are not that bad as long as one
>> does not push things too far. For me the worst part has been dealing
>> with in-built I2C controllers, used two and both worked but each
>> took me *days* to defeat - unlike the first time I used I2C
>> some decades ago, bitbanging it from a HC11, which took me
>> only an hour or two.  Never used an MCU as an I2C slave yet, may
>> do so soon but who knows.
>> The peripherals I have used - some eeprom, RTC, ADC and perhaps
>> some I can't think of now have all behaved; of course one has to
>> deal with hanged bus situations, I have not seen a part which
>> needs repower to get fixed (must have been lucky I guess).
>> I have managed to upset the bus, being open drain, routing it
>> too close to a flyback convertor switch, the latter doing 100V
>> excursions "pretty fast" (tens of ns for the 100V I think).
>> Changing the pullups on the I2c from 2k to 1k fixed that
>> (still not that much of "too close", some luck again :).
>>
>> ======================================================
>> Dimiter Popoff, TGI             http://www.tgi-sci.com
>> ======================================================
>> http://www.flickr.com/photos/didi_tgi/
>
> My experience is that to handle a "stuck" I2C bus, sometimes you need to
> be able to turn "off" the I2C controller and manually "bit-bang" up to
> (generally) 8 I2C clock pulses, until the slave that is stuck lets go of
> the I2C Data line, then you can force a START-STOP code (by pulling the
> data line low then high with the clock high) to get the bus into a
> usable state.
Isn't that why SMBus was invented?

--
Mike Perkins
Video Solutions Ltd
www.videosolutions.ltd.uk

Re: I2C Communication between two Microcontrollers

<VbjHK.950615$X_i.848486@fx18.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=983&group=comp.arch.embedded#983

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.12.0
Subject: Re: I2C Communication between two Microcontrollers
Content-Language: en-US
Newsgroups: comp.arch.embedded
References: <9f2f7fd6-24ee-4eb5-8c3d-4b3db5b296bcn@googlegroups.com>
<ta3b8u$3vja9$1@dont-email.me> <ta3evo$3vtt1$1@dont-email.me>
<ta3h2e$47a$1@dont-email.me> <ta3m05$ilp$1@dont-email.me>
<ta7129$1vbf$1@gioia.aioe.org> <ta72r2$e8jd$1@dont-email.me>
<tpNxK.325851$ntj.46379@fx15.iad>
<tck0pr$2v6iq$1@news2.open-news-network.org>
From: Rich...@Damon-Family.org (Richard Damon)
In-Reply-To: <tck0pr$2v6iq$1@news2.open-news-network.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 20
Message-ID: <VbjHK.950615$X_i.848486@fx18.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Fri, 5 Aug 2022 21:10:12 -0400
X-Received-Bytes: 2224
 by: Richard Damon - Sat, 6 Aug 2022 01:10 UTC

On 8/5/22 5:07 PM, Mike Perkins wrote:
> On 08/07/2022 04:22, Richard Damon wrote:
>>
>> My experience is that to handle a "stuck" I2C bus, sometimes you need
>> to be able to turn "off" the I2C controller and manually "bit-bang" up
>> to (generally) 8 I2C clock pulses, until the slave that is stuck lets
>> go of the I2C Data line, then you can force a START-STOP code (by
>> pulling the data line low then high with the clock high) to get the
>> bus into a usable state.
> Isn't that why SMBus was invented?
>

That handles it, but only if ALL your devices support it. The "Stuck
Device" might be a device that doesn't support SMB bus, and might not
normally need to, because it is just a simple slave that never clock
streaches, so shouldn't be able to have a problem on a working bus.

The issue can happen if the controller get aborted mid-read-transfer, so
the slave is driving the data bus (low) so a master can't assert a Start
or Stop to reset the devices.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor