I want to use two SPI peripherals on the same STM32 MCU just to practice this protocol, because I don't have any other device to test with.
Is it possible to do that?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI want to use two SPI peripherals on the same STM32 MCU just to practice this protocol, because I don't have any other device to test with.
Is it possible to do that?
You can use two SPI devices on this board.
You need to disable LIS302 chip by PE3 -> GND
Then configure SP1 as master with hardware NSS and SPI2 as slave with hardware NSS.
CONNECT:
SPI1 MISO -> SPI2 MISO
SPI1 MOSI -> SPI2 MOSI
SPI1 SCK -> SPI2 SCK
SPI1 NSS -> SPI2 NSS
Yes, it's possible. Just connect two SPI peripherals together and make one of them master and the other slave.
Please have a look at this repo: miniwinwm/BluePillDemo
John Blaiklock, the author, is using CubeIDE and has provided the .ioc files for each project.
BluePillDemo_SPI_IT is a project where two SPI interfaces are configured as master-slave in the same MCU.
If you want, you can use just a master set in full duplex and feed MOSI to the MISO pin. The data you send out should come back in! Put an inverter (appropriate voltage levels!) in the circuit and the inverse data will come in.
That will demonstrate the master is doing its thing. The slave should be easy then. --- madGambol