cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 SPI Clock phase

Ghada Dhibi
Associate II
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
1 REPLY 1
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