Z51F6412
Product Specification
PS030302-0212
P R E L I M I N A R Y
115
11.8.7 SPI Register description
The SPI Register consists of SPI Control Register (SPICRx), SPI Status Register (SPISRx) and SPI
Data Register (SPIDRx)
11.8.8 Register description for SPI
SPICRx (SPI Control Register) : D2H, 92H
7
6
5
4
3
2
1
0
SPIEN
FLSB
MS
CPOL
CPHA
DSCR
SCR1
SCR0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Initial value : 00H
SPIEN
This bit controls the SPI operation
0 SPI
Disable
1 SPI
Enable
FLSB
This bit selects the data transmission sequence
0 MSB
First
1 LSB
First
MS
This bit selects whether Master or Slave mode
0 Slave
mode
1 Master
mode
CPOL
CPHA
These two bits control the serial clock (SCK) mode
Clock Polarity (CPOL) bit determine SCK’s value at idle mode
Clock Phase (CPHA) bit determine if data is sampled on the leading
or trailing edge of SCK. Refer to Figure 11-32, Figure 11-33
CPOL
CPHA
Leading Edge
Trailing Edge
0 0 Sample
(Rising)
Setup
(Falling)
0 1 Setup
(Rising)
Sample
(Falling)
1 0 Sample
(Falling)
Setup
(Rising)
1 1 Setup
(Falling)
Sample
(Rising)
DSCR
SCR[2:0]
These three bits select the SCK rate of the device configured as a
Master. When DSCR bit is written one, SCK will be doubled in Master
mode.
fx– Main system clock oscillation frequency.
DSCR SCR1 SCR0 SCK
frequency
0 0 0 fx/4
0 0 1 fx/16
0 1 0 fx/64
0 1 1 fx/128
1 0 0 fx/2
1 0 1 fx/8
1 1 0 fx/32
1 1 1 fx/64