SPI receive block to receive vector of 4 16-bit words

1 view (last 30 days)
I'm trying to send a vector of 4 uint16 values through via SPI. I use Embedded Coder to program the master board (ti F28069m) and ti CCS for the slave board (also F28069m). I want to receive the 4 values sent from slave to master using the SPI Receive block, setting the data length to 4. However I don't know what I should transmit on the side of the slave in order to have this block interpret the data as it should. I've tried both sending the data as fast as possible and at the same rate the SPI Receive block operates. I've noticed that the Receive block does not work without a transmit block sending data. Can you explain to me how the transmit and receive blocks work exactly and what is the meaning of: (1) data length parameter in Receive block (2) Sample time in Receive block (SPI data already has a fixed rate, so why is this necessary?)
When sending the Received data to a scope via the other SPI module, I do receive 4 values, but they appear to be random (e.g. when sending 1,2,3,4,1,2,3,4,... I get for example 1,1,3,2,4,...)
Kind regards, Jorrit

Answers (0)

Community Treasure Hunt

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

Start Hunting!