cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L476RG SPI gap between transmission

Posted on April 27, 2017 at 09:20

Hello all,

I'm trying to setup the STM32L476RG via SPI with an external DAC (SPI clock speed: 40MHz). I used the HAL_SPI_Transmit() function to transmit a 24Bit word.After one transmission there is a gap of 2.5�s befour the new transmission starts. For my application I need a fast transmission. Is there a posibility to purge the gap?

Thank you in advance,

Fabian

#stm32l4 #spi #spi-bus #gap
12 REPLIES 12
Posted on May 22, 2017 at 12:18

SPI is usually synchronous and duplex, i.e. there is data reception with every transmission.

Not sure if the Cube code ignores RX-related events. Neither do I use Cube.

Posted on May 22, 2017 at 13:18

Yes, because the end of a byte transmission is driven by RXNE. The DMA TX interrupt will occur before the last byte is push out of the MOSI pin... so raising NSS will chop the last byte.

Posted on May 23, 2017 at 17:09

In order being well suited with DMA&SPI usage, I'm working on the exemple provided in HAL_Driver folder nommed SPI_FullDuplex_ComDMA. But when I use the DMA in Normal mode ( as described in the file) i got nothing on spi pins output, in contrast when I configured it in circular mode I saw the transmission via the oscilloscope.

I don't understand why normal mode doesn't work.