Sai Synchronization Mode - ST STM32F446 Series Reference Manual

Advanced arm-based 32-bit mcus
Hide thumbs Also See for STM32F446 Series:
Table of Contents

Advertisement

Serial audio interface (SAI)
Slave mode
The SAI expects to receive timing signals from an external device.
If the SAI sub-block is configured in asynchronous mode, then SCK_x and FS_x pins
are configured as inputs.
If the SAI sub-block is configured to operate synchronously with another SAI interface
or with the second audio sub-block, the corresponding SCK_x and FS_x pins are left
free to be used as general purpose I/Os.
In slave mode, MCLK_x pin is not used and can be assigned to another function.
It is recommended to enable the slave device before enabling the master.
Configuring and enabling SAI modes
Each audio sub-block can be independently defined as a transmitter or receiver through the
MODE bit in the SAI_xCR1 register of the corresponding audio block. As a result, SAI_SD_x
pin will be respectively configured as an output or an input.
Two master audio blocks in the same SAI can be configured with two different MCLK and
SCK clock frequencies. In this case they have to be configured in asynchronous mode.
Each of the audio blocks in the SAI are enabled by SAIEN bit in the SAI_xCR1 register. As
soon as this bit is active, the transmitter or the receiver is sensitive to the activity on the
clock line, data line and synchronization line in slave mode.
In master TX mode, enabling the audio block immediately generates the bit clock for the
external slaves even if there is no data in the FIFO, However FS signal generation is
conditioned by the presence of data in the FIFO. After the FIFO receives the first data to
transmit, this data is output to external slaves. If there is no data to transmit in the FIFO, 0
values are then sent in the audio frame with an underrun flag generation.
In slave mode, the audio frame starts when the audio block is enabled and when a start of
frame is detected.
In Slave TX mode, no underrun event is possible on the first frame after the audio block is
enabled, because the mandatory operating sequence in this case is:
1.
Write into the SAI_xDR (by software or by DMA).
2.
Wait until the FIFO threshold
3.
Enable the audio block in slave transmitter mode.
28.3.4

SAI synchronization mode

There are two levels of synchronization, either at audio sub-block level or at SAI level.
Internal synchronization
An audio sub-block can be configured to operate synchronously with the second audio sub-
block in the same SAI. In this case, the bit clock and the frame synchronization signals are
shared to reduce the number of external pins used for the communication. The audio block
configured in synchronous mode sees its own SCK_x, FS_x, and MCLK_x pins released
back as GPIOs while the audio block configured in asynchronous mode is the one for which
FS_x and SCK_x ad MCLK_x I/O pins are relevant (if the audio block is considered as
master).
934/1328
) flag is different from 000b (FIFO empty).
(FLH
RM0390 Rev 4
RM0390

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F446 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Rm0390

Table of Contents

Save PDF