10 years, 9 months ago.

SPI Communication Limit of 8 bytes

hi ,

I have interfaced two mbeds each operating in master and slave mode respectively. I am intending to send 255 bytes in an array.but when I receive the data in slave ,it receives only the first 8 bytes and returns junk value for the rest of the frame. I have checked the clock and data lines using oscilloscope and see that the data is sent properly. SPI Slave seems to have some defect.

Any suggestions on what could be the problem?

1 Answer

10 years, 9 months ago.

SPI slave needs it _CS line to be toggled for every byte. Contrary to most SPI devices you cannot just select the mbed and send all data over, you need to deselect it after every byte.

The SPI peripheral on the microcontroller is designed that way, not a defect in the code.

Accepted Answer