Opto-electrical isolation of the I2C-Bus

General discussion on mikroPascal.
Post Reply
Author
Message
magnat
Posts: 6
Joined: 26 Aug 2004 13:10
Location: Belgrade, Serbia
Contact:

Opto-electrical isolation of the I2C-Bus

#1 Post by magnat » 09 Jan 2005 11:54

I want to connect 2 PIC's (18F452) via I2C bus, but i need opto-electrical isolation between them.
I've found some info on: http://www.embedded.com/shared/printabl ... D=49901764
Is there another way connecting two(or more PIC's) with opto-electrical isolation between them?

Best regards!!

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

Opto-isolation

#2 Post by LGR » 10 Jan 2005 02:30

What you want to do is physically possible, but is much easier with SPI, because the connections in SPI are all unidirectional. Also, mikroPascal doesn't currently support I2C slave mode, so you can't use I2C for PIC to PIC communication, until this feature is added.

USART is another option which uses unidirectional lines. In fact, they have an IRDA board which works with this.

magnat
Posts: 6
Joined: 26 Aug 2004 13:10
Location: Belgrade, Serbia
Contact:

#3 Post by magnat » 10 Jan 2005 13:17

USART sounds interesting. I've planned something like this:

Image

Would this kind of communication beetween PIC's work?
What is max baud rate that I can achieve?
I was thinking about IRDA but I need to isolate comm. between two PIC's on the same board (different GNDs).
Is there any info on opto-isolated CAN?

Thnx, :)

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

Opto-isolation

#4 Post by LGR » 10 Jan 2005 16:00

That should work with the USART routines, I would think that max baud would depend on the optoisolators used, but you should be able to easily do 115K. You would have to experiment. I don't know for sure, but I think that SPI would be able to be faster with a given optoisolator, just because syncronous is more robust.

CAN should also work, if you use the RX and TX pins on the chip, and don't connect to a transciever. It may also be able to run faster, because you can adjust a lot of timing parameters (bit sample point, etc.) that you can't adjust with USART. It is a lot of work to set up, though.

I still think that SPI is the best choice, overall.

Post Reply

Return to “mikroPascal General”