Raspberri pi 3 and DAQCplate over SPI

I'm having issues with controlling DAQCplate over Simulink (Matlab 2018a).
The DAQCplate is an SPI device and I can controll it with the Python library that came with it. In python the command that is sent with the spidev() function. The function is called by: spidev([8 0x10 1 0 0],300000,40). The parameters in the square brackets are the data that is beeing sent. 300000 is the speed in Hz and 40 is delay in ms. Executing this in python turns on a LED on the DAQCplate.
Trying to send the same command with Simulink 'SPI master write' block doesn't work. The input to the 'SPI master write' block is therefore [8 16 1 0 0]. I can't figure out what I'm doing wrong because no error is thrown by Simulink. I also tried with the Matlab 'readWrite()' function and it also doesn't work. There is no error when calling 'enableSPI()', 'spidev()' or 'readWrite()' from Matlab.
I have no idea how I could go about and try to debug this....
I found the spidev.m and raspi.m libraries but adding breakpoints in there didn't reveal anything.
Can anyone suggest me something to look into? What would be the easiest way to see if Matlab is even sending the commands to SPI? I've looked at the EEPROM example, but I didn't find it of much use.
Thanks

Answers (0)

Categories

Find more on MATLAB Support Package for Raspberry Pi Hardware in Help Center and File Exchange

Products

Asked:

on 31 May 2018

Community Treasure Hunt

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

Start Hunting!