
BAT32G1x9 user manual | Chapter 21 Serial interface SPI
820 / 1149
Rev.1.02
21.3.2
SPI Operating Mode Register (SPIMn).
SPIM is used to select the mode of operation and control the allow or disallow of the operation.
SPIM n can be set by 8-bit memory operation instructions.
A reset signal is generated to clear the register to 00H.
Figure 21-2 the 2-mode control register (SPIMn).
Address: SPI0:0x40046C00 SPI1:0x40047000 After reset: 00H R/W
Note 1
symbol
7
6
5
4
3
2
1
0
SPIMn
SPIEn
RMDT n
NSSEn
DIRn
INTMDn
DLSn
RECMDn
-
SPIEn
SPI runs allowed
0
Stop running.
1
Allowed to run.
TRMDn
Note3
Transmit/Receive mode control
0
Receive mode
1
Send/Receive mode
NSSEn
Note4
NSS
pin uses selection
0
The NSS pin is not used
1
Use the NSS pin
DIRn
Data transfer order selection
0
Perform MSB-first
input/output.
1
Perform LSB-first
input/output.
INTMDn
Interrupt source selection
0
The end of transfer is interrupted
1
The send buffer is empty interrupt
DLSn
The setting of the data length
0
8 bits of data length
1
16-bit data length
RECMDn
Mode selection for receive mode
0
Single receive
1
Continuous reception
Note 1
When SPTF=1 (during serial communication), rewriting of TRMD, DIR, NSSE is prohibited.
2. The MO or SO output is fixed low when the TRMD is 0.
3. Before setting the position to 1, fix the NSS pin input level to 0 or 1.
4.n=1 (channel 0 does not support the chip selection function, the bit must be set to 0).