SPI Interface and Use in A Daisy-Chain Bus Configuration
SPI Interface and Use in A Daisy-Chain Bus Configuration
2, Feb 2002
by Hannes Estl
Automotive Power
Never stop
-1-
thinking.
1. Abstract
This Application Note describes the basic
principle of the Serial Peripheral Interface (SPI)
used in many Smart Power ICs and the different
ways in which it can be used for communication
with different ICs. The "daisy chain" bus
configuration will be described in detail.
2. Introduction
Complex integrated Smart Power devices can
not only control (turn on/off) the power output
stages, they can also provide configurable
functions and detailed diagnostic of various fault
conditions. To handle all this by direct control
lines or hardwired configuration would mean a
lot of external components and pins. To
increase functionality and at the same time
reduce the amount of additional components a
Serial Peripheral Interface is integrated in
modern Smart Power ICs. This SPI is a
synchronous serial bus interface for receiving
and sending data. If more than one IC with SPI
is controlled by, e.g., a C there are different
ways to connect them, depending on the
requirements of the application.
3. The SPI
3.1.
General
CLK
SI
CS
SO
Serial Peripheral
Interface (SPI)
Functional description
Fig. 1: SPI
SI
SI
SO
SO
Application Note
V1.2, 2002-02
CS = H
L :
diagnostic
information
is
transferred
(parallel) from the diagnostic register into
the SPI shift register.
serial input data can be clocked into the SPI
shift register.
SO changes from high impedance state to
logic high or low state corresponding to the
SO bits.
CLK
CS
SI
Functional description
SO
0 1 0 1 1 0 1 1
0 1 0 1 1 0 1 1
MSB
SO
Serial input
data MSB first
Serial output
(diagnosis) data
MSB first
CS
diagnosis register
LSB
MSB
CLK
low
CS
SI
011
CLK
11011
SO
0 1 1 0 0 0 1 0
0 1 0 1 1 0 1 1
high
CS = L
H:
transfer of SI bits from SPI shift register into
the internal logic registers
reset of diagnostic register (optional)
SO goes back to tristate
CS
SI
nBit SPI shift register
SO
internal registers
e.g. diagnosis register
tristate
Application Note
V1.2, 2002-02
CLK
CS
SI
0 1 1 0 1 1 0 0
0 1 1 0 1 1 0 0
SO
Reset
CS
Output lines
SI
Tx 1
SO
Rx 1
CLK
Tx b
CS
Output lines
SI
SO
4.1.
CLK
CLK
SPI 1
CLK
Tx a1
CS
Tx a2
SI
Rx a1
SO
CLK
Output lines
Tx a
CS
Output lines
SI
Tx 1
SO
Rx 1
CLK
CLK
SPI n
Tx b1
CS
Tx b2
SI
Rx b1
SO
Output lines
CLK
CS
SI
Output lines
SO
Application Note
Daisy-chain configuration
CLK
CS
Tx 1
SI
Rx 1
SO
data rate/
IC [Mbit/s]
usable bits/
IC
4*n=16
n+3=7
4
4
n*5=20
5
5
5/4=1,25
5
5
5
5/n=1,25
16
16
16-address
16
5. Basics of a daisy-chain:
For applications where fast accessibility of a
single IC is not critical and where high switching
frequencies are not necessary, the daisy-chain
is a bus concept that can drastically reduce the
number of needed C ports and wiring effort. If
the individual ICs use an SPI as described in
3.3. only then they can be connected in a daisychain configuration (Fig. 12)
CLK
Tx a
A
B
C
D
C I/O
Ports
Output lines
CLK
5V
CS
SI
5V
Output lines
Fault
SO
SPI
Vs
CS
CLK
SI
SO
Reset
PRG
IN 1
IN 4 TLE 6220 GP
CS
OUT 1
CLK
SI
SO
OUT 4
GND
5V
Vs
Fault
Reset
IN 1
IN 4
TLE 6236 G
CS
CLK
SI
SO
OUT 1
GND
OUT 8
5V
Fault
Vs
Reset
IN 1
PRG
IN 8 TLE 6240 GP
CS
OUT 1
CLK
SI
SO
OUT 16
GND
Application Note
V1.2, 2002-02
The C feeds the data and instruction bits into the SI of IC1 (first IC in the chain). The bits coming from
the SO of IC1 are directly shifted into the SI of IC2 and the bits coming from the SO of IC2 are directly
shifted into the SI of IC3. The SO bits of IC3 (last IC in the chain) are then returned to the C. As long as
the chip select is inactive (high) all three IC SPIs ignore the clock (CLK) and input signals (SI) and all
outputs (SO) are in tristate.
At the chip select transition to active (high low) the diagnostic data or the data requested in the
previous SPI cycle is loaded into the SPI shift register.
As long as the chip select is active the SPI register works as a simple shift register. With each clock
signal one input bit is shifted into the SPI register (SI), each bit in the shift register moves one position
further within the register, and the last bit in the SPI shift register is shifted out of SO. This continues as
long as the chip select is active and clock signals are applied. For example after 11 clock cycles 11
diagnostic bits of IC3 have been returned to the C. The diagnostic word of IC2 is in the middle of the
shift register of IC3 and the diagnostic word of IC1 is half in IC2 and half in IC3. The command and data
word for IC3 is partly in IC2 and IC1.
After 26 clock cycles the diagnostic information of IC3 and IC2 has been fully returned to the C, the
diagnostic information of IC1 is still partly in the shift register of IC3. The command words for all 3 ICs
are "in-between" the different SPIs.
After 32 clock cycles (8 + 8 + 16) all the diagnostic information had been returned to the C and the
correct command and data bits are in the shift register of the respective ICs. With the chip select
transition from active to inactive (low high) all the data that is actually in the SPI shift register is loaded
into the internal logic and processed. Now the IC will react to the commands and data, SI and CLK will
not accept input signals, and SO will change to tristate.
Application Note
V1.2, 2002-02
6. Application example:
Daisy-chain with 3 Smart Multichannel Lowside
Switches
1x TLE 6240GP
1x TLE 6220GP
1x TLE 6236G
C
TD
SI
TLE 6220 GP
IC1
SO
5
control
0
1
3
1
2
0
1
data
0
LSB
1
5
control
0
1
3
1
2
0
1
data
0
LSB
0
4
Ch 3
0
3
1
2
Ch 2
1
1
1
LSB
Ch 1
1
1
IC2 : TLE6236G
The TLE6236G is a 8-channel, 2,3 Smart
Power Switch with 8-bit SPI for control and
diagnostic. In addition the IC has 4 parallel
inputs for control of the power stages 1 to 4. In
this example channels 1 to 4 and 7 should be
turned on, while channels 5, 6 and 8 should be
off. The load of channel 4 and 5 is shorted
(channel 4 was "on" in the previous cycle,
channel 5 was off), this means in the fault
register of channel 4 the fault condition short is
stored. No fault condition is stored in the
register of channel 5 because overload cannot
be detected in "off" state!.
The necessary command word is :
MSB
Ch 8
0
SO SI
TLE 6236 G
IC2
MSB
Ch 8
1
SO
8 Bit
6
Ch 7
1
5
Ch 6
0
4
Ch 5
0
3
Ch 4
1
2
Ch 3
1
1
Ch 2
1
LSB
Ch 1
1
TLE 6240 GP
IC3
SI
IC1 : TLE6220GP
The TLE6220GP is a 4-channel, 400m Smart
Power Switch with 8-bit SPI for control and
diagnostic. In addition the IC has 4 parallel
inputs for control of the power stages. In this
example the channels 1 and 2 should be turned
on in "OR" mode (SPI bit and parallel input of
the corresponding channel are logical ORed),
channel 3 and 4 should be off in "OR" mode.
The load of channel 3 is disconnected and the
6
Ch 7
1
5
Ch 6
0
4
Ch 5
0
3
Ch 4
1
2
Ch 3
1
1
Ch 2
1
LSB
Ch 1
0
2
D3
1
1
D2
1
LSB
D1
0
16 Bit
Application Note
MSB
8 Bit
RD
6
D7
1
5
D6
0
4
D5
0
3
D4
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
0
1
0
0
0
1
1
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 MSB
9
1
8
1
7
0
6
1
1
1
1
1
0
7
6
5
5
4
3
2
LSB 1
9 10 11 12 13 14 15
8
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
0
0
0
0
0
0
Fig. 14
32 bit
downstream data
Application Note
6
5
4
3
2
0
7. Conclusion
5
4
3
2
1
LSB
Ch 1
1
0
6
Ch 4
2
Ch 2
4
Ch 3
8
Ch 51
10
Ch 6
1
1
11
12
Ch 7
1
1
13
MSB 14
Ch 8
1
1
LSB
3
Data
10
12
11
Command
1
0
13
14
MSB
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 MSB
LSB
3
Data
10
12
11
Command
0
0
13
LSB 1
14
MSB
Fig.15
32 bit
upstream data
V1.2, 2002-02
Disclaimer
Edition 2000-07-14
Published by Infineon Technologies AG,
St.-Martin-Strasse 53,
D-81541 Mnchen, Germany
Infineon Technologies AG 2/d/yy.
All Rights Reserved.
Attention please!
The information herein is given to describe certain
components and shall not be considered as warranted
characteristics.
Terms of delivery and rights to technical change reserved.
We hereby disclaim any and all warranties, including but
not limited to warranties of non-infringement, regarding
circuits, descriptions and charts stated herein.
Infineon Technologies is an approved CECC manufacturer.
Information
For further information on technology, delivery terms and
conditions and prices please contact your nearest Infineon
Technologies Office in Germany or our Infineon
Technologies Representatives world-wide (see address
list).
Warnings
Due to technical requirements components may contain
dangerous substances. For information on the types in
question please contact your nearest Infineon Technologies
Office.
Infineon Technologies Components may only be used in
life-support devices or systems with the express written
approval of Infineon Technologies, if a failure of such
components can reasonably be expected to cause the
failure of that life-support device or system, or to affect the
safety or effectiveness of that device or system. Life
support devices or systems are intended to be implanted in
the human body, or to support and/or maintain and sustain
and/or protect human life. If they fail, it is reasonable to
assume that the health of the user or other persons may be
endangered.
http://www.infineon.com
AG
Published by Infineon Technologies
8
Application Note
V1.2, 2002-02