Connections for STM32L4 SPI slave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-25 8:01 AM
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
Solved! Go to Solution.
- Labels:
-
STM32CubeMX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-25 8:17 AM - edited ‎2024-07-25 8:22 AM
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:
A fine example of data that would have been much clearer if presented as a table
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-25 8:05 AM
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
https://en.wikipedia.org/wiki/Serial_Peripheral_Interface
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-25 8:11 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-25 8:17 AM - edited ‎2024-07-25 8:22 AM
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:
A fine example of data that would have been much clearer if presented as a table
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-25 8:23 AM
@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 :beaming_face_with_smiling_eyes:
