Skip to main content
Ghada Dhibi
Associate II
July 26, 2017
Question

STM32L4 SPI Clock phase

  • July 26, 2017
  • 1 reply
  • 725 views
Posted on July 26, 2017 at 17:30

Hi All, 

I'm using STM32L486RG microcontroler and 2 sensors using the same SPI interface (SPI1) 

I'm asking how to configure the SPI1 to communicate with 2 sensors when : 

  • first sensor is working with SPI_PHASE_1EDGE 
  • sencond sensor is working with SPI_PHASE_2EDGE

Is it possible to communicate with both of them using the same SPI configuration ? 

Thanks a lot. 

Ghada

#spi #stm32l4-spi #spi-clkphase #stm32l4
This topic has been closed for replies.

1 reply

waclawek.jan
Super User
July 26, 2017
Posted on July 26, 2017 at 18:16

No.

To change from one sensor to the other, you need to disable SPI by clearing SPI_CR1.SPE, change CPOL/CPHA configuration, and then reenable SPI_CR1.SPE.

JW