AT32WB415
Series Reference Manual
2022.04.13
Page 155
Ver 2.00
generated if the RDBFIE bit is set.
When the next received data is ready to be moved to the SPI_DT register, if the previous received data
is still not read (RDBF=1), then the data overflow occurs. The previous receive data is not lost, but the
next received data will do. At this point, the ROERR is set. An interrupt is generated if the ERRIE is set.
Read SPI_DT register and then the SPI_STS register will clear the ROERR bit. The recommended
configuration procedure is as follows.
Receiver configuration procedure:
Configure full-duplex/half-duplex selector
Configure chip select controller
Configure SPI_SCK controller
Configure CRC (if necessary)
Configure DMA transfer (if necessary)
If the DMA transfer mode is not used, the software will check whether to enable receive data
interrupt (RDBEIE =1) through the RDBE bit.
Configure frame format: select MSB/LSB mmode with the LTF bit, and select 8/16-bit data with
the FBN bit
Enable SPI by setting the SPIEN
13.2.9 Motorola mode
This section describes the SPI communication timings, which includes full-duplex and half-duplex
master/slave timings.
Full-duplex communication – master mode
Configured as follows:
MSTEN=1: Master enable
SLBEN=0: Full-duplex mode
CLKPOL=0, CLKPHA=0: SCK idle output low, use the first edge for sampling
FBN=0: 8-bit frame
Master transmit (MOSI): 0xaa, 0xcc, 0xaa
Slave transmit (MISO): 0xcc, 0xaa, 0xcc
Figure 13-6 Master full-duplex communications
SCK
MISO
TDBE flag
BF flag
CS
MOSI
RDBF flag
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
Sampling
Drive
Software needs to read the
received data
Transmit buffer empty and
software can write data
Full-duplex communication – slave mode
Configured as follows:
MSTEN=0: Slave enable
SLBEN=0: Full-duplex mode
CLKPOL=0, CLKPHA=0: SCK idle output low, use the first edge for sampling
FBN=0: 8-bit frame
Master transmit (MOSI): 0xaa, 0xcc, 0xaa
Slave transmit (MISO): 0xcc, 0xaa, 0xcc