2021-11-20 11:10 AM
Hello,
I want to communicate with SPI between STM32F7 and Texas DSP devices. STM32F7 is the master device and Texas DSP is the slave device. I am sending data from STM32F7 master device to Texas DSP slave device. But I can not send data from slave device to master device.
How can i solve this problem?
Sinan,
Thanks and best regards.
2021-11-21 09:12 AM
Check for some cube nucleo example of spi master. If the spi bus is 4 wires, every transmit is also a receive.
2021-11-21 12:38 PM
SPI is a master-slave system. In order to pass information backwards, the master needs to send a clock and the slave sends out data on MISO, which the master reads.
https://en.wikipedia.org/wiki/Serial_Peripheral_Interface
2021-11-26 10:15 AM
Hi,
My Master STM32 is successfully sending data to the Slave DSP device. Slave DSP device is also sending data to Master STM32 device. However, the Master device is not receiving the correct data from the slave device. For example, the slave device sends 0xABCD data to the master device and the master device receives this data as 0xD5E6.
Sinan,
Thanks.
2021-11-26 10:54 AM
> slave device sends 0xABCD data to the master device and the master device receives this data as 0xD5E6.
Looks like you're off by one bit, which means the master and slave are not synchronized. The CS line is used to do this. Keep it high when idle, set it low just before the transfer and back high again after the transfer.
Edit: having mispatched CPOL/CPHA settings can also cause this.