Skip to main content
Associate II
September 7, 2023
Solved

EOT to early

  • September 7, 2023
  • 8 replies
  • 2495 views

Hi.

implementing a SPI master (NOT using HAL) with software based SS i am searching for the right way to detect the end of a transmission to release the SS again.

EOT (in SPI_SR) gets set when the last Bit is is set to the MOSI Lane. 

--> so this is too early since the there is a full clock cycle remaining until SS should be reset.

Is there any Signal that could be used to know that the Transfer on the SPI BUS is full finished? Using the Hardwaree SS is working fine But since I have a multi-slave environment I would like to use software based SS.

 

 

 

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

my current workadound is to use EOT as a trigger to release the SS and restrict the minimum speed that can be used on SPI.

 

YELLOW: NSS

RED: SCLK

125kbit/s (NSS is released too early): 

dbahr_0-1694422294883.png

 

1Mbit/s (NSS is released correctly): 

 

dbahr_3-1694422608241.png

 

 

 

8 replies

Issamos
Super User
September 7, 2023

Hello @dbahr 

You can use th EOT and a clock cycle delay. EOT is set ->a clock cycle delay (using a TIM for example) ->release the SS again.

Best regards.

II

dbahrAuthor
Associate II
September 7, 2023

thank you for your quick reply. Was hoping that there is a dedicated signal that could be used directly to know that transmission is finished. 

Best regards

David

Issamos
Super User
September 7, 2023

Your best option for this is the EOT signal.

When your question is answered close the topic by choosing a best answer.

Best regards.

II

Pavel A.
September 9, 2023

In full duplex (bi-directional) mode, you can use the RX non empty flag. It means that all master bits have been completely clocked out and slave bits clocked in. When it set, SS can be turned off.

dbahrAuthor
Associate II
September 11, 2023

Hi, RX non empty Flag is also triggered too early. As I understand it is wordwise and not going 0 when the last bit is transmitted. 

 

Issamos
Super User
September 11, 2023

I think, in that case,my solution can give you exactly what you are looking for (signal EOT start TIMER and then the TIMER signal trigger the SS reset.

Best regards.

II

waclawek.jan
Super User
September 11, 2023

If you have control over slaves, try the other CPHA setting.

JW

dbahrAuthorBest answer
Associate II
October 5, 2023

my current workadound is to use EOT as a trigger to release the SS and restrict the minimum speed that can be used on SPI.

 

YELLOW: NSS

RED: SCLK

125kbit/s (NSS is released too early): 

dbahr_0-1694422294883.png

 

1Mbit/s (NSS is released correctly): 

 

dbahr_3-1694422608241.png