Skip to main content
Visitor II
June 28, 2020
Solved

SPI slave and SSI bit

  • June 28, 2020
  • 2 replies
  • 3093 views

Hi there,

Lets say my device is configured as an SPI slave device with a software NSS pin. The STM32 HAL API doesn't use the SSI bit from CR1 register at all. I was wondering, what actually happens to the SPI peripheral when I manually set or clear that bit? If I call HAL_SPI_TransmitReceive_IT and then call CLEAR_BIT(spis->hSpi->Instance->CR1, SPI_CR1_SSI), will that mean that any data clocked to the SPI slave device will be just ignored without affecting the state of the SPI slave peripheral? I am actually trying to implement this functionality- In the system there is one master any many slaves that are chosen via separate NSS pins. In my slave device code, I am handling the NSS signal manually as EXTI input and I want to set/ clear the SSI bit there. Is this approach correct, or do I not understand something?

I have found this topic, but its left unanswered. The author seems confused too.

I would appreciate all help.

    This topic has been closed for replies.
    Best answer by waclawek.jan

    If SSM is set, SSI's function is the same as the NSS pin's when SSM is cleared.

    JW

    2 replies

    Super User
    June 28, 2020

    If SSM is set, SSI's function is the same as the NSS pin's when SSM is cleared.

    JW

    Visitor II
    June 29, 2020

    Thank you for answer,

    So if I understand correctly, after SSM is set (software NSS mechanism), I need to clear the SSI anytime I want to receive as slave and set SSI anytime I dont want to receive anything (my MISO stays high-Z)?

    Super User
    June 29, 2020

    Yes.

    JW