I2C Multi Master

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: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times
Contact:

I2C Multi Master

Post by Docara »

Hi

Can the I2C Master Slave components operate in Multi Master configuration.
And does the Slave initiate and interrupt when data is received.
Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C Multi Master

Post by Benj »

Hello,

I'm not sure about Multi master, It likely does work but there are also likely complications. The Slave is likely fine and it's the master that might have problems. If the comms is fairly sparse then the chance of a collision between masters is quite low and it should be fine.

The Slave does require the SSP interrupt which was added to devices fairly recently.

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times
Contact:

Re: I2C Multi Master

Post by Docara »

Hi Ben

I see no mention of Interrupt in my V7 I2C Slave component.
Benj wrote: The Slave does require the SSP interrupt which was added to devices fairly recently.
So what do I do? Can this be implement in a C routine or you sent me a new component

Doesn't I2C included (albeit basic) a handshaking mechanism using ACK http://www.esacademy.com/en/library/tec ... shake.html

Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C Multi Master

Post by Benj »

Hi,

I added the interrupts for v8. What chip are you using and i'll see if I can add the code to the v7 definition.

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times
Contact:

Re: I2C Multi Master

Post by Docara »

Hi Ben,

AH! Sorry if this has been a PITA for you personally! I thought it would be a simple matter of adding/copying some functionality to the I2C Slave macro and it would 'just' pushed through all the ranges.

I'm SOO temped to say PIC and AVR :lol: :lol: LOL.

I'm still researching my design, but thanks to China, I am hoping to use the ATMEGA2560, I will probably use both the ATMEGA328P (ATMEGA328PB) and PIC12F1840.

Further to another post I made here requesting the inclusion of a ATMEGA328PB, if this can be sorted out, then the PB variant ofthe ATMega328 would be nice. If that could be included then all my bases are covered.

There will be a number of distributed microcontrollers which will be in a sleep mode for long periods of time, only for them to wake up on an event eg GSM data, data on a bus etc.

I will be using the CAN (MCP2551 & MCP2151) macros , I2C and SPI. Will the component macro implementations for these allow for wakeup events - interrupts.

Thanks again Ben

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times
Contact:

Re: I2C Multi Master

Post by Docara »

Bumped

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C Multi Master

Post by Benj »

Hello,

I've done the PIC device for you with the new interrupt.
12F1840.fcdx
(18.66 KiB) Downloaded 233 times
The AVR devices do not have SPI or I2C based interrupts available so you may instead have to use pin change interrupts instead.

Post Reply