Serial peripheral interface / inter-IC sound (SPI/I2S)
RM0365
939/1080
DocID025202 Rev 7
30.7.5 Clock
generator
The I
2
S bit rate determines the data flow on the I
2
S data line and the I
2
S clock signal
frequency.
I
2
S bit rate = number of bits per channel × number of channels × sampling audio frequency
For a 16-bit audio, left and right channel, the I
2
S bit rate is calculated as follows:
I
2
S bit rate = 16 × 2 × f
S
It will be: I
2
S bit rate = 32 x 2 x f
S
if the packet length is 32-bit wide.
Figure 376. Audio sampling frequency definition
When the master mode is configured, a specific action needs to be taken to properly
program the linear divider in order to communicate with the desired audio frequency.
Figure 377. I
2
S clock generator architecture
1. Where x can be 2 or 3.
presents the communication clock architecture. By default, the I2Sx clock is
always the system clock. To achieve high-quality audio performance, the I2SxCLK clock
source can be an external clock (mapped to the I2S_CKIN pin). Refer to
Clock configuration register (RCC_CFGR)
.
The audio sampling frequency may be 192 KHz, 96 kHz or 48 kHz. In order to reach the
desired frequency, the linear divider needs to be programmed according to the formulas
below:
069
RUELWOHIW
FKDQQHO
RUELW
ULJKWFKDQQHO
RUELWV
VDPSOLQJSRLQW
VDPSOLQJSRLQW
)
6
)
6
DXGLRVDPSOLQJIUHTXHQF\
069
0&.2( 2''
ELWOLQHDUGLYLGHU
UHVKDSLQJVWDJH
'LYLGHUE\
'LY
,ð6',9>@
,ð602'
&+/(1
0&.2(
&.
0&.
,ð6[&/.