2024-12-04 11:45 PM - last edited on 2024-12-05 01:00 AM by Andrew Neil
Question about SPI communication interval
We are using HAL_SPI_TransmitReceive to achieve SPI communication, but there is an interval of some us after the SCLK outputs for 8 bits. Is it possible to change this interval time?
Solved! Go to Solution.
2024-12-05 12:59 AM
That's probably just the overhead in the HAL code while it handles completion of the previous byte, fetches the next byte, and starts transmission of that next byte.
@pass3master wrote:Is it possible to change this interval time?
What compiler optimisation level are you currently using? What happens if you increase it?
Have you tried using DMA?
Otherwise, optimise the code by hand.
2024-12-05 12:59 AM
That's probably just the overhead in the HAL code while it handles completion of the previous byte, fetches the next byte, and starts transmission of that next byte.
@pass3master wrote:Is it possible to change this interval time?
What compiler optimisation level are you currently using? What happens if you increase it?
Have you tried using DMA?
Otherwise, optimise the code by hand.
2024-12-05 01:02 AM
Thank you for your response.
I see what you mean!
Then we can optimize the HAL code or use DMA for SPI communication!