English
Language : 

HT82B42R_14 Datasheet, PDF (63/84 Pages) Holtek Semiconductor Inc – I/O MCU with USB Interface
HT82B42R/HT82B42RE
I/O MCU with USB Interface
SPI t�ansfe�
Setup CKS
FSPI=Fsys/1�/�
�aste�
�aste� o� slave
slave
M1 M0
= 00�01�10
M1 M0=11
Configu�e CSE�
and MLS
SBE�=1
A
clea� WCOL
A
w�ite data into
SBDR
Y
WCOL=1?
�
t�ans�ission
co�pleted?
(TRF=1?)
Y
�ead data f�o�
SBDR
clea� TRF
t�ansfe� finished? �
Y
E�D
SPI Transfer Control Flowchart
SPI Bus Enable/Disable
To enable the SPI bus, set SBEN =1, CSEN = 1 and SCS=0, then wait for data to be written into the
SBDR (TXRX buffer) register. For the Master Mode, after data has been written to the SBDR (TXRX
buffer) register, then transmission or reception will start automatically. When all the data has been
transferred the TRF bit should be set. For the Slave Mode, when clock pulses are received on SCK,
data in the TXRX buffer will be shifted out or data on SDI will be shifted in.
To Disable the SPI bus SCK, SDI, SDO, SCS should be in a floating condition.
Rev. 1.10
63
November 05, 2014