DocID025202 Rev 7
910/1080
RM0365
Serial peripheral interface / inter-IC sound (SPI/I2S)
959
Figure 346. Hardware/software slave select management
30.5.6 Communication
formats
During SPI communication, receive and transmit operations are performed simultaneously.
The serial clock (SCK) synchronizes the shifting and sampling of the information on the data
lines. The communication format depends on the clock phase, the clock polarity and the
data frame format. To be able to communicate together, the master and slaves devices must
follow the same communication format.
Clock phase and polarity controls
Four possible timing relationships may be chosen by software, using the CPOL and CPHA
bits in the SPIx_CR1 register. The CPOL (clock polarity) bit controls the idle state value of
the clock when no data is being transferred. This bit affects both master and slave modes. If
CPOL is reset, the SCK pin has a low-level idle state. If CPOL is set, the SCK pin has a
high-level idle state.
If the CPHA bit is set, the second edge on the SCK pin captures the first data bit transacted
(falling edge if the CPOL bit is reset, rising edge if the CPOL bit is set). Data are latched on
each occurrence of this clock transition type. If the CPHA bit is reset, the first edge on the
SCK pin captures the first data bit transacted (falling edge if the CPOL bit is set, rising edge
if the CPOL bit is reset). Data are latched on each occurrence of this clock transition type.
The combination of CPOL (clock polarity) and CPHA (clock phase) bits selects the data
capture clock edge.
166,QSXW
660FRQWUROELW
66,FRQWUROELW
662(FRQWUROELW
1662XWSXW
166
SLQ
XVHGLQ0DVWHUPRGHDQG166
+:PDQDJHPHQWRQO\
166
2XWSXW
&RQWURO
0DVWHU
PRGH
6ODYHPRGH
1RQDFWLYH
2.
9GG
166
,QS
$FWLYH
&RQIOLFW
9VV
166H[WHUQDOORJLF
166LQWHUQDOORJLF
*3,2
ORJLF
06Y9