Page 1 of 1

I2C Multi Master

Posted: Mon Oct 21, 2019 3:39 pm
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

Re: I2C Multi Master

Posted: Mon Oct 21, 2019 3:43 pm
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.

Re: I2C Multi Master

Posted: Mon Oct 21, 2019 8:22 pm
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/technical-articles-and-documents/miscellaneous/i2c-bus/general-introduction/using-the-clock-synchronizing-mechanism-as-a-handshake.html

Thanks

Re: I2C Multi Master

Posted: Tue Oct 22, 2019 5:11 pm
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.

Re: I2C Multi Master

Posted: Thu Oct 24, 2019 10:46 am
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

Re: I2C Multi Master

Posted: Wed Nov 13, 2019 10:44 am
by Docara
Bumped

Re: I2C Multi Master

Posted: Wed Nov 13, 2019 11:14 am
by Benj
Hello,

I've done the PIC device for you with the new interrupt.
12F1840.fcdx
(18.66 KiB) Downloaded 30 times


The AVR devices do not have SPI or I2C based interrupts available so you may instead have to use pin change interrupts instead.