Skip to main content
MGaja.1
Visitor II
January 21, 2020
Question

Hello, I am trying to measure the time requires to transmit and receive the data over spi between two boards, I have tried DWT but DWT gives cycles according to system frequency(core) , I want the time require by the spi only.

  • January 21, 2020
  • 3 replies
  • 846 views

I am using stm32f429i discovery and stm32f429i eval boards for communication. Can anyone help me?

This topic has been closed for replies.

3 replies

KnarfB
Super User
January 21, 2020

read DWT twice, once immediately before you start the DPI transfer, once on completion. The difference, divided by SystemCoreClock gives you the time?

Tesla DeLorean
Guru
January 21, 2020

The math going from processor ticks to time is relatively pedestrian, you need to wait for the SPI data to clear the wire, as TXE signals when the shift register is loaded, not when all the bits have shifted out.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
S.Ma
Principal
January 21, 2020

you can also run the SPI transaction say 1 000 000 times and use HAL_GetDelay() before and after to get an educated guess of the average speed.