cancel
Showing results for 
Search instead for 
Did you mean: 

Connections for STM32L4 SPI slave

SidPrice
Associate III

I have an STM32L433 that implements a SPI slave, it is connected to another MCU master. It is unclear from the datasheet and searches for answers whether MISO and MOSI on the slave should connect directly to MISO and MOSI on the master, or, if they should be crossed.

 

Is master MOSI -> slave MOSI and master MISO to slave MISO correct?

Sid

1 ACCEPTED SOLUTION

Accepted Solutions

Ah, right - I see what you mean!

The RM suggests that the direction of the pin does depend on whether the peripheral is in Master or Slave mode:

AndrewNeil_1-1721920861661.png

 

A fine example of data that would have been much clearer if presented as a table 

 

View solution in original post

4 REPLIES 4
Andrew Neil
Evangelist III

The names say it all:

MOSI = Master Out, Slave In;

MISO = Master In, Slave Out.

 


@SidPrice wrote:

Is master MOSI -> slave MOSI and master MISO to slave MISO correct?


Yes. This is standard SPI - nothing specific to STM32

AndrewNeil_0-1721919866780.png

https://en.wikipedia.org/wiki/Serial_Peripheral_Interface 

Thank you, yes, I fully understand that. Perhaps I should have been more specific.

I am concerned about the connections on the STM32L4. PA6 is SPI1 MISO, PA7 is SPI1 MOSI. So, when the L4 is a slave, the master MOSI is connected to PA6 or PA7.

 

Ah, right - I see what you mean!

The RM suggests that the direction of the pin does depend on whether the peripheral is in Master or Slave mode:

AndrewNeil_1-1721920861661.png

 

A fine example of data that would have been much clearer if presented as a table 

 

SidPrice
Associate III

@Andrew Neil Thank you, I missed that in the TRM.

I think I should be able to put Master MISO on PA6 of the slave and master MOSI on PA7.

Again, thanks for the prompt input 😁