Blue Pill 2 SPI networks

I have read on STMicrodevices internet forum that it is possible to run two SPI networks at the same time. But there is a problem in doing this since the STMcubemx uses SPI1 and SPI2 to designate the two comms, is there another way to define the two individually?

Why this is not suitable for you?

That works for STMcubemx but not for using Arduino IDE

This can be used in Arduino too. I use two SPI buses in my program on STM32.

Could you please write why you need this and provide the code of your program where you plan to use two SP interfaces?

B707,
Since posting and surfing other forums, it appears that most of the people on the forums don't understand the need for two different SPI networks, but you may be the exception in this case. This project uses 3 - LS7366 encoder counter chips that communicate via SPI, and my main communication to the outside world is a Ethernet shield using SPI.

I tried to use the STMcubeIDE, that went ok until I tried to use some Arduino Libraries for 2 chips MCP23017 2ea and PCF8574 3ea. I could not get around 3 errors on build. So...... I tried to switch to Arduino 2.3.2 to get my Blue Pill programmed. The only problem that I have with Arduino 2.3.2 it doesn't recognise SPI1 and SPI2. I'll have to define the two networks, but I will need help.

Afraid I am not. It seems that in your case I don't see requirements to you to use a different SPI buses .
Do you understand, that you can connect all three modules to the same SPI?

b707,
I bread boarded my wanted design, with three LS7366's and an Ethernet Shield connected to the SPI network using first a SAMD21(XIAO) , the ethernet worked okay and the LS7366 didn't. After trying many different software and hardware changes, I found that removing the ethernet shield from the network, the LS7366's worked. So I looked for a board that could supply 2 different SPI networks, the Blue Pill had what I needed, but I was lacking the knowhow to get coding to work both SPI networks at the same time in the STM32 environment. (There doesn't appear to be a STM32 Library for the PCF8574 for three of the chips I wanted to use) Arduino is not too friendly in that regards. Any way I can get my project to work using two Mini Pro's, not what I wanted but.....

I used the STM32 IDE, to set up the stm32f103c8t6 using two SPI networks, but couldn't compile without errors due to the pcf8574 arduino library, there doesn't appear to be a library for this chip for STM32 boards.

What's the pcf8574 has to do with your problem with two spi buses? It's i2c chip

b707,
just another issue to overcome.
I am now having a problem with the compiler not recognizing my subroutines, I am using Arduino version 2.3.2 and/or version 1.18.19.
The sample error message is :
C:\Users\MJB\Documents\STM Projects\Motion_Combined_XYZ_Speed_Truncated_STM\Motion_Combined_XYZ_Speed_Truncated_STM.ino:195:3: error: 'encoderx' was not declared in this scope; did you mean 'selEncoderx'?
195 | encoderx();
| ^~~~~~~~
there a lot of these messages.
Thanks in advance,
Unlike

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.