SafeSPI Specification v0.15 Published
SafeSPI Specification v0.15 Published
Specification
V0.15
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.
1 INTRODUCTION 3
1.2 Scope 3
4 LOGICAL LAYER 10
4.4 Example for the use of the target and source address 13
5 CHANGE HISTORY 16
1 Introduction
INFO_001 The serial peripheral interface (SPI) is a synchronous serial communication interface used for
short distance communication, usually between devices on a printed board assembly. The
interface was developed by Motorola and is now a de-facto standard for several automotive
applications.
Because there is no formal SPI standard, a wide variety of protocol options exist. This flexibility
means every device defines its own protocol, increasing the development effort of new systems,
devices and software.
In automotive safety applications, there is often an independent monitoring device (often termed
“safing”) which listens to sensor data on the SPI bus. This monitoring device is usually
implemented in hardware, and imposes constraints on the SPI protocol.
This specification describes a standard for a target SPI interface used in automotive
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.
applications. Its main focus is the transmission of sensor data between different devices.
1.1 Requirement specification types
DEF_002 Each requirement within this specification is marked with a unique identification. The
identification consists of a classifier and a unique number. The number is unique over all
versions of this specification. The classifiers are the following:
INFO: The following content has informative character.
DEF: The following content represents a definition. A definition itself cannot be fulfilled
alone. However, other requirements refer to this definition and to fulfil these
requirements, this definition must be followed
REQ: The following content is a requirement to the slaves and the masters
REQM: The following content applies only to SPI masters
REQS: The following content applies only to SPI slaves
Headings do not present any kind of requirement.
REQ_003 A device may call itself SafeSPI compatible if it fulfils all requirements (REQ).
1.2 Scope
DEF_004 This SafeSPI standard targets automotive SPI devices. The main focus is sensors, interface
integrated circuits (ICs), system application specific ICs (ASICs) and microcontrollers.
INFO_005 Other devices may call themselves “SafeSPI compatible” according to REQ_002 if wished.
INFO_006 A standard SPI interface consists of 4 ports as shown in Error! Reference source not found..
SCK
SPI CS SPI
Master MOSI Slave
MISO
Figure 1 SPI-Interface
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.
The Serial ClocK (SCK) represents the master clock signal. This clock determines the speed of
data transfer and all receiving and sending is done synchronously to this clock. The Chip Select
(CS) activates the SPI interface. As long as the CS signal is at high level, the SPI Slave will not
accept the SCK signal or the Master-Out-Slave-In input (MOSI), and the Master-In-Slave-Out
output (MISO) is in high impedance. When the CS signal is at low level, data can be transferred
from the SPI Master to the SPI Slave and vice versa. Commands are transmitted through the
MOSI to the SPI Slave and the SPI Slave returns its response through the MISO.
INFO_007 SPI bus systems support several slave devices on one bus by using either multiple chip select
lines, one for each slave, or by a logical addressing. For several airbag and safety systems a
monitor device is connected as listener to the bus. This device is often an ASIC which needs a
dedicated SPI format. An example configuration is depicted in Error! Reference source not
found.
SPI
Master Monitor
INFO_008 The power supplies for each device on the SafeSPI bus are not specified, and can be
independent, as shown in the figure below.
V1 V2
Internal
Supply
SPI I/F
V3
REQ_tb9 In case of a slave supply failure (internally or from external) the slave shall not disturb any SPI
signals (i.e. MOSI, MISO, CS).
INFO_010 The following chapter describes the physical layer of the SafeSPI specification. Besides voltage
and current levels, capacitances of pins, the timings of the different communication lines are
described.
3.1 Voltage levels and capacitances
INFO_011 Each of the masters and slaves of the SafeSPI interfaces can be powered from an independent
supply. The power supply range has to be the same for all connected devices also the power is
not supplied from the same rail. So all slaves and masters have to have 3.3V compatible inputs /
outputs. All devices have to work with different voltage levels within specification.
DEF_012 VIO defines the supply voltage of the SPI interface of the device. All voltage levels are defined to
the actual supply voltage. Positive current flows into the device.
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.
DEF_013 The following requirements apply to all four communication PINs, namely MISO, MOSI, CS and
SCK if not noted otherwise.
INFO_024 The timings are specified to allow an operation of up to 10 MHz on the SPI. All timings are valid
for the full range of specified voltage levels, input capacitances and current levels. The different
parameters are defined in the following graphic.
DEF_025
SafeSPI Timing Diagram for out-of-frame format
CPHA = 0
9
VOHmin
CS
VOLmax
1 7
2 4 6
VOHmin
SCK
PLE
PLE
PLE
SH
SH
SH
SAM
SAM
SAM
IFT
IFT
IFT
(CPOL = 0) VOLmax
3 5
3
11 12 11
VOHmin
MOSI undefined undefined
VOLmax
10 B
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.
A
C
E
kink
VOHmin
MISO High impedance X High impedance
VOLmax
kink
DEF_025a
SafeSPI Timing Diagram for in-frame format
CPHA = 1
9
VIHmin
CS
VILmax
1 7
2 4 6
VIHmin
SCK
SAM
SAM
SAM
IFT
IFT
IFT
SH
SH
SH
PLE
PLE
PLE
(CPOL = 0) VILmax
3 5
3
11 12
VIHmin
MOSI undefined undefined
VILmax
10
B C
E
VIHmin
MISO High impedance undefined High impedance
VILmax
D
DEF_026 All timings are specified from VIHmin to VILmax or vice versa.
DEF_027 All timings are specified over full voltage range of VIO, unless specified otherwise
DEF_028 All timings are specified over full range of bus load CLOAD, unless specified otherwise
DEF_029 All timings are specified over full temperature range, unless specified otherwise
INFO_030 The following requirements are to the slave from master-point of view:
ID Parameter Symbol Condition Min Max Unit
REQS_031 MISO data valid time (CS) A * 40 ns
REQS_032 MISO data valid time (SCK) B * 30 ns
REQS_033 MISO data hold time C X * ns
REQS_034 MISO rise/fall time D 5 15 ns
REQS_035 MISO data disable lag time E * 50 ns
DEF_036 X: MISO data is guaranteed to be stable until the next SCK shift edge
INFO_037 Parameter A, B do not include the rise/fall time of CS and SCK
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.
INFO_038 The following requirements are given to the master from the slave-point of view
INFO_039 To achieve the Parameter D min/max time for the specified signal load capacitance range, a
drive strength configuration of the MISO may be required
INFO_052 To achieve the parameter 3 and 10 min/max times for the specified signal load capacitance
range, a drive strength configuration of the SCK and MOSI may be required
INFO_053 To achieve the parameter 9 it takes more time for an Out-Of-Frame protocol since it has to
prepare the correct data in between two frames.
4 Logical layer
DEF_054 There are two possible logical frame dependencies within SPI logical layers. One is called in-
frame since the data of the slave response is within the same time slot as the masters’ request.
As out-of-frame the communication is called if the logical response of the slave is within the next
frame of the master. Figure 3 depicts both options
in-frame out-of-frame
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.
INFO_058 This section describes the logical encodings for different protocol options.
DEF_059 Bits within the master request (MOSI) or the slave response (MISO) which are marked as ‘*’ can
be freely defied and are not specified within this specification.
DEF_060 A bit which is marked as ‘$’ within the slave response (MISO) represents a tri-state of the output
pin (high impedance).
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MOSI TA9:0 * C2:0
value 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
REQ_062 The following table show the response frame format for the out-of-frame protocol in case of
sensor data is transferred.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MISO D SA9:0 S1 DATA15:0 S0 C2:0
value 1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
REQ_063 The following table show the response frame format for the out of frame protocol for all other
data.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MISO D SA9:0 * C2:0
value 0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
REQ_064 In case a slave receives a frame he could not “understand” / decode, the slave should not
respond with any output (high impedance) to avoid collisions in a multiple slave environment.
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MOSI TA9:5 * CC2:0 *
value 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
REQ_066 The following table show the response with sensor data from a slave in the in-frame protocol.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MISO $ * D SA9:5 DATA15:0 S0 CR2:0
0/
value 0/1 1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
1
0/1
REQ_067 The following table show the other responses from a slave in the in-frame protocol.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MISO $ * D SA9:5 * CR2:0
0/
value 0/1 0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
1
0/1
ID Symbol Name
REQ_068 TA9:0 The target address (TA) is the command which defines the command
to the sensor.
TA9:7 are mandatory
TA9:8 shall correspond to the programmable slave address, if the
slave supports the use of common CS for up to four slaves
TA6:0 are optional and can be used also for other purposes
REQ_069 SA9:0 The source address (SA) is the address uniquely identifying the content
of the response data (data15:0).
SA9:8 are mandatory and shall correspond to the device individual
programmable slave address to allow unique addresses on one SPI
bus with up to four slaves.
SA7 is mandatory
SA6:0 are optional and can be used also for other purposes
Example for the use of SA7:0 for a PSI5 transceiver:
SA7:5 PSI5 channel
SA4:3 PSI5 time slot
SA2:0 PSI5 frame (see PSI5 V2.1 substandard Chassis and
Safety)
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.
REQ_075 For the in-frame format a 3bit CRC with the polynomial 0x5 (x3 + x1 + x0) is used with a start
value of 111b and a target value of 000b.
REQ_076 For the out-of-frame format a 3bit CRC with the polynomial 0x5 (x3 + x1 + x0) is used with a start
value of 101b and a target value of 000b.
INFO_077 Note that the bits over which the CRC is calculated is not equal for all frame formats. The
following test cases can be used to verify the implementation.
4.4 Example for the use of the target and source address
DEF_094 The following example shows four slaves on a SPI bus, where two support a common CS
CS3
PSI5 I/F 2
PSI5 I/F 3
PSI5 I/F 4
PSI5 I/F 1
PSI5 I/F 2
PSI5 I/F 3
PSI5 I/F 4
Monitoring device
Sensor 3
PSI5 Module 2 Slot: 1 / Frame 2
P10P-500/3L
Sensor 4
Sensor 1 Slot: 2 / Frame 2
TimeSlot: 3
The following table shows the SPI transfers, which are required to read the sensor data.
Request Response
TA CS D + SA
1 01 000x
Sensor Module 2: Sensor 1 000b CS1 xxxxb Slave 2; channel 0
1 00 000x
Sensor Module 1: Sensor 1 00 000b CS2 xxxxb Slave 1; channel 0
Sensor Module 1: Status 0 00 1011
Register 00 10110b CS2 0xxxb Slave 1; Non sensor data
ASIC 1: Sensor Data PSI5 I/F 1 10 000 00 Slave 3; PSI5 I/F 1; TimeSlot 1; Frame
1 000x xxxx xxb CS3 xxxb n/a
ASIC 1: Sensor Data PSI5 I/F 1 10 000 01 Slave 3; PSI5 I/F 1; TimeSlot 2; Frame
1 000x xxxx xxb CS3 xxxb n/a
ASIC 1: Sensor Data PSI5 I/F 1 10 000 10 Slave 3; PSI5 I/F 1; TimeSlot 3; Frame
1 000x xxxx xxb CS3 xxxb n/a
5 Change History
0.15 All Initial version of this specification for industry review July 30, 2015
All rights including industrial property rights and all rights of disposal such as copying and passing to third parties reserved.