Steve Baldwin wrote: > >> If you're talking about connecting two devices which are running off of > >> different power supplies, and you don't want them to have a common > >> ground, you could try using opto-isolators on the i2c pins. Make sure > >> your opto's can switch faster than the bit rate you're running your i2c > >> bus at. > > > Whoa. On second thought, that whole opto-isolator idea might not work > > since i2c is bi-directional (on the same pin). You might be able to do > > it on an SPI bus where input and output each have dedicated pins. You > > may still be able to do it with opto's but it will be hairier than it > > originally seemed. > > You were OK the first time. You can do I2C across optos. It just requires 4 > of them and a little mental gymnastics to arrange them to work properly. I would say quite a bit of mental work. The straight-forward approach is to split the bidirectional bus into the two directions and isolate them separately. This will work usually BUT there is a risk of a glitch: Suppose a device on the bus is holding down one of the lines. Then, another device (separated by the optoisolator) also lowers the line. Then the first device releases the line, while the second still keeps the line low. The problem is to avoid the potentially dangerous glitch when the optoisolator decides who is really holding down the line. Challenge, folks! How do you do it, glitch-free? -- Martin Martin Nilsson http://www.sics.se/~mn/ Swedish Institute of Computer Science E-mail: mn@sics.se Box 1263, SE-164 29 Kista Fax: +46-8-751-7230 Sweden Tel: +46-8-752-1574