
AT32F413
Series Reference Manual
2022.06.27
Page 171
Rev 2.00
Note: Read/Write operation mode depends on the selected audio protocols, data bits and channel
bits. The following lists all possible configuration combinations and their respective read and write
operation mode.
Philips, PCM, MSB-aligned or LSB-aligned standard, 16-bit data and 16-bit channel
The number of data bits is the same as the channel bit. Each channel requires one read/write
operation from/ to the SPI_DT register, and the number of DMA transfer is 1.
Philips, PCM or MSB-aligned standard, 16-bit data and 32-bit channel
The data bit is different from the channel bit. Each channel requires one read/write operation
from/to the SPI_DT register, and the number of DMA transfer is 1. The first 16 bits are valid, and
the last 16-bit is forced to 0 by hardware.
Philips, PCM or MSB-aligned standard, 24-bit data and 32-bit channel
The number of data bits are different from that of the channgle bit. Each channel requires two
read/write operations from/to the SPI_DT register, and the number of DMA transfer is 2. The first
16-bit channel transmits and receives the first 16-bit data, while the last 16-bit channel transmits
and receives the 8-bit MSB data, with 8-bit LSB data forced to 0 by hardware.
Philips standard, PCM standard, MSB-aligned or LSB-aligned standard, 32-bit data and 32-bit
channel
The number of data bits are the same as the channel bit. Each channel requires two read/write
operations from/to the SPI_DT register, and the number of DMA transfer is 2. These 32-bit data
are proceeded in two times, with 16-bit data each time.
LSB-aligned standard, 16-bit data and 32-bit channel
The number of data bits is different from that of the channel bit. Each channel requires one
read/write operation from/to the SPI_DT register, and the number of DMA transfer is 1.
Only the
last 16 bits are valid, while the first 16-bit data are forced to 0 by hardware.
LSB-aligned standard, 24-bit data and 32-bit channel
The number of data bits is different from that of the channel bit. Each channel requires two
read/write operations from/to the SPI_DT register, and the number of DMA transfer is 2.
For the first 16-bit channel, only the 8-bit LSB are valid, and the 8-bit MSB are forced to 0 by
hardware; The last 16-bit channel transmits and receives the second 16-bit data.
13.3.4 I2S_CLK controller
When used as I
2
S interface, all the audio protocols supported by this interface are synchronous protocols.
In master mode, it is necessary to generate a communication clock for data reception and transmission
on the SPI, and the communication clock should be output to the slave via IO for data reception and
transmission. In slave mode, the communication clock is provided by master, and is input to the SPI via
IO. In all, the I2S_SCK controller is used for the generation and distribution of I2S_SCK, with the
configuration procedure detailed as follows:
When used as I2S master, the SPI can provide communication clock (CK) and main peripheral clock
(MCK) shown in Figure 13-12. The CK and MCK are generated by HCLK divider, with the prescaler of
the MCK depending on I2SDIV and I2SODD. The calculation formula is seen in Figure 13-12.
The frequency division factor of the CK depends on whether to provide the main clock for peripherals.
To ensure that the main clock is always 256 times the audio sampling frequency, Besides, the numer of
channel bits should also be taken into account. When the main clock is needed for peripherals, the CK
should be divided by 8 (I2SCBN=0) or 4 (I2SCBN=1), and then divided by the same frequency divions
factor as that of the MCK before getting the final communication clock; When the main clock is not
needed for peripherals, the the frequency division factor of the CK is determined by I2SDIV and I2SODD,
shown in