RM0440 Rev 4 1805/2126
RM0440 Serial audio interface (SAI)
1858
Clock generator programming examples
Table 365 gives programming examples for 48, 96 and 192 kHz.
40.3.9 Internal FIFOs
Each audio block in the SAI has its own FIFO. Depending if the block is defined to be a
transmitter or a receiver, the FIFO can be written or read, respectively. There is therefore
only one FIFO request linked to FREQ bit in the SAI_xSR register.
An interrupt is generated if FREQIE bit is enabled in the SAI_xIM register. This depends on:
• FIFO threshold setting (FLVL bits in SAI_xCR2)
• Communication direction (transmitter or receiver). Refer to Interrupt generation in
transmitter mode and Interrupt generation in reception mode.
Interrupt generation in transmitter mode
The interrupt generation depends on the FIFO configuration in transmitter mode:
• When the FIFO threshold bits in SAI_xCR2 register are configured as FIFO empty
(FTH[2:0] set to 0b000), an interrupt is generated (FREQ bit set by hardware to 1 in
SAI_xSR register) if no data are available in SAI_xDR register (FLVL[2:0] bits in SAI_xSR
is less than 001b). This Interrupt (FREQ bit in SAI_xSR register) is cleared by hardware
when the FIFO is no more empty (FLVL[2:0] bits in SAI_xSR are different from 0b000) i.e
one or more data are stored in the FIFO.
• When the FIFO threshold bits in SAI_xCR2 register are configured as FIFO quarter full
(FTH[2:0] set to 001b), an interrupt is generated (FREQ bit set by hardware to 1 in
SAI_xSR register) if less than a quarter of the FIFO contains data (FLVL[2:0] bits in
SAI_xSR are less than 0b010). This Interrupt (FREQ bit in SAI_xSR register) is cleared
by hardware when at least a quarter of the FIFO contains data (FLVL[2:0] bits in SAI_xSR
are higher or equal to 0b010).
• When the FIFO threshold bits in SAI_xCR2 register are configured as FIFO half full
(FTH[2:0] set to 0b010), an interrupt is generated (FREQ bit set by hardware to 1 in
Table 365. Clock generator programming examples
Input
sai_x_ker_ck
clock frequency
MCLK F
MCLK
/ F
FS
FRL
(1)
OSR NODIV MCKEN MCKDIV[5:0]
Audio Sampling
frequency (F
FS
)
98.304 MHz
Y
512 2
N
-1 1 0 1 0 or 1 192 kHz
512 2
N
-1 1 0 1 2 96 kHz
512 2
N
-1 1 0 1 4 48 kHz
256 2
N
-1 0 0 1 2 192 kHz
256 2
N
-1 0 0 1 4 96 kHz
256 2
N
-1 0 0 1 8 48 kHz
N
- 63 - 1 0 8 192 kHz
- 63 - 1 0 16 96 kHz
- 63 - 1 0 32 48 kHz
1. N is an integer value between 3 and 8.