
Rev. 1.00
191 of ���
�an�a�� 1�� �01�
Standard 8051 8-Bit Flash MCU
HT85F2260/HT85F2270/HT85F2280
Serial Interface – SPI
Serial Interface – SPI
SPI Registers
There are three internal registers which control the overall operation of the SPI interface. These
are the SPDAT data register, where the received data or transmitted data is stored and two control
registers SPCON and SPSTA.
SPI Register List
Register
Name
Bit
7
6
5
4
3
2
1
0
SPCON
SPR�
SPEN
SSDIS
MSTR
CPOL
CPHA
SPR1
SPR0
SPSTA
SPIF
WCOL
SSERR
MODF
—
—
—
—
SPDAT
D7
D6
D�
D4
D3
D�
D1
D0
The SPDAT register is used to store the data being transmitted and received. Before the device
writes data to the SPI bus, the actual data to be transmitted must be placed in the SPDAT register.
After the data is received from the SPI bus, the device can read the data from the SPDAT register.
Any transmission or reception of data from the SPI bus must be made via the SPDAT register.
SPDAT Register
SFR Address: E3h
Bit
7
6
5
4
3
2
1
0
Name
D7
D6
D�
D4
D3
D�
D1
D0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
0
0
0
0
0
0
0
0
There are also two control registers for the SPI interface, SPCON and SPSTA. Register SPCON
is used to control the enable/disable function, to assign the clock Polarity/Edge types, to
enable/disable the SPI function and to set the data transmission clock frequency. Register SPSTA
is used to indicate the SPI operational status, such as data transferred complete flag, write collision
flag, Synchronous Serial Slave Error flag and SPI mode Fault detection flag etc. When any one of
the SPIF, WCOL, SSERR and MODF flags in the SPSTA register is set high, an SPI interrupt will
occur if the SPI interrupt function is enabled.