Skip to main content
Osto
Senior
July 18, 2013
Question

STM32F407 dont stop SPI communication properly

  • July 18, 2013
  • 1 reply
  • 582 views
Posted on July 18, 2013 at 21:19

Hi,

I have Problems with STM32F407VGT6 and SPI,

I read from SPI 2x 16-bit words from device. In documentation is written after the first word is read then wait for short period that th one clock cycle starte then disable the SPI and wait until the commnication is going to end. The communication is read only with Software managed chip select.

But this is not working. When I disable SPI, the communication stops immediatley and the cycle is incomplete. When  I disable all Interrupts and wait until the second word is complete then everything is working but I block the CPU for Long time. That couldnt be the solution!?

Do have anybody an idea how to stop the SPI clock exactly after end of second cycle. Using Interrupt is not a solution.

Thanks for your help.

#stm32f-spi-stop
This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
July 18, 2013
Posted on July 18, 2013 at 22:52

TXE is not a good signal to determine if SPI is busy, RXNE better reflects the TC (Transmission Complete) state after the last bit has shifted out.

Not sure why you would disable interrupts.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..