Re: I2C trick?



Vladimir Vassilevsky <antispam_bogus@xxxxxxxxxxx> wrote:


Roberto Waltman wrote:

Suppose you have the two I2C slaves that have to be connected to the
MCU. Both slaves have the same I2C address.

First time I hear somebody doing this. Even if the devices are
"write-only" this is bad design. For example, how to diagnose
communication problems with one of them?

Of course the slaves should be addressed independently. The I2C address
can't be changed for those ICs, and there are only two I/O pins
available on the MCU. Would it be possible to get by without some sort
of I/O extender?

If you don't care for standards and specs, you could just wire things up
as you described and see if it works for your setup and your chips. No
guarantee it will work in all situations of course, even if your tests
happen to work.

No. The SDA line must be stable while SCL is high, unless when
violating this rule on purpose to signal START or STOP conditions.

Understood. But how exactly this can disrupt the communication?
Yes, the multiple wrong starts and stops could be detected. So?

The behaviour of an I2C chip is only defined as long as the signals on
the bus stick to the protocol. If the protocol is violated, just about
anything could happen, including a device locking up the bus forever.
This might happen right away, or after a few seconds, or after a few
days. If you're really unlucky, it happens only every few months.

What you are proposing is called 'undefined behaviour'. Anything could
happen, but no way to predict what or when.

If you can not configure one I2C slave to a different address or
provide another port, consider adding I2C multiplexers or switches to
the bus (PCA9545, for example)

Well you don't have to reprint the basic stuff from an ABC book on
electronics.

Sorry to interfere, but I think there is no reason to snap at somebody
who is taking the time to anwer your questions if his answer is not what
you want to hear. I think the only answer you'll get is the one you
already got: violating the protocol is just not a good idea - that's
what protocols are for. Do what you please, but don't be surprised if
things will not work out the way you planned.

--
:wq
^X^Cy^K^X^C^C^C^C
.



Relevant Pages

  • Re: The Queen and Michelle Obama [OT!]
    ... who knows) was the first time she'd been proud to be an ... will be quite careful about protocol. ... under some slight obligation to observe these medieval shibboleths. ... kissing, obeisance", which rather gives your particular snippy ...
    (rec.music.opera)
  • Re: Emulating 1-wire interface with a microcontroller
    ... There are several levels to the 1-wire protocol. ... The higher levels of the protocol define when the master ... with a short pulse. ... The higher levels of the protocol allow the master to address slaves, ...
    (comp.arch.embedded)
  • Re: Stephenie Mayer -- the next J. K. Rowling
    ... A mundane encountering something odd will either go into panic mode (and give up reading), or else dismiss the author as screamingly incompetent, or both. ... It's leading you into sloppy reasoning, since it allows you to assert that there is a protocol because there are people who don't use it, without ever proving that fact. ... I didn't go into either panic mode or think that the Kipling was incompetent when I couldn't figure the book out the first time. ...
    (rec.arts.sf.written)
  • Re: Alternate supplier for dallas/microchip 1-wire memories
    ... Are there any other manufacturers of these devices? ... different names for the bus as is the case with I2C vs. "Two Wire ... I've never seen any other sources, but the protocol is simple enough ... and capacitor might work to make a low end MCU line powered. ...
    (comp.arch.embedded)
  • Configuring Shorewall
    ... Here is an ifconfig ... ppp3 Link encap:Point-to-Point Protocol ... first time I ever saw the ppp3 item here--might be thefirewall. ...
    (Debian-User)