
Rev. 1.00
19� of ���
�an�a�� 1�� �01�
Standard 8051 8-Bit Flash MCU
HT85F2260/HT85F2270/HT85F2280
Serial Interface – SPI
SPCON Register
SFR Address: E8h
Bit
7
6
5
4
3
2
1
0
Name
SPR�
SPEN
SSDIS
MSTR
CPOL
CPHA
SPR1
SPR0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
0
0
0
1
0
1
0
0
Bit 7, 1, 0
SPR2,
SPR1, SPR0:
Master Clock Select
000: Reserved
001: f
SYS
/4
010: f
SYS
/8
011: f
SYS
/16
100: f
SYS
/32
101: f
SYS
/64
110: f
SYS
/128
111: Master clock not generated
Bit 6
SPEN:
SPI enable or disable
0: Disable
1: Enable
When set high, the SPI interface internal circuits will be enabled. All the relevant
functionally shared pins will be enabled to have SPI functions and their original logical
I/O functions will be disabled. When cleared to zero, the SPI interface will be disabled,
and all the functionally shared pins will have a logical I/O function.
Bit 5
SSDIS:
SSN pin disable control
0: Enable
1: Disable, SSN pin floating
When this bit is cleared to zero, the “SSN” input is enabled in both Master and Slave
modes. When set high, the “SSN” input is disabled in both Master and Slave modes. In
the Slave mode, this bit has no effect if “CPHA”=0. When the bit is high, no “MODF”
interrupt request will be generated.
Bit 4
MSTR:
SPI Master or Slave
0: Slave
1: Master
Bit 3
CPOL:
SPI Clock Polarity
0: SCK low when clock is inactive
1: SCK high when clock is inactive
The CPOL bit determines the SPI clock polarity when not active.
Bit 2
CPHA:
SPI Active Clock Edge Select
0: Data sampled on first clock edge
1: Data sampled on second clock edge
The CPHA and CPOL bits are used to setup the way that the clock signal transmits data
on the SPI bus. These two bits must be configured before a data transfer is executed.