English
Language : 

MC68HC05E0 Datasheet, PDF (69/96 Pages) Motorola, Inc – High-density complementary metal oxide semiconductor (HCMOS) microcontroller unit
On completion of the transmit/receive sequence internal logic sets the IRQACK flag (bit 4 in the
SI S Register) high, and an interrupt will be generated if the SIE bit (bit 7 in the SI Mode Register)
was set high. In both SPI and I2C-bus mode, when the serial interface is in send mode, the data
on the external data line is sampled 3 times per data bit. The majority value of the sample (the
value found by at least 2 out of 3 of the samples) is compared with the expected state of data. If
they are not the same, the TFF (Transmission failure) flag (bit 5 of the SI S Register) is set. This
indicates that, due perhaps to noise or a hard fault such as a short circuit on the data line, the
transmitted data and the actual data on the line do not match. TFF is a read-only signal. TFF is
set at the end of an SPI/I2C-bus sequence.
8.2
SPI Configuration
The SPI serial interface allows data to be sent or received by the MCU over a single, bidirectional
data line. An accompanying clock signal is also generated by the MCU.
Four different combinations of clock phase/polarity can be generated under the control of CPOL
and CPHA (bits 5 and 6 respectively in the SI Mode Register, $0010). (Refer to Figure 8-2)
The clock and data pins selected by PS0 and PS1 are open-drain. External 4k7 pull-up resistors
should be used. The external data line is hi-Z (pulled high by the external resistor) when the SPI
8
is idle. The idle state of the clock line depends on the setting of CPOL/CPHA. Refer to Section 9
for more detailed information on SPI timing.
Idle line or
preceding
transmission
Clock
(CPOL=0, CPHA=0)
Start
Clock
(CPOL=0, CPHA=1)
Clock
(CPOL=1, CPHA=0)
Clock
(CPOL=1, CPHA=1)
Data
0
1
2
Start
LSB
8 Data Bits
3
4
Stop
5
6
7
MSB
Stop
Figure 8-2 SPI Data/Clock Relationship
MC68HC05E0
SERIAL INTERFACE
MOTOROLA
8-3