cancel
Showing results for 
Search instead for 
Did you mean: 

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

TMats.9
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
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".

View solution in original post

6 REPLIES 6
TDK
Guru

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".

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?

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

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.

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

Fix the real problem - the noise.

TMats.9
Associate II

Thank you for your answer.

I have resolved.

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