Clear Filters
Clear Filters

Raspberry Pi 3 SPI - Blocks. How to start the SPI Communication?

1 view (last 30 days)
Hello, I can´t implement the Matlab Simulink SPI Block for Raspberry Pi 3. I wan´t to connect the Pi with an Arduino Mega. I can´t measure any Signal on the Ports. Is there an example?
Thank you. Best Regards, Daniel

Answers (1)

Madhu Govindarajan
Madhu Govindarajan on 18 Oct 2017
Here is an example of using SPI communication with Raspberry PI and simulink - https://www.mathworks.com/help/supportpkg/raspberrypi/examples/communicating-with-an-eeprom.html . Usually the trick with SPI and I2C sensors is to perform the initialization routine accurately, once you have that going based on your specific sensor's commands it should be smooth afterwards.
  2 Comments
Stefan Frutiger
Stefan Frutiger on 30 Jan 2018
This example is really good. But i have another Problem with the SPI Interface. How can you change the Sample Time from the SPI Read Block? Because this is an essentially Parameter for an Input.
Madhu Govindarajan
Madhu Govindarajan on 30 Jan 2018
It looks like this block is implemented from a MATLAB System object and I believe those do not allow you to specify the sample time. Others here might be able to throw more light on this - but I believe one cannot access parameters from p coded files and it might not even change if you change the SPI bus speed.
Sorry for not being able to help you further.

Sign in to comment.

Categories

Find more on Raspberry Pi Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!