cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect end of SPI transmission?

toby2
Senior
Posted on December 20, 2017 at 13:27

STM32F030.

I am transmitting multiple words via spi to some shift registers and need to latch the shift registers when the transmission of the last word is finished. The latch signal is GPIO. Device is master.

I don't want to block or poll for SPI busy.

The only way I can think to do this is to to use duplex and count (and discard) the receive bytes. Is there a better way?

TIA.

Toby

#stm32f030-spi #transmission #spi
11 REPLIES 11
Posted on December 21, 2017 at 04:56

You already have a printed circuit board. I was counting on the arbitrary use of resources and contacts of the microprocessor.

For external expansion, there is no difference in who controls the NSS and SCK signals. The main thing is that the microprocessor on time gave and received data. In the case of controlling the NSS and SCK signals via timers, the DMA is not able to wait for its turn to access data even for a minimal time. Presence of priorities is mandatory.

The stop procedure is not mandatory, but will allow you to monitor the extended external port. The port snaps in when the NSS is up, the data is shifted - think what happens when the station stops abruptly.

Interruption ... I was referring to software processing of data transmission. Manual start and wait completion through an interrupt. Wait for the completion of the function is optional. You can do something useful. And at the moment when you need to update the contents of the external extension - check the state of the flag. The flag sets the manual start, and resets the transfer end interrupt.

Waiting before execution is much more beneficial than waiting for execution itself.
Posted on December 21, 2017 at 08:57

Ok, I understand now. Thanks for your help!