Inter uC communication

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Docara
Posts: 308
Joined: Sun Jun 23, 2013 1:29 pm
Contact:

Inter uC communication

Post by Docara »

Hello everyone,

What is the procedure and protocol to connect two (or more) microcontrollers together so that they can share some info.

It would be nice to use I2C purely because of limited wires between two locations. The data is minimal a few bytes occasionally .

Additionally, would it be possible to use this data to trigger an interrupt?

Thanks
Matt

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8929
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: Inter uC communication

Post by medelec35 »

Hi Matt,
Have you seen this by viki2000
Some very interesting reading and example flowcharts.

Martin
Martin

kersing
Valued Contributor
Valued Contributor
Posts: 1940
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Contact:

Re: Inter uC communication

Post by kersing »

Serial. Easiest to use and most controllers implement it in hardware. I2C would require slave mode which is not commonly available in hardware and is harder to handle.
CAN would be another option...
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Docara
Posts: 308
Joined: Sun Jun 23, 2013 1:29 pm
Contact:

Re: Inter uC communication

Post by Docara »

Thanks Martin

Docara
Posts: 308
Joined: Sun Jun 23, 2013 1:29 pm
Contact:

Re: Inter uC communication

Post by Docara »

kersing wrote:Serial. Easiest to use and most controllers implement it in hardware. I2C would require slave mode which is not commonly available in hardware and is harder to handle.
CAN would be another option...

Hi Kersing

I'm juggling with other stuff which will be hanging off I2C (temperature sensors and addressable switches). I'm currently looking at CAN but also LIN. Serial would be nice between the two but the possible project is in a noisy environment and I have run out of room for a screened cable in the installed conduit.

Thanks
Matt

User avatar
LeighM
Matrix Staff
Posts: 2054
Joined: Tue Jan 17, 2012 10:07 am
Contact:

Re: Inter uC communication

Post by LeighM »

RS485?

kersing
Valued Contributor
Valued Contributor
Posts: 1940
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Contact:

Re: Inter uC communication

Post by kersing »

Docara wrote:Serial would be nice between the two but the possible project is in a noisy environment and I have run out of room for a screened cable in the installed conduit.
If the environment is too noisy for serial you should not even consider the i2c you mention in the original message as it is for short connections only and will not work well in a noisy environment.
CAN or other protocols using differential drivers should work.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Post Reply