Skip to main content
Graduate
April 23, 2024
Question

Delay in SPI Transfer with STM32H7

  • April 23, 2024
  • 11 replies
  • 3442 views

Dear Forum

Im using STM32 H755 ZI in the starter kit.

 

I set the Timer 4 for generate a Interrupt each 1ms.

At begin of INT:

     -I toggle a PIN,

      -and, send a SPI data (8 byte or 16..not important)

What I noted is a delay of almost 10uS beetwen pin toggle and begin of 1st bit TX from

SPI (begin of SPI transmission i means)

Some data:

FCPU=64M coming from internal 64M HSI

SPI1_CLK=4M coming from PER_CLK =64M  (with SPI prescaler=16  -->4M) 

FAPB=64M

Code inside INT Timer:

HAL_GPIO_TogglePin(PF10Test_GPIO_Port, PF10Test_Pin);

HAL_SPI_Transmit(&hspi1, p_Data16b, 1, 100);

__HAL_TIM_CLEAR_FLAG(htim4, TIM_FLAG_UPDATE);

 

Thanks for your help

Roberto

    This topic has been closed for replies.

    11 replies

    RoibertAuthor
    Graduate
    June 12, 2024

    Dear Forum

    I modify the freq of CPU and SPI, and get to the conclusion that max distance beetwen 2 consecutive transmisson is circa 1uS (distance bettwen 2 H->L transiction of CS) ; in particular:

    - delay decrease if Baud rate increase

    -delay decrease if CPU freq incresae.

    But this decrease reach a minimun, and then stop (not linear).

    Question is what is limiting this disrtance ?

    Thanks

    Roberto