Skip to main content
Explorer II
July 22, 2025
Solved

SPI Communication with Peripherals in Different Modes (Mode 0 & Mode 1)

  • July 22, 2025
  • 1 reply
  • 210 views

Good afternoon Team,

I am working on a project where I need to interface two SPI peripherals with an ST microcontroller (STM32G070RBT6).
One peripheral (ADS124S06) operates in 
SPI Mode 1 (CPOL=0, CPHA=1), and the other (64128L FC BW-RGB Display) in SPI Mode 0 (CPOL=0, CPHA=0).
Both peripherals must operate concurrently to ensure real-time data visualization.

  1. Is it possible to use a single SPI interface for both peripherals, even though they require different modes?

  2. If yes, what is the best way to handle this?  ---Should I reconfigure the SPI mode dynamically before communicating with each device?
  3. Are there any potential timing or synchronization issues to consider?

Thank you in advance for your support!

    This topic has been closed for replies.
    Best answer by TDK

    1) Yes.

    2) Yes. Depending on your comfort level, either reconfigure directly in registers or tear the whole thing down with HAL_SPI_DeInit and set back up in HAL_SPI_Init. Ensure CS pins remain high while other pins are reconfigured.

    3) In general, no. If CS pins are handled appropriately, the device will ignore the other SPI line activity while CS pins are low. Double check datasheets to ensure this is the case. Ensure CLK line is activated prior to setting CS low. A logic analyzer will help out here.

    1 reply

    TDKAnswer
    Super User
    July 22, 2025

    1) Yes.

    2) Yes. Depending on your comfort level, either reconfigure directly in registers or tear the whole thing down with HAL_SPI_DeInit and set back up in HAL_SPI_Init. Ensure CS pins remain high while other pins are reconfigured.

    3) In general, no. If CS pins are handled appropriately, the device will ignore the other SPI line activity while CS pins are low. Double check datasheets to ensure this is the case. Ensure CLK line is activated prior to setting CS low. A logic analyzer will help out here.