cancel
Showing results for 
Search instead for 
Did you mean: 

How to communicate two devices using SPI(STM32L0 and STM32L1)?

Huzaifah Limbada
Associate II
Posted on April 07, 2018 at 12:15

I want to communicate STM32L053 and STM32L151 using the SPI,STM32L0 as master and STM32L1 as slave.

The flow is to catch the character from the USART of L0 and transmit it to the MOSI of the L0 and slave(L1) has to receive and retransmit it to the MISO pin and display it on the USART.

After recieving character from the MISO pin L1 has to send and display it on the USART.

But Slave recieves the some garbage value, both boards run on the same frequency of 24 MHz.

Is there any solution for this problem?

Thank you!

#hal-spi #stm32l0 #stm32l1
1 REPLY 1
Posted on April 07, 2018 at 17:03

>>Is there any solution for this problem?

Probably, you're in control here.

If you lose synchronization you might need to reset either side of the link. If it is happening a lot you might want to review the connectivity, and how much time the slave is spending on servicing the SPI, likely going to want to decouple the read from SPI from the write to the USART/Display.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..