-
Notifications
You must be signed in to change notification settings - Fork 1k
Need help in SPI. #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
By default
See
SPI2 is available on pin PB15/PB14/PB13.
To use the second one: |
Hi @Vicky-S |
Default SPI works well. But getting error in using 2nd SPI. error: 'SPIClass' does not name a type SPIClass SPITwo(PB15, PB14, PB13); ^~~~~~~~ exit status 1 |
Looks strange....
I assume you well include SPI.h. |
Ok. Sorry my mistake. I didn't extern the SPI Library. It works fine. |
Likewise how can I use several I2C and UART in STM32F103. ? |
Default I2C is on PB7/PB6 (D2/D3)
So using Wire instance will use those pin. else you can use the second I2C like that: TwoWire i2cTwo(PB11, PB10); or if you want change the default pin for Wire instance call this before begin() :
For uart/i2c/SPI, this is the same basic usage as Arduino except some API added which has been added for better flexibility. Example the setSDA/SCL. There is some other added for SPI (setMISO,...), serial (setRx,..) Here I use stm32 pin name PXy but you can also use the pin number Dx or x. |
Ok. Thanks. |
I got successfully programmed STM32F103 and I can able to do basic tasks.
Now I need help in using 2 SPI in STM32F103 at the same time. The STM32F103 has 2 SPI. Which is the default one uses Arduino SPI library and how can I initialize another SPI?
I need to access 2 SPI at the same program. I have tried to parallel the SPI devices in single library but its not working well. That's why I try to use 2 SPI.
The text was updated successfully, but these errors were encountered: