Problem of SPI slave transmit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-06 1:40 AM
I testing SPI using two STM32F411 disco.
One is master, the other is slave.
My problem is only work MOSI , MISO is not working.
I attach my Two source code.
This is setting of my disco board.
Do you have any idea about error of Slave transmit of SPI?
- Labels:
-
SPI
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-06 2:38 AM
On picture, I don't see ground connection between boards.
I only see SCK/MOSI/MISO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-06 2:46 AM
supply of power at same usb hub.
So, GND connected by usb mini cable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-06 3:07 AM
Anyways, I recommend connecting ground between boards.
Please check MISO/MOSI signals on scope.
And configure a NSS pin on Slave and connect it to ground.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-06 8:03 AM
connect NSS as well. Match MISO and MOSI on both side. Use SPI 8 bit mode. NSS by SW (choose the GPIO). Use NSS GPIO EXTI interrupt to get event when NSS goes low and high (beginning transmit and process received message). Allow small delay after changing NSS for slave EXTI interrupt to complete before data is being transited.
Use 4 wire bidirectional mode to get started. For slave, I recommend to use DMA in cyclic buffer mode (both TX and RX)
