Ruediger Orschiedt
Reged: Oct 16 2003
Posts: 1
|
|
Hi,
How can I realice a comunication between two i2c-Master ?
Does anyone have a sample.
cheers
Ruediger
|
Mike Rigby-Jones
  
Reged: Oct 16 2003
Posts: 141
|
|
>Hi,
>How can I realice a comunication between two i2c-Master ?
>Does anyone have a sample.
>
>cheers
>
>Ruediger
You cannot make two masters communicate, I2C communication always takes place between a slave and a master.
|
JanErik Bertram
Reged: Oct 16 2003
Posts: 83
Loc: Germany, Bochum
|
|
>You cannot make two masters communicate, I2C communication always takes place between a slave and a master.
Sorry, but you are wrong.
Look at http://www.esacademy.com/faq/i2c/ and you will see that I2C is a Multi-Master Bus.
I don't try it to build a multimaste I2C bus with the 16F876,
but i assume you can use a standard single-master mode driver, and extend it only too recognize
the Bus collision Interrupt.
And too wait for the Bus free signal.
Ciao
Jan Erik Bertram
|
Stephen Landamore
  
Reged: Oct 16 2003
Posts: 124
Loc: Cambridge, UK
|
|
>>You cannot make two masters communicate, I2C communication always takes place between a slave and a master.
>
>Sorry, but you are wrong.
>Look at http://www.esacademy.com/faq/i2c/ and you will see that I2C is a Multi-Master Bus.
A master is a device which is capable of initiating a comms transfer; a slave is a device which is capable of receiving a comms transfer.
If you are bit-bashing the comms, it is trivial to be a master device; it is generally very hard to be a slave device, even at slow (125kbit/s) rates. Hardware i2c support is generally recommended if you have to act as a slave :-)
i2c does indeed support multiple masters; in this case ALl the masters will ALSO need to handle slave functionality. Hardware support is DEFINATELY recommended :-)
6 or so years ago I worked on a project which has multiple i2c masters. We used a pic16c65; the datasheet claimed hardware support for multi-master i2c, but it was lying. There were bugs, errata, workarounds... and in some corner cases it simply did not work as advertised. We were led to believe Microchip got their act together, and fixed the problems on newer chips, but it was too late and the damage had already been done. These days, I avoid i2c like the plague. Sorry I don't recall the details, and I no longer have the code.
best regards,
stephen
|
Mike Rigby-Jones
  
Reged: Oct 16 2003
Posts: 141
|
|
>>You cannot make two masters communicate, I2C communication always takes place between a slave and a master.
>
>Sorry, but you are wrong.
>Look at http://www.esacademy.com/faq/i2c/ and you will see that I2C is a Multi-Master Bus.
Sorry, but that makes no difference. Two masters cannot initiate data transfer. I2C can be used in a multi-master configuration, but the masters also need to support slave functionality if another master needs to communicate with it.
I stand by my statement: You cannot make two masters communicate.
|
Freddy4
Reged: Oct 16 2003
Posts: 1
|
|
Mike, please re-read the original statement.
He was asking for a multi-master communication sample.
The commone sense says for everyone but you that he want to realize a bus where multiple devices are able to take control of the bus.
Mhhh... my PC has a bus-master disk controller and network card... you would say it cannot work, but I can assure it runs perfectly :-)
Next time be sure your brain is connected and switched on. :-)
Cheers
Freddy O.
|
Mike Rigby-Jones
  
Reged: Oct 16 2003
Posts: 141
|
|
>Mike, please re-read the original statement.
>
>He was asking for a multi-master communication sample.
>
>The commone sense says for everyone but you that he want to realize a bus where multiple devices are able to take control of the bus.
>
I have re-read it, I suggest you do the same. The OP asked: "How can I realice a comunication between two i2c-Master"
The correct answer which I have already given is that you cannot have communication between two I2C masters. What don't you understand about that?
|
Freddy4
Reged: Oct 16 2003
Posts: 1
|
|
>I have re-read it, I suggest you do the same. The OP asked: "How can I realice a comunication between two i2c-Master"
Don't forget to read the message title, too.
"i2c multi-master with SSP 16F876"
In multimaster environment, as in real life, two masters cannot coexist, this is clear for everyone.
Thanks for pointing out this. :-)
But for everybody also (but you) was clear what our friend was looking for.
Ciao
Freddy
|
Dan Henry
Guru
  
Reged: Oct 16 2003
Posts: 4218
Loc: Colorado
|
|
>But for everybody also (but you) was clear what our friend was looking for.
Oops, not everybody! You can include me in your list of imbeciles and add me to your mental kill file -- "mental", since our Forum does not have that facility.
|