I'm attempting to use the MATLAB Support Package for Arduino to control a SPI Bus through the Arduino Due. I have been successful in controlling a AD5324 nano-DAC that has a 16-bit shift-register but I have a couple of other devices that have a wider shift-register (24-bit) that I need to program as well. It appears that the writeRead() function only supports 8-bit or 16-bit instructions though.
Is there a way to send more information than 16-bits in one chip enable toggle?
I've attempted to use arrays in the argument for writeRead for example: writeRead(spidev, [byte byte byte]); but it appears only the first byte is sent through SPI even though the arduino says it is making multiple SPI transfers.
Here is the trace from the arduino when executing writeRead(dev, [7 7 7]):
Arduino::SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE2));
Arduino::digitalWrite(30, LOW);
Arduino::SPI.transfer(30, 7, SPI_CONTINUE); –> 255
Arduino::SPI.transfer(30, 7, SPI_CONTINUE); –> 255
Arduino::SPI.transfer(30, 7, SPI_LAST); –> 255
Arduino::digitalWrite(30, HIGH);
I appreciate the help in advanced,
Michael
Best Answer