Serial audio interface (SAI)
executed to recover from an underrun error detected via the underrun interrupt or the
underrun status bit:
1.
Disable the DMA stream (via the DMA peripheral) if the DMA is used.
2.
Disable the SAI and check that the peripheral is physically disabled by polling the
SAIXEN bit in SAI_xCR1 register.
3.
Clear the COVRUNDR flag in the SAI_xCLRFR register.
4.
Flush the FIFO by setting the FFLUSH bit in SAI_xCR2.
The software needs to point to the address of the future data corresponding to a start of
new block (data for preamble B). If the DMA is used, the DMA source base address
pointer should be updated accordingly.
5.
Enable again the DMA stream (DMA peripheral) if the DMA used to manage data
transfers according to the new source base address.
6.
Enable again the SAI by setting SAIXEN bit in SAI_xCR1 register.
Clock generator programming in SPDIF generator mode
For the SPDIF generator, the SAI shall provide a bit clock equal to the symbol-rate. The
table hereafter shows usual examples of symbol rates with respect to the audio sampling
rate.
Audio Sampling Frequencies (F
More generally, the relationship between the audio sampling rate (F
(F
) is given by the formula:
SCK_X
F
=
S
39.3.11
Specific features
The SAI interface embeds specific features which can be useful depending on the audio
protocol selected. These functions are accessible through specific bits of the SAI_xCR2
register.
Mute mode
The mute mode can be used when the audio sub-block is a transmitter or a receiver.
Audio sub-block in transmission mode
In transmitter mode, the mute mode can be selected at anytime. The mute mode is active
for entire audio frames. The MUTE bit in the SAI_xCR2 register enables the mute mode
when it is set during an ongoing frame.
1336/1693
Table 212. Audio sampling frequency versus symbol rates (SHARK)
44.1 kHz
48 kHz
96 kHz
192 kHz
F
SAI_CK_x
-------------------------
64
DocID024597 Rev 3
)
S
RM0351
Symbol-rate
2.8224 MHz
3.072 MHz
6.144 MHz
12.288 MHz
) and the bit-clock rate
S
Need help?
Do you have a question about the STM32L4x6 and is the answer not in the manual?
Questions and answers