
M451
May. 4, 2018
Page
743
of
1006
Rev.2.08
M4
51
S
E
RI
E
S
T
E
CH
NICA
L RE
F
E
R
E
NC
E
M
A
NU
A
L
Select the source of SPI2 peripheral clock on SPI2SEL (CLK_CLKSEL2[7:6]).
Enable SPI2 peripheral clock in SPI2CKEN (CLK_APBCLK0[14]).
Reset SPI2 controller in SPI2RST (SYS_IPRST1[14]).
SPI/I
2
S Interface Controller Pin description is shown as Table 6-35:
Pin
SPI Mode
I
2
S Mode
SPIn_SS
SPI slave selection pin
I
2
S left/right channel synchronization clock pin
(I2Sn_LRCLK)
SPIn_CLK
SPI clock pin
I
2
S bit clock pin (I2Sn_BCLK)
SPIn_MISO
SPI master input or slave output pin
I
2
S data input pin (I2Sn_DI)
SPIn_MOSI
SPI master output or slave input pin
I
2
S data output pin (I2Sn_DO)
Table 6-35 SPI/I
2
S Interface Controller Pin
6.16.5 Functional Description
Terminology
6.16.5.1
SPI Peripheral Clock and SPI Bus Clock
The SPI controller needs the peripheral clock to drive the SPI logic unit to perform the data
transfer. The peripheral clock rate is determined by the settings of clock divisor (SPI_CLKDIV)
and the clock source which can be HXT, HIRC, PLL out or the PCLK. SPInSEL (n=0, 1, 2) of
CLK_CLKSEL2 register determines the clock source of the SPIn peripheral clock. The DIVIDER
(SPI_CLKDIV[7:0]) setting determines the divisor of the clock rate calculation.
SPIn Clock Divider
(SPI_CLKDIV[7:0]/
SPI_I2SCLK[16:8])
SPInSEL
HXT
HIRC
PLL
PCLK
SPInCKEN
SPIn Peripheral
Clock
Note:
n = 0, 1, 2
SPI0SEL = CLK_CLKSEL2[3:2] SPI0CKEN = CLK_APBCLK0[12]
SPI1SEL = CLK_CLKSEL2[5:4] SPI1CKEN = CLK_APBCLK0[13]
SPI2SEL = CLK_CLKSEL2[7:6] SPI2CKEN = CLK_APBCLK0[14]
Figure 6.16-3 SPI Peripheral Clock
In Master mode, the frequency of the SPI bus clock is equal to the peripheral clock rate. In
general, the SPI bus clock is denoted as SPI clock. In Slave mode, the SPI bus clock is provided
by an off-chip master device. The frequency of SPI peripheral clock cannot be faster than the
system clock rate regardless of Master or Slave mode. If the clock source of peripheral clock is
different from the one of system clock, the frequency of SPI peripheral clock shall be slower than
the system clock frequency regardless of Master or Slave mode.
In I
2
S mode, the peripheral clock rate is equal to I
2
S bit clock rate determined by SPI_I2SCLK
register.