Skip to main content
Associate II
July 10, 2024
Question

Using SPI Commuication with desired rate in Nucleo-f469ZI board

I am using Nuckeo-F429ZI board for my project.

I am using SPI HAL drivers for the SPI communication.
I need to transmit a data stream of 12 bytes for every 10 micro seconds with clock speed pf 2 MHz.

I have tried it using SPI HAL drivers, but I'm getting lot of delay between each transmission which is in the order of milli meters. But i need the delay to be in order of micro meters.
Is it possible any how to get my desired results using this board by Interrupt mode or DMA Mode?
Please help

Thanks in advance

 

 

This topic has been closed for replies.

3 replies

TDK
July 10, 2024

> I need to transmit a data stream of 12 bytes for every 10 micro seconds with clock speed pf 2 MHz.

To transmit 12 bytes (96 bits) at 2 MHz clock speed, it takes 48 microseconds. You'll need to increase bus speed to even have a chance of this working.

For high speed, it's best to write your own interface to the SPI peripheral. IT and DMA will also have delays from the setup time when using HAL.

"If you feel a post has answered your question, please click ""Accept as Solution""."
PraneethAuthor
Associate II
July 10, 2024

Hi Guru,

Thanks for the reply. The delay I've specified is after successful SPI transaction of 12 bytes.

TDK
July 11, 2024

If HAL is not fast enough, you'll need to write your own code. The reference manual is quite detailed in what is needed to do this. There's no simple "make it 1000x faster" switch you can flip on HAL. However, if you're seeing a delay of several milliseconds, it suggests your code is doing stuff other than calling SPI transmit, as HAL_SPI_Transmit doesn't have that much overhead.

"If you feel a post has answered your question, please click ""Accept as Solution""."