
Rev. 1.20
122
November 20, 2019
Rev. 1.20
123
November 20, 2019
HT66F2740
12V High Current Flash MCU
HT66F2740
12V High Current Flash MCU
Bit 2
CSEN
: SPI SCS pin control
0: Disable
1: Enable
The CSEN bit is used as an enable/disable for the SCS pin. If this bit is low, then the
SCS
pin will be disabled and placed into a floating condition. If the bit is high the
SCS
pin will be enabled and used as a select pin.
Bit 1
WCOL
: SPI write collision flag
0: No collision
1: Collision
The WCOL flag is used to detect if a data collision has occurred. If this bit is high it
means that data has been attempted to be written to the SIMD register during a data
transfer operation. This writing operation will be ignored if data is being transferred.
The bit can be cleared by the application program.
Bit 0
TRF
: SPI Transmit/Receive complete flag
0: SPI data is being transferred
1: SPI data transmission is completed
The TRF bit is the Transmit/Receive Complete flag and is set “1” automatically when
an SPI data transmission is completed, but must cleared to “0” by the application
program. It can be used to generate an interrupt.
SPI Communication
After the SPI interface is enabled by setting the SIMEN bit high, then in the Master Mode, when
data is written to the SIMD register, transmission/reception will begin simultaneously. When the
data transfer is completed, the TRF flag will be set high 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 SIMD register will be transmitted and any data on the SDI pin will be shifted into
the SIMD register. The master should output an SCS signal to enable the slave devices before a
clock signal is provided. The slave data to be transferred should be well prepared at the appropriate
moment relative to the SCK signal depending upon the configurations of the CKPOLB bit and
CKEG bit. The accompanying timing diagram shows the relationship between the slave data and
SCK signal for various configurations of the CKPOLB and CKEG bits.
The SPI will continue to function in certain IDLE Modes if the clock source used by the SPI
interface is still active.
SCK (CKPOLB=1, CKEG=0)
SCK (CKPOLB=0, CKEG=0)
SCK (CKPOLB=1, CKEG=1)
SCK (CKPOLB=0, CKEG=1)
SCS
SDO (CKEG=0)
SDO (CKEG=1)
SDI Data Capture
Write to SIMD
SIMEN, CSEN=1
SIMEN=1, CSEN=0 (External Pull-high)
D7/D0 D6/D1 D5/D2 D4/D3 D3/D4 D2/D5 D1/D6 D0/D7
D7/D0 D6/D1 D5/D2 D4/D3 D3/D4 D2/D5 D1/D6 D0/D7
SPI Master Mode Timing