
MS51
Dec. 17, 2019
Page
262
of 316
Rev 1.01
M
S51
SE
RIES
TE
CHNICA
L REF
ERE
N
CE MA
NU
A
L
Bit
Name
Description
7
SOE
Slave select output enable
This bit is used in combination with the DISMODF (SPSR.3) bit to determine the feature of
SS
̅̅̅̅
pin as
shown in Table 6.9-1 Slave Select Pin Configurations. This bit takes effect only under MSTR = 1 and
DISMODF = 1 condition.
0 =
SS
̅̅̅̅
functions as a general purpose I/O pin.
1 =
SS
̅̅̅̅
automatically goes low for each transmission when selecting external Slave device and goes
high during each idle state to de-select the Slave device.
6
PIEN
SPI enable
0 = SPI function Disabled.
1 = SPI function Enabled.
5
LSBFE
LSB first enable
0 = The SPI data is transferred MSB first.
1 = The SPI data is transferred LSB first.
4
STR
Master mode enable
This bit switches the SPI operating between Master and Slave modes.
0 = The SPI is configured as Slave mode.
1 = The SPI is configured as Master mode.
3
OL
SPI clock polarity select
CPOL bit determines the idle state level of the SPI clock. See Figure 6.9-4 SPI Clock Formats.
0 = The SPI clock is low in idle state.
1 = The SPI clock is high in idle state.
2
CPHA
SPI clock phase select
CPHA bit determines the data sampling edge of the SPI clock. See Figure 6.9-4 SPI Clock Formats.
0 = The data is sampled on the first edge of the SPI clock.
1 = The data is sampled on the second edge of the SPI clock.
1:0
SPR[1:0]
SPI clock rate select
These two bits select four grades of SPI clock divider. The clock rates below are illustrated under F
SYS
= 16 MHz condition.
Fsys = 16MHz
SPR1
SPR0
Divider
SPI clock rate
0
0
2
8M bit/s
0
1
4
4M bit/s
1
0
8
WM bit/s
1
1
16
1 M bit/s
Fsys = 24MHz
SPR1
SPR0
Divider
SPI clock rate
0
0
2
12M bit/s
0
1
4
6M bit/s
1
0
8
3M bit/s
1
1
16
1.5M bit/s
SPR[1:0] are valid only under Master mode (MSTR = 1). If under Slave mode, the clock will
automatically synchronize with the external clock on SPICLK pin from Master device up to F
SYS
/2
communication speed.
SPCR2
– Serial Peripheral Control Register 2
Regiser
Address
Reset Value
SPCR2
F3H, page 1
0000_0000b
7
6
5
4
3
2
1
0
-
-
-
-
-
-
SPIS1
SPIS0
-
-
-
-
-
-
R/W
R/W
Bit
Name
Description