
MS51
Dec. 17, 2019
Page
139
of 316
Rev 1.01
M
S51
SE
RIES
TE
CHNICA
L REF
ERE
N
CE MA
NU
A
L
SPCR
– Serial Peripheral Control Register
Regiser
Address
Reset Value
SPCR
F3H, page 0
0000_0000b
7
6
5
4
3
2
1
0
SSOE
SPIEN
LSBFE
MSTR
CPOL
CPHA
SPR1
SPR0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Bit
Name
Description
7
SSOE
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
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
SPIEN
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
MSTR
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
CPOL
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.