cancel
Showing results for 
Search instead for 
Did you mean: 

SPI communication - interval between bytes

pass3master
Senior

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

2 REPLIES 2

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.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Thank you for your response.
I see what you mean!

Then we can optimize the HAL code or use DMA for SPI communication!