![FTDI FT51A Скачать руководство пользователя страница 41](http://html1.mh-extra.com/html/ftdi/ft51a/ft51a_application-note_2341158041.webp)
Application Note
AN_289 FT51A Programming Guide
Version 1.0
Document Reference No.: FT_000962 Clearance No.: FTDI# 483
40
Copyright © 2015 Future Technology Devices International Limited
2.4.6
SPI_SLAVE_SETUP
Bit
Position
Bit Field Name
Type
Reset
Description
7..3
RFU
R
0
Reserved
2
lsbfirst
R/W
0
When HIGH, data is transferred LSB
first. When LOW, data is transferred
MSB first.
1
Cpol
R/W
0
SPI Clock Polarity (CPOL) Bit -
selects the polarity of the SPI clk.
0
Cpha
R/W
0
SPI Clock Phase (CPHA) Bit - selects
the phase of the SPI clk.
Table 2.42 SPI Slave Setup Register
When transmitting data between SPI modules, both modules must be using the same CPOL and
CPHA values. A change to either of these bits aborts a transmission in progress and returns the
SPI system into an idle state.
Combined, the CPOL and CPHA settings make 4 modes that are listed in Table 5.
Mode 0 and 1: CPOL = 0, the base (inactive) level of SCLK is 0.
When CPHA = 0, data is clocked in, on the rising edge of SCLK, and data is clocked out, on
the falling edge of SCLK.
When CPHA = 1, data is clocked in, on the falling edge of SCLK, and data is clocked out,
on the rising edge of SCLK
Mode 2 and 3: CPOL = 1, the base (inactive) level of SCLK is 1.
When CPHA = 0, data is clocked in, on the falling edge of SCLK, and data is clocked out,
on the rising edge of SCLK
When CPHA = 1, data is clocked in, on the rising edge of SCLK, and data is clocked out, on
the falling edge of SCLK.
Mode
CPOL
CPHA
0
0
0
1
0
1
2
1
0
3
1
1
Table 2.43 SPI Slave Mode Numbers
Note:
The
lsbfirst
bit does not affect the order, in which data is stored in the rx and tx
registers, simply the order in which data is transmitted and received.