577
/
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
RONLY = 1)
Master one-wire bidirectional send mode (SPI_CTRL1.MSEL = 1, SPI_CTRL1.BIDIRMODE = 1,
SPI_CTRL1.BIDIROEN = 1, SPI_CTRL1.RONLY = 0)
After the data is written to the SPI_DAT register (send buffer), the transmission process starts. This mode does not
receive data. At the same time as the first data bit is send, the data to be sent is loaded into the shift register in parallel,
and then according to the configuration of the SPI_CTRL1.LSBFF bit, the SPI serially shifts the data bits to the
MOSI pin in MSB or LSB order
The software operation flow of the master one-wire bidirectional send mode is the same as that of the send-only
mode.
Master one-wire bidirectional receive mode (SPI_CTRL1.MSEL = 1, SPI_CTRL1.BIDIRMODE = 1,
SPI_CTRL1.BIDIROEN = 0, SPI_CTRL1.RONLY = 0)
When SPI_CTRL1.SPIEN = 1 , the receiving process starts. There is no data output in this mode, the received data
bits are sequentially and serially shifted into the shift register, and then loaded into the SPI_DAT register (receive
buffer) in parallel
The software operation flow of the master one-wire bidirectional receive mode is the same as that of the receive-only
mode.
Slave full duplex mode (SPI_CTRL1.MSEL = 0, SPI_CTRL1.BIDIRMODE = 0, SPI_CTRL1.RONLY =
0)
The data transfer process begins when the slave device receives the first clock edge. Before the master starts data
transfer, software must ensure that the data to be send is written to the SPI_DAT register.
b0
b2
b1
b3
b4
b6
b5
b0
b7
b1
b2
b3
b5
b4
b6
b7
b1
b0
b3
b2
b4
b5
b7
b6
DATA1=0xAA
DATA2=0xBB
DATA3=0xCC
SCK
MISO/MOSI
(
in
)
RNE flag
Rx buffer
(
read fromSPI_DAT
)
Configure
:
CLKPOL=1.CLKPHA=1,RONLY=1
Set by hardware
Clear by software
0xAA
0xBB
0xCC
Wait until RNE=1,read 0xCC from SPI_DAT
Wait until RNE=1,read 0xAA from SPI_DAT
Wait until RNE=1,read 0XBB from SPI_DAT