571
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
SPI function description
21.3.1
General description
Figure 21-1 SPI block diagram
To connected external devices, SPI has four pins, which are as follows:
SCLK: serial clock pin. Serial clock signal is output from the SCLK pin of master device and input to SCLK
pin of slave device.
MISO: master input/slave output pin. Data is received from the MISO pin of master device and send by the
MISO pin of slave device.
MOSI: master output/slave input pin. Data is send by the MOSI pin of master device and received from the
MOSI pin of slave device.
NSS: chip select pin. There are two types of NSS pin, internal pin and external pin. If the internal pin detects a
high level, SPI works in the master mode. Conversely, SPI works in the slave mode. Users can use a standard
I/O pin of the master device to control the NSS pin of the slave device.
Software NSS mode
Receive buffer
Shift register
Send buffer
SPI_CTRL2
SPI_STS
Communication circuit
0
1
Baud rate generator
Main controller
SPI_CTRL1
MOSI
MISO
SCLK
NSS
LSBFF
control bit
Write
address and data bus
Read
TE
INTEN
RNE
INTEN
ERR
INTEN
-
-
SSOEN
TDMAEN
RDMAEN
BIDIRM
ODE
BIDIRO
EN
CRCEN
CRC
NEXT
DATFF
RONLY
SSMEN
SSEL
LSBFF
SPIEN
MSEL
CLK
POL
CLK
PHA
BR[2:0]
BUSY
OVER
MODERR
CRC
ERR
UNDER
CHSIDE
TE
RNE