Skip to main content
TMats.9
Associate
February 24, 2022
Solved

Using spi slave mode,hardware nss setting. Is shift register cleared at nss rise edge?

  • February 24, 2022
  • 6 replies
  • 1413 views

I am using spi slave mode,hardware nss setting.

​when cs is low,if there are a lot of clocks due to noise,

Is shift register cleared at the rising nss edge?

This topic has been closed for replies.
Best answer by TDK
I think it is (see edit) but you can for sure clear it by disabling/reenabling the peripheral.

6 replies

TDK
February 24, 2022

Is NSS is low, SCK toggling due to noise or anything else will be interpreted as clocks and data will be shifted out accordingly. If NSS is high, edges will be ignored.

Edit: I do believe shift register is cleared when NSS transitions high but can't find it stated in the RM.

"If you feel a post has answered your question, please click ""Accept as Solution""."
TMats.9
TMats.9Author
Associate
February 24, 2022

Thank you for your answer.

I thought, when nss is high,the shift register would be reset automatically,is that wrong?

​I want to reset the result of an accidental shift out shift register,when nss is high.

When SCK toggling due to noise or anything else will be interpreted as clocks and data will be shifted out accordingly,

how should I clear shift register?

TDK
TDKBest answer
February 24, 2022
I think it is (see edit) but you can for sure clear it by disabling/reenabling the peripheral.
"If you feel a post has answered your question, please click ""Accept as Solution""."
S.Ma
Principal
February 27, 2022

Nss will tristate the io, so it disconnect the spi from external signals. I think it does not clear anything. Some spi with fifo filled by cyclic dma will remain queued while nss is high, and user will see previous data pushed on the next transaction 4 bytee. Peripheral disable wont help. Sw.reset in syscfg/rcc will.

David Littell
Senior II
February 28, 2022

If you have that much noise while CS is asserted your data is probably garbage anyway.

Fix the real problem - the noise.

TMats.9
TMats.9Author
Associate
March 2, 2022

Thank you for your answer.

I have resolved.

I tested it on MCU, when NSS was asserted,shift register was reset.