AT32F425
Series Reference Manual
2022.03.30
Page 177
Ver 2.01
Philips standard, PCM standard, MSB-aligned or LSB-aligned standard, 32-bit data and 32-bit
channel
The data bit is 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 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 16 bits (LSB) are the significant bits
while the first 16-bit data (MSB) are forced to 0 by hardware.
LSB-aligned standard, 24-bit data and 32-bit channel
The data bit is different from 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 data, its 8-bit LSB are
the significant bits, with the 8-bit MSB forced to 0 by hardware; the subsequent 16 bits transmit and
receive the second 16-bit data.
13.3.5 I2S_CLK controller
The audio protocols the SPI supports adopts synchronous transmission. In master mode, it is required
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
. The CK and MCK are generated by HCLK divider, with the prescaler of
the MCK determined by I2SDIV and I2SODD. The calculation formula is seen in
..
The prescaler of the CK depends on whether to provide the main clock for peripherals. To ensure that
the main clock is always 256 times larger than the audio sampling frequency, The channel bits should
be taken into account. When the main clock is needed, the CK should be divided by 8 (I2SCBN=0) or 4
(I2SCBN=1), then divided again by the same prescaler as that of the MCK, that is the final
communication clock; When the main clock is not needed, the the prescaler of the CK is determined by
I2SDIV and I2SODD, shown in Figure
..
Figure 13-22 CK & MCK source in master mode
Divided by
(2xI2SDIV[9:0]+I
2SODD)
Divided by 8
Divided by 4
HCLK
MCK
CK
I2SMCLKOE
Divided by
(2xI2SDIV[9:0]+I
2SODD)
Divided by
(2xI2SDIV[9:0]+I
2SODD)
~CHLEN
CHLEN
I2SMCLKOE
1
0
Apart from the above-mentioned configuration, the following table lists the values of I2SDIV and I2SODD
corresponding to some specific frequencies, as well as their respective error for the users to configure
the I2SDIV and I2SODD.