2017-04-27 12:20 AM
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 #gap2017-04-27 04:48 AM
You might need to show relevant part of your code, this is definitely not a hardware/peripheral issue.
Profiling and measuring your application would be even better.
2017-04-27 08:37 AM
Tell HAL_SPI_Transmit() to send multiple words, better still look at the code behind-the-curtain, the HAL permits/enables a whole circus of stupidity. Avoid.
2017-05-19 08:26 AM
Hello Clive ,
Do you manage to resolve this issue ?
2017-05-19 01:05 PM
Not my issue, no time invested in it here.
2017-05-21 02:13 AM
When high baud rate is needed, use dma with its interrupts on the rx dma side only. Then the isr will define the pause time between packets transmission.
2017-05-21 06:16 AM
2017-05-21 06:07 PM
Spi requires 2 dma streams, one for tx and one for rx. It seems only one declared here.
2017-05-21 06:23 PM
Even though I don't receive any message (transmission only).
2017-05-22 03:13 AM
DMA1_init_struct.Instance->CMAR = Txdata; // Specify memory address that contains data to transmit.
DMA1_init_struct.Instance->CPAR = SPI1->DR; // Data register of the SPI peripheral to read received data. DMA1_init_struct.Instance->CNDTR = 16; // Number of elements to receive (our buffers consist of 8 byte elements) DMA1_init_struct.Instance->CCR |= DMA_CCR_EN|DMA_CCR_TCIE|DMA_CCR_HTIE ; // Enable the DMA streamI don't use Cube but I'd say you are supposed to use some prescribed incantation rather directly manipulate the DMA registers. In other words, I wouldn't mix the two approaches.
DMA1_init_struct.Instance->CPAR = SPI1->DR; // Data register of the SPI peripheral to read received data.
You want to take the address of data register, not its content.
JW