Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Communication between 2 arduinos using I2C/SPI and Matlab Simulik

460 views
Skip to first unread message

Mohsen

unread,
Nov 8, 2016, 7:08:08 PM11/8/16
to
Hi,

I am trying to communicate between two arduino boards (a Feather and a Due). I am using Simulink for programming my boards, but from my understanding, the I2C/SPI blocks in the Arduniolib in simulink are designed for the arduino to be the master. Is there any code/trick out there so I can define an arduino as a slave board in Simulink? I am assuming if no such block exists, I should write my own S function block. Is anybody aware of such block. Please share if you have any solutions or experience you have about this.

Thanks in advance,
Mohsen

Sudeshna Bhattacharya

unread,
Nov 15, 2016, 1:23:08 AM11/15/16
to
The SPI support in Simulink Support Package for Arduino is based on the official library: https://www.arduino.cc/en/Reference/SPI

Since the library itself does not support Slave Mode there is no Slave mode support in the Simulink Support Package.

In case of I2C the Slave is based on some interrupts. Currently no I2C Slave is supported by Simulink Support Package for Arduino Hardware.

You need to create your own device driver for the same. You can refer the below file exchange submission to get started:

https://www.mathworks.com/matlabcentral/fileexchange/39354-device-drivers

"Mohsen" wrote in message <nvtpd3$erv$1...@newscl01ah.mathworks.com>...

moye...@gmail.com

unread,
Jun 20, 2017, 1:58:02 PM6/20/17
to
Hi Mohsen,

Have you found a solution for your problem? If yes, I am interesting to it.

In fact, I want to communicate between multiple Arduinos using I2C to share information so your question is really relevant.

Best regards,
Florian

redouane...@gmail.com

unread,
Nov 29, 2017, 5:05:29 AM11/29/17
to
Hello i have the same problem , if you find the solution can you please share it ?
Best regard
Redouane
0 new messages