Skip to main content
JT.1
Associate
October 19, 2021
Question

How to calculate the execution time of SAI transfer (I2S)?

  • October 19, 2021
  • 4 replies
  • 1310 views

How to calculate the time taken for the data to be transmitted out to the audio amplifier using the SAI I2S protocol? Is there an inbuilt register or any other way I can calculate this?

This topic has been closed for replies.

4 replies

LCE
Principal II
October 19, 2021

"the data"? Which data from which source to I2S?

JT.1
JT.1Author
Associate
October 19, 2021

Hello,

Thank you for your response.

I'm using the STM32L452RET-P.

Also, I'm using the SAI_Transmit_DMA.

Audio Data from the memory(DMA) to the audio amplifier using the I2S Protocol of the SAI Peripheral.

LCE
Principal II
October 19, 2021

Do you mean something like that?

When the SAI FIFOs are not used it's simple as that:

audio sampling rate * (bytes/sample) * number of channels

example:

48 kHz, 24bit ( = 3 bytes), stereo

=> 96 kSamples/s = 288 kByte/s = 2.304 Mbit/s

LCE
Principal II
October 19, 2021

Stupid me, that was the data rate...

But from there you should get where you want. ;)