AnsweredAssumed Answered

SPI communication between 2 STM32

Question asked by attig.salim on Feb 19, 2014
Latest reply on Feb 20, 2014 by sung.chen_chung

      Hello everyone,

  I would like to use SPI protocol in order to communicate between two µC STM32f429.

  One will be a master, and the other one will be slave.

  I would like to perform very easy operation to begin with (the master always sends DATA1 and the slave always sends DATA2, and each of them displays the data it receives).

  For the master, I have used this code :

http://eliaselectronics.com/stm32f4-tutorials/stm32f4-spi-tutorial/

  For the slave, I’ve tried to write the code by myself by changing the master code but it doesn’t work for the moment. The slave does not receive anything. What I have changed:

-           SPI_InitStruct.SPI_Mode = SPI_Mode_Slave instead of Master.

-           PE7 for chip select is INPUT in the slave instead of OUTPUT and so it does not have to be set high or low.

 

What other changes do I have to apply? How to manage the slave selection with PE7?

Could I try to use only one µC and to make SPI1 of it communicate with its own SPI2 ?

  Thank you very much.

Outcomes