cancel
Showing results for 
Search instead for 
Did you mean: 

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

JT.1
Associate II

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?

4 REPLIES 4
LCE
Principal

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

JT.1
Associate II

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

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

Stupid me, that was the data rate...

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