Chapter-V Automotive Communication Protocols (1)
Chapter-V Automotive Communication Protocols (1)
Protocols
1
4/13/20 School of ECE-Automotive Electronics
Automotive Communication Protocols
2
Automotive Communication Protocols
Agenda
1.Introduction-
• Characteristics and Constraints,
• Different Networks for different Requirements,
• Event Triggered Vs Time Triggered
3
4/13/20 School of ECE-Automotive Electronics
Introduction
4
Automotive Communication Protocols
Characteristics and Constraints
5
Automotive Communication Protocols
Characteristics and Constraints
6
7
Characteristics and Constraints
8
9
10
Characteristics and Constraints
11
12
Characteristics and Constraints
Time-synchronous method
Sending process is executed in cyclic time windows
Time windows are allocated to the individual ECUs
Synchronization to global clock
global cycle
13
CAN (Controller Area Network) Fundamentals
14
15
CAN Agenda
▪ What is CAN ?
▪ Why CAN ?
▪ CAN Protocol
▪ CAN Layers
▪ CAN Applications
▪ CAN programming
Before CAN
16
4/8/20
With CAN
17
4/8/20
What is CAN?
18
4/8/20
Why CAN?
▪ Mature Standard
✓ CAN protocol more than 16 years
✓ Numerous CAN products and tools on the market
▪ Hardware implementation of the protocol
✓ Combination of error handling and fault confinement with
high transmission speed (up to 1Mb/s)
▪ Simple Transmission Medium
✓ Twisted pair of wires is the standard, but also just one wire
will work
✓ Other links works too- Opto or radio links
▪ Excellent Error Handling
✓ CRC error detection mechanism
▪ Fault Confinement
✓ Built-in feature to prevent faulty node to block system
▪ Most used protocol in industrial and automotive world
19
4/8/20
20
Standard & Implementation
2 LLC
Data Link CAN CAN
Layer MAC ISO 11898-1
Protocol Controller
PLS
1
Physical PMA CAN ISO 11898-2
Layer CAN Transceiver
MDI Physical Layer ISO 11898-3
21
Agenda
Standard & Implementation 3
Communication 12
Bus Access 15
Data Frame 20
Data Protection 32
Miscellaneous 43
22
Physical Layer
High-Speed Physical Layer – Physical Signal Transmission
logical 1
logical 0
3,5 Volt
CAN_H
2,5 Volt
CAN_L
1,5 Volt
23
Physical Layer
High-Speed Physical Layer – CAN Message
~ 2.5 V
~ 1.5 V
CAN_L
CAN message
24
Physical Layer
High-Speed Physical Layer – Topology
HOST
Controller
Transceiver
CAN_H CAN_L
CAN_H
RT RT
CAN_L
25
Agenda
Standard & Implementation 3
Physical Layer 5
> Communication 12
Bus Access 15
Data Frame 20
Data Protection 32
Miscellaneous 43
26
Communication
Architecture
Filter
CAN Controller CAN Controller
CAN-
CAN Node CAN Node
CAN Node CAN Node
CAN Transceiver CANKnoten
Transceiver
Filter Filter
ID Data
CAN Bus
27
Communication
Broadcasting
CAN bus CAN message CAN message CAN message CAN message t
28
Agenda
Standard & Implementation 3
Physical Layer 5
Communication 12
Data Frame 20
Data Protection 32
Miscellaneous 43
29
Bus Access
Bitwise Arbitration
IDID
1010 IDID
9 9 IDID
8 8 IDID
7 7 IDID
6 6 IDID
5 5 IDID
44 IDID
3 3 IDID
2 2 IDID
1 1 IDID
00
SS Arbitrationbuslogik
Wired-AND logic
CAN
CAN node
nodeAAA
CANnode OO
FF
11 11 00 00 11 00 00 11 11 00 00
Node A
Transmitter Node
Bus B Bus level
Interpretation
0
0 0
0 0
Continue
SS
CAN
Bus bus
Bus Idle
Idle OO 00
11 11 00 ? 1 0 0
0 0 1 1
1 1 0 Error
0 0
FF
1
1 0
0 0
Stop
1
1 1
1 1
Continue
SS
CAN
CAN node
nodeBBB
CANnode OO 11 11 00 11 00Stop
00 sending
00 11 11 00 00
FF 0 = dominant
IDID
1010 IDID
9 9 IDID
8 8 IDID
7 7 IDID
6 6 IDID
5 5 IDID
44 IDID
3 3 IDID
2 2 IDID
1 1 IDID
00
30
Bus Access
Prioritization of CAN messages
Priority
Low
High
0 2047 ID
31
Bus Access
Example
CAN
CAN message
32
33
Bus Access
Exercise 1
Draw the message sequence on the CAN bus for the communication
scenario shown!
CAN-Knoten A 5 5
CAN-Knoten B 7
CAN-Knoten C 3 3
CAN-Knoten D 6 6
CAN-Bus 5
34
Agenda
Standard & Implementation 3
Physical Layer 5
Communication 12
Bus Access 15
Data Protection 32
Miscellaneous 43
35
Data Frame
Structure
Data frame
Bus S R I I D A D
- O Identifier T D r DLC Data Field Checksum E C E EOF ITM
Idle F R E E L K L
Arbitration field Control field Data field Check field ACK field
36
Data Frame
SOF and Identifier
Data frame
Bus S R I I D A D
O Identifier T D r DLC Data field Checksum E C E EOF ITM
Idle F R E E L K L
Arbitration field Control field Data field Check field ACK field
Identifier (ID)
> Address of the data frame ( relevant to receiving process)
> Priority of the data frame ( relevant to sending process)
37
Data Frame
RTR
Data frame
Bus S R I I D A D
O Identifier T D r DLC Data field Checksum E C E EOF ITM
Idle F R E E L K L
Arbitration field Control field Data field Check field ACK field
No Data field
RTR=1
38
Data Frame
IDE
Data frame
Bus S R I I D A D
O Identifier T D r DLC Data field Checksum E C E EOF ITM
Idle F R E E L K L
Arbitration field Control field Data field Check field ACK field
> IDE = dominant: Standard Identifier (11 bits) Standard CAN Protocol
> IDE = recessive: Extended Identifier (29 bits) Extended CAN Protocol
39
Data Frame
IDE=0:
S R I
Standard format
O ID T D r0 DLC
11-bit identifier
F R E
IDE=1:
S S I R
Extended format
O Basis-ID R D Extended-ID T r1 r0
29-bit identifier
F R E R
40
Data Frame
Standard Identifiers and Extended Identifiers
S S I
CAN node A
Extended format
O
F
1 1 0 0 1 0 0 1 1 0 0 R D 1 1 1 0 1 1 0 0 1 …
R E
S R I
CAN node B …
Standard format
O
F
1 1 0 1 0 0 0 1 1 0 0 T D r
0
DLC Data
R E
S S I
CAN node C
Extended format
O
F
1 1 0 1 0 0 0 1 1 0 0 R D 1 0 1 0 1 1 1 0 1 …
R E
41
Data Frame
DLC and Data field
Data frame
Bus S R I I D A D
O Identifier T D r DLC Data field Checksum E C E EOF ITM
Idle F R E E L K L
Arbitration field Control field Data field Check field ACK field
> Number of data bytes > Space for max. 8 data bytes
42
Data Frame
Check field
Data frame
Bus S R I I D A D
O Identifier T D r DLC Data field Checksum E C E EOF ITM
Idle F R E E L K L
Arbitration field Control field Data field Check field ACK field
43
Data Frame
Acknowledgement
Data frame
Bus S R I I D A D
O Identifier T D r DLC Data field Checksum E C E EOF ITM
Idle F R E E L K L
Arbitration field Control field Data field Check field ACK field
44
Data Frame
EOF
Data Frame
Bus S R I I D A D
O Identifier T D r DLC Data Field Checksum E C E EOF ITM
Idle F R E E L K L
Arbitration field Control field Data field Check field ACK field
ITM – Intermission
> Pause time that a bus must be idle
11 recessive bits
> CAN nodes recognize that the CAN bus is idle
Bus idle
after detecting 11 recessive bits
45
46
47
48
Data Frame
Bit Stuffing
Data-Frame
Bus S R I I D A D
O Identifier T D r DLC Data-Field Checksum E C E EOF ITM
Idle F R E E L K L
Bitstuffing area
Transmitter 1 2 1 2 3 4 5 6 1 2 1 1 2 3 4 5 1 2
CAN-Bus 1 2 1 2 3 4 5 S 6 1 2 1 1 2 3 4 5 S 1 2
Receiver 1 2 1 2 3 4 5 6 1 2 1 1 2 3 4 5 1 2
49
Miscellaneous
Solution to Exercise 1
CAN node A 5 5
CAN node B 7
CAN node C 3 3
CAN node D 6 6
CAN bus 5 3 6 3 5 6 7
50
Agenda
> Standard & Implementation 3
Physical Layer 5
Communication 12
Bus Access 15
Data Frame 20
Data Protection 32
Miscellaneous 43
51
What is CAN ?
▪ Controller Area Network
✓ Invented by Robert Bosch GmbH in 1980 for automotive
applications
✓ Asynchronous Serial Bus
✓ Simple 2-wire differential bus
✓ Absence of node addressing
• Message identifier specifies contents and priority
• Lowest message identifier has highest priority
✓ Non-destructive arbitration system by CSMA with collision
detection
✓ Multi-master / Broadcasting concept
✓ Sophisticated error detection & handling system
52
4/8/20
What is CAN ?
▪ The CAN is an ISO standard (ISO 11898) for serial communication
▪ Today CAN has gained widespread use:
✓ Industrial Automation
✓ Automotive, …etc.
▪ The CAN standard includes:
✓ Physical layer
✓ Data-link layer
• Some message types
• Arbitration rules for bus access
• Methods for fault detection and fault confinement
53
4/8/20
Why CAN ?
▪ Mature Standard
✓ CAN protocol more than 16 years
✓ Numerous CAN products and tools on the market
▪ Hardware implementation of the protocol
✓ Combination of error handling and fault confinement with high
transmission speed (up to 1Mb/s)
▪ Simple Transmission Medium
✓ Twisted pair of wires is the standard, but also just one wire will
work
✓ Other links works, too: Opto - or radio links
▪ Excellent Error Handling
✓ CRC error detection mechanism
▪ Fault Confinement
✓ Built-in feature to prevent faulty node to block system
▪ Most used protocol in industrial and automotive world
54
4/8/20
55
56
57
58
59
60
61
62
63
64
65
66
FlexRay Communication Protocol
67
FlexRay Communication Protocol
68
FlexRay Communication Protocol
69
FlexRay Communication Protocol
70
FlexRay Communication Protocol
3 Network Topology(Communication Architecture)
• A FlexRay Communication System- FlexRay Cluster, is made up of
FlexRay Nodes and Physical transmission medium-FlexRay Bus
71
FlexRay Communication Protocol
3 Network Topology(Communication Architecture):
Physical Topologies: Passive Topologies
72
FlexRay Communication Protocol
3 Network Topology(Communication Architecture):
Physical Topologies: Active Topologies
73
FlexRay Communication Protocol
3 Communication Architecture:
FlexRay Node
74
FlexRay Communication Protocol
3 Communication Architecture:
75
FlexRay Communication Protocol
3 Communication Architecture:
76
FlexRay Communication Protocol
3 Communication Architecture:
77
FlexRay Communication Protocol
3 Communication Architecture:
78
FlexRay Communication Protocol
3 Communication Architecture:
79
FlexRay Communication Protocol
3 Communication Architecture:
80
FlexRay Communication Protocol
3 Communication Architecture:
81
FlexRay Communication Protocol
3 Communication Architecture:
82
FlexRay Communication Protocol
3 Communication Architecture:
83
FlexRay Communication Protocol
3 Communication Architecture:
84
FlexRay Communication Protocol
3 Communication Architecture:
85
FlexRay Communication Protocol
3 Communication Architecture:
86
FlexRay Communication Protocol
3 Communication Architecture:
87
FlexRay Communication Protocol
3 Communication Architecture:
88
FlexRay Communication Protocol
3 Communication Architecture:
89
FlexRay Communication Protocol
3 Communication Architecture:
90
FlexRay Communication Protocol
3 Communication Architecture:
91
FlexRay Communication Protocol
3 Communication Architecture:
92
FlexRay Communication Protocol
3 Communication Architecture:
93
FlexRay Communication Protocol
3 Communication Architecture:
94
FlexRay Communication Protocol
3 Communication Architecture:
95
FlexRay Communication Protocol
3 Communication Architecture:
96
FlexRay Communication Protocol
3 Communication Architecture:
97
FlexRay Communication Protocol
3 Communication Architecture:
98
FlexRay Communication Protocol
3 Communication Architecture:
99
FlexRay Communication Protocol
3 Communication Architecture:
100
FlexRay Communication Protocol
3 Communication Architecture:
101
FlexRay Communication Protocol
3 Communication Architecture:
102
FlexRay Communication Protocol
• 2 wire
• Fault-tolerance
103
FlexRay Communication Protocol
104
Thank you for your attention…….
105
FlexRay Communication Protocol
106
Slave Slave
Master
Local Interconnect Network
04/06/2025
LIN Agenda?
1. Introduction
2. Network Architecture
3. Communication
4. Message Structure
5. Message Types
6. Data Protection
10
04/06/2025 School of ECE 8
Intra-Vehicle
CAN
Network LIN
11
04/06/2025 School of ECE 5
1
Overhead bits
11
04/06/2025 School of ECE 7
2
Two wires
11
04/06/2025 School of ECE 8
3
11
04/06/2025 School of ECE 9
4
12
04/06/2025 School of ECE 0
5
Costly
12
04/06/2025 School of ECE 1
6
Latency time
12
04/06/2025 School of ECE 2
7
Separate controller is
required
12
04/06/2025 School of ECE 3
LIN Consortium
BMW
VW AUDI
VCT
Automotive Body Network
Mirror
Lock Lock
Window Lift
Universal Light
CAN Light
Seat
Htng
Instruments
Htng Wiper
Power Train Central WHtg
Body Ctrl Roof Interior
ITS Light
Htng Trunk
Climate
x6
Seat
Light Seat
Htng
St-Wheel Panel CAN
Universal Motor
Lock Lock
1 backbone, 13 nodes
8 subnets, 1-8 local nodes Sub-Bus
Universal Panel
52 nodes total
Mirror
12
04/06/2025 School of ECE 7
Low cost single-wire implementation
Slave Slave
Master
Local Interconnect Network
12
04/06/2025 School of ECE 9
Speed up to 20kbps
Slave Slave
Master
Local Interconnect Network
13
04/06/2025 School of ECE 0
– Single Master / Multiple Slave Concept
Slave Slave
Master
Local Interconnect Network
13
04/06/2025 School of ECE 1
– No arbitration necessary
Slave Slave
Master
Local Interconnect Network
13
04/06/2025 School of ECE 2
– based on common UART/SCI interface hardware
Slave Slave
Master
Local Interconnect Network
13
04/06/2025 School of ECE 3
– Almost any Microcontroller has necessary hardware on chip
Slave Slave
Master
Local Interconnect Network
13
04/06/2025 School of ECE 4
– Self synchronization without crystal or ceramics resonator in the slave nodes
Slave Slave
Master
Local Interconnect Network
13
04/06/2025 School of ECE 5
Guaranteed latency times for signal transmission (Predictability)
Slave Slave
Master
Local Interconnect Network
13
04/06/2025 School of ECE 6
Identifier denotes message content, not physical address
Slave Slave
Master
Local Interconnect Network
13
04/06/2025 School of ECE 7
How was the communication
before LIN?
13
04/06/2025 School of ECE 8
Conventional v/s LIN
13
04/06/2025 School of ECE 9
LIN WORK FLOW
14
04/06/2025 School of ECE 0
14
04/06/2025 School of ECE 1
14
04/06/2025 School of ECE 2
Time triggered
14
04/06/2025 School of ECE 3
Master / Slave Protocol
» Master Task
– Determines order and priority of messages.
– Monitors Data and check byte and controls the error handler.
– Serves as a reference with its clock base (stable clock necessary)
– Receives Wake- Up Break from slave nodes
» Slave Task
– Is one of 2-16 members on the bus
– Receives or transmits data when an appropriate ID is sent by the
master.
– The node serving as a master can be slave, too!
Master / Slave Protocol
» Master
– has control over the whole Bus and Protocol
The master controls which message at what time is to be transferred
over the bus.
To accomplish this the master
• sends Sync Break
• sends Sync Byte
• sends ID-Field
• monitors Data Bytes and Check Byte, and evaluates them on
consistance
• receives WakeUp Break from slave nodes when the bus is inactive
and they request some action.
Master/Slave Protocol
» Slave
– Is one of 2-16 Members on the Bus and receives or transmits Data
when an appropriate ID is sent by the master.
• Slave snoops for ID.
• According to ID, slave determines what to do.
– either receive data
– or transmit data
– or do nothing.
• When transmitting the slave
– sends 1, 2, 4, or 8 Data Bytes
– sends Check-Byte
• The node serving as a master can be slave, too!
LIN protocol offers message timing predictability
Time Triggered Approach
» Message Length is known
– Number of transmitted data bytes is known
® minimum length can be calculated
– Each Message has length budget of 140% of it’s minimum length
® maximum allowed length is known
® distance between beginning of two messages
Message Frame
» Synch Byte:
– Specific Pattern for Determination of Time Base
(Determination of the time between two rising edges)
– A Synch Byte precedes any Message Frame
» ID-Field:
– Message Identifier: Incorporates Information about the sender, the
receiver(s), the purpose, and the Data field length.
Length 6 Bit.
4 classes of 1/2/4/8 Data Bytes. The length coding is in the
2 LSB of the ID-Field. Each class has 16 Identifiers. A total of 64
Message Identifiers are possible.
– 2 Parity Bits protect this highly sensitive ID-Field.
Identifier
» The identifier field is sent by the master node to all LIN nodes
» This identifier normally contains one of 64 different values and
includes 2 parity bits in the 8 bit data
» The identifier is normally associated with a collection of signals
that are subsequently transmitted on the LIN bus
» In a specific case this can initiate SLEEP mode in the LIN slave
nodes – in this case no further data is transmitted on the LIN bus
message header
15
04/06/2025 School of ECE 1
15
04/06/2025 School of ECE 2
0x10
0x10
0x10
15
04/06/2025 School of ECE 3
LIN Communication - Data from
Slave to Master
17
04/06/2025 School of ECE 0
17
04/06/2025 School of ECE 1
How checksum is calculated?
1. Classic method
2. Enhanced method
17
04/06/2025 School of ECE 2
Classical Method?
Only the useful data is protected.
To retain downward compatibility, diagnostic frames are always
protected with the classic checksum.
Checksum = INV (data byte 1 ⊕ data byte 2 ⊕ ... ⊕ data byte 8)
17
04/06/2025 School of ECE 3
Enhanced Method?
With the enhanced checksum, the useful data and the PID are protected.
The enhanced checksum is used for identifiers 0 to 59, effective with
Version 2.0 of the protocol. To retain downward compatibility, diagnostic
frames are always protected with the classic checksum.
17
04/06/2025 School of ECE 4
17
04/06/2025 School of ECE 5
Enhannced
Method
17
04/06/2025 School of ECE 6
17
04/06/2025 School of ECE 7
17
04/06/2025 School of ECE 8
17
04/06/2025 School of ECE 9
18
04/06/2025 School of ECE 0
18
04/06/2025 School of ECE 1
18
04/06/2025 School of ECE 2
» https://docs.google.com/forms/d/e/
1FAIpQLSeWYvCMxY1WZ7iORqbtaegw1Ii
urpTW0aK81pGKtUkrMNyB4Q/viewform?
usp=sf_link
18
04/06/2025 School of ECE 3
Types of frame formats
» Unconditional frame
18
04/06/2025 School of ECE 4
» The Standard Frame
» Unique Response
» No Collisions
18
04/06/2025 School of ECE 5
18
04/06/2025 School of ECE 6
Event triggered frame
» This message type is used to transmit event-
driven information, which needs to be sent by a
node as necessary.
» Essentially, an event triggered frame is
equivalent to a standardized
Unconditional Frame.
» The difference is that multiple slaves may send a
response to a header from the master.
18
04/06/2025 School of ECE 7
Sporadic Frame
» The master uses sporadic frames to send rarely
used information, i.e. sporadic information.
» The master transmits sporadic frames as
needed. If there is no need to send them, the
related slot is empty.
» The sporadic frame is basically an
Event Triggered Frame for the master.
18
04/06/2025 School of ECE 8
diagnostic frame
» The protocol defines two diagnostic frames: the
master request frame and the slave response
frame.
» A master request frame is usually used as a
diagnostic request or to configure slaves. A slave
response frame is used as a diagnostic
response.
18
04/06/2025 School of ECE 9
Error Detection & Handling
19
04/06/2025 School of ECE 0
19
04/06/2025 School of ECE 1
19
04/06/2025 School of ECE 2
19
04/06/2025 School of ECE 3
19
04/06/2025 School of ECE 4
19
04/06/2025 School of ECE 5
19
04/06/2025 School of ECE 6
How was the Communication earlier?
Gyro Sensor
Gyro
sensor sensor
1
Sensor
radar radar
2
Sensor
IR IR
3
Wheel Sensor
Wheel
speed speed
4
ECU ECU
1 3
What is
communication ?
ECU ECU
2 4
Gyro Gyro
sensor sensor
radar radar
IR IR
Wheel Wheel
Gyro
sensor
Sensor
radar
2
ECU ECU
1 3
What is
communication ?
ECU ECU
2 4
radar
IR
Wheel
EMS
ECU
ABS ECU
BMS
ECU
What is
communication ?
Steering
control ECU
Suspension
AIR BAG
Network became simple
CAN
BUS
Complexity reduced
CAN
BUS
But what is the problem?
SPEED
CAN
BUS
Inter vehicular
not supported
CAN
BUS
Error handling But not critical
is good and for media
critical for some devices
CAN
BUS
What is MOST?
Media Oriented System
Transport
Who is MOST?
CAR makers
Setmaker System
s Architect
Suppliers
Together they define and adopt a common multimedia network protocol and
application object model.
» It is a collaborative development work
» Initially every was cautious about the other
partner.
» Because it was a partnership between
competitors‘
Collaborations?
Network Management
Physical Layer
Collaborations?
Nod
e
Application Requirements Nod
e
Network Management
Nod
Nod
e
e
Physical Layer
Nod
Nod e
e
Nod
e
Why MOST?
Why these devices need
networking?
CASE -1