cancel
Showing results for 
Search instead for 
Did you mean: 

Usart as SPI

Emin ATES
Associate II

Are there any example that uses USART as SPI ? Currently I am using stm32g071kbt6 mcu for a project and i have to use USART peripheral as SPI. Other SPI peripherals on use. I found a few presentation about USART that says USART can be use as SPI and various communication. But I couldnt find any piece of example code... Can anyone provide me sample code that uses USART as SPI? By the way stm32g071kbt6 have USART which can be use as SPI according to datasheet. Thanks in advance.

4 REPLIES 4
S.Ma
Principal

Check on the nucleo cube library examples.

There is another way to do it. If you implement SPI Master, if time multiplexed, you can dynamically change the SPI pins to be different port,

usually there are multiple MISO/MOSI/SCK pins for the same SPI, you can switch from a pair of pins to another and use same code.

CubeMX think static HW configuration... chipset can also be dynamic and it works fine!

My take on the synchronous SPI-like usage of USART, (formatting destroyed due to forum migration), on a 'F40x : https://community.st.com/s/feed/0D50X00009bLS7GSAW

JW

Thank you for your suggestion but spi peripherals have critical role and can't be use for other job. If i can use spi peripherals for multiple job it can be with CS switching as well.

Thank you for your answer. It is what I expect. I will try to configure my project and make feedback.