
Rev. 1.00
194 of ���
�an�a�� 1�� �01�
Standard 8051 8-Bit Flash MCU
HT85F2260/HT85F2270/HT85F2280
Serial Interface – SPI
SPI Communication
The SPI interface is first enabled by setting the SPEN bit high. This enables the internal SPI
circuitry and also enables all the SPI pins which also disabled all of the logical I/O functions. In
the Master Mode, when data is written to the SPDAT register, transmission/reception will begin
simultaneously. When the data transfer is complete, the SPIF flag will be set automatically, but
must be cleared using the application program. In the Slave Mode, when the clock signal from the
master has been received, any data in the SPDAT register will be transmitted and any data on the
MISO pin will be shifted into the SPDAT register.
The master should output an SSN signal to enable the slave device before a clock signal is provided.
The slave data to be transferred should be well prepared at the appropriate moment relative to the
SSN signal depending upon the configurations of the CPOL bit and CPHA bit. The accompanying
timing diagram shows the relationship between the slave data and SSN signal for various
configurations of the CPOL and CPHA bits.
SPI Master Mode Timing