Escolar Documentos
Profissional Documentos
Cultura Documentos
1: In-Car Networking
K-LINE
Protocol
> 300ms
~ 2s
< 300ms
K-Line
Adress byte
L-Line
Adress byte
5 Bit/s
ECU Tester
< 20ms
Sync. Byte
55h
< 20ms
Keyword
LSB
< 20ms
Keyword
MSB
< 50ms
Inv. Keyword
MSB
Inverted
Adress byte
Protocol
25ms
K-Line
< 50ms
Start Communication
Service Request
(w/ Keyword)
Start Communication
Service Request
L-Line
Wake Up
Protocol
Addressing
Address
length
is
1
Byte
Either:
physical
addressing
(idenVes
specic
ECU)
Or:
funcVonal
addressing
(idenVes
class
of
ECU)
e.g.,
engine,
transmission,
...
DierenVated
via
format
byte
Protocol header
Format
Byte
Encodes
presence
and
meaning
of
address
bytes
Short
packet
length
can
be
encoded
in
format
byte;
length
byte
then
omiaed
DesVnaVon
address
Source
address
Length
Payload
Up
to
255
Byte
First
Byte:
Service
IdenVer
(SID)
Checksum
Sum
of
all
Bytes
(mod
256)
0 .. 7
8 .. 15
Format byte
Destination
Source
Length
Payload...
...
[C2X]
Summer
2014
Checksum
8
Service IdenVers
Error handling
10
11
CAN
12
Common:
Up
to
110
nodes
At
125
kBit/s:
max.
500m
Always:
Two
signal
levels
low
(dominant)
high
(recessive)
13
ECU 1
ECU n
C
CAN
Controller
Message
oriented
Does
not
use
desVnaVon
addresses
Implicit
Broadcast/MulVcast
ECU 2
Transceiver
CAN_H
120
CAN_L
14
Wire 1
Wire 2
15
Up
to
125
kBit/s
Standard
two
wire
line
suces
No
restricVon
on
branch
lines
TerminaVng
resistors
opVonal
Signal
swing
5
V
16
Bit
Timing
Times
derived
from
clock
Vme
(Quantum)
TQ
Bit
Vme
Tbit
consists
of
sync
segment
TSyncSeg,
propagaVon
segment
TPropSeg,
phase
segments
TPhaseSeg1,
TPhaseSeg2
(can
be
adapted
by
controller
for
synchronizaVon)
TSyncSeg+
TPropSeg
must
be
longer
than
2x
propagaVon
delay
Signal
sampled
between
TPhaseSeg1
and
TPhaseSeg2
Standard
recommends,
e.g.
at
500
kbps,
TQ
=
125
ns,
Tbit
=16
TQ
TSyncSeg=1TQ
TPropSeg=18TQ
TPhaseSeg1=18TQ
Tbit=419TQ
Signal Sampled
Bit begins
[C2X]
Summer
2014
Bit ends
17
Address-less
communicaVon
Messages
carry
11
Bit
or
29
Bit
message
idenVer
StaVons
do
not
have
an
address,
frames
do
not
contain
one
StaVons
use
message
idenVer
to
decide
whether
a
message
is
meant
for
them
Medium
access
using
CSMA/CR
with
bitwise
arbitraVon
Link
layer
uses
4
frame
formats
Data,
Remote
(request),
Error,
Overload
(ow
control)
Data
frame
format:
Start
Bit
11+1 or 29+3 Bit
Message Identifier
Header, 19 or 39 bit
[C2X]
Summer
2014
Bus
Idle
Control
Bits
6 bit Data 0 . . . 8 Byte
Payload, 0 64 bit
15 bit
CRC
Acknowledge &
End of Frame
Trailer, 25 bit
3 bit
18
19
20
001
011
010
100
110
101
21
Client 1
Client 2
Client 3
Bus
22
Client 1
Client 2
Client 3
Bus
23
Client 1
Client 2
Client 3
Bus
24
Client 1
Client 2
Client 3
Bus
25
Reference
Message
Time
Window 1
Time
Window 2
Next Ref.
Message
Basic cycle
[C2X]
Summer
2014
26
27
Message ltering
Bit
10
28
Data format
NRZ
Time
synchronizaVon
using
start
bit
and
stu
bits
(stu
width
5)
Frame
begins
with
start
bit
Message
idenVer
11
Bit
(CAN
2.0A),
now
29
Bit
(CAN
2.0B)
15
SB
Identifier
Control Bits
Data
...
CRC
Acknowledge & End of Frame
[C2X]
Summer
2014
29
Data format
Control
Bits
Message
type
(Request,
Data,
Error,
Overload)
Message
length
...
15
SB
Identifier
Control Bits
Data
...
CRC
Acknowledge & End of Frame
[C2X]
Summer
2014
30
Data format
Payload
RestricVon
to
max.
8
Byte
per
message
Transmission
Vme
at
500
kBit/s:
260
s
(using
29
Bit
ID)
i.e.,
usable
data
rate
30
kBit/s
15
SB
Identifier
Control Bits
Data
...
CRC
Acknowledge & End of Frame
[C2X]
Summer
2014
31
32
33
ISO-TP
ISO
15765-2
TP
2.0
Industry
standard
34
ISO-TP: Header
Extended
addressing
Uniqueness
of
addresses
despite
non-unique
CAN
message
ID
Part
of
transport
protocol
address
in
CAN
message
ID,
addiVonal
address
informaVon
in
rst
Byte
of
TP-Header
0
(opt) Addl.
Address
1
PCI
high
2
PCI
low
Payload
35
0
0
Len
Payload
0
(Address)
1
0
Len
4
Payload
36
(Address)
Len
Payload
0
(Address)
1
2
SN
Payload
Protocols:
K-Line,
CAN,
and
LIN
37
FS=2:
Wait
Overload
Sender
must
wait
for
next
Flow
Control
Frame
0
(Address)
1
3
FS
BS
ST
Protocols:
K-Line,
CAN,
and
LIN
38
TP 2.0
ConnecVon
oriented
CommunicaVon
based
on
channels
Species
Setup,
ConguraVon,
Transmission,
Teardown
Addressing
39
TP 2.0: Broadcast
Byte
1:
Opcode
0x23:
Broadcast
Request
0x24:
Broadcast
Response
Byte
2,
3,
4:
Service
ID
(SID)
and
parameters
Byte
5,
6:
Response:
0x0000
No
response
expected:
alternates
between
0x5555
/
0xAAAA
Dest
Opcode
3
SID, Parameter
Protocols:
K-Line,
CAN,
and
LIN
0x55
0x55
40
Byte
0:
logical
address
desVnaVon
ECU
Byte
1:
Opcode
0xC0:
Channel
Request
0xD0:
PosiVve
Response
0xD6
..
0xD8:
NegaVve
Response
Byte
2,
3:
RX
ID
Validity
nibble
of
Byte
3
is
0
(1
if
RX
ID
not
set)
Byte
4,
5:
TX
ID
Validity
nibble
of
Byte
5
is
0
(1
if
TX
ID
not
set)
Dest
Opcode
RX ID
4
V
TX ID
6
V
App
41
Dest
0xC0
4
1
TX ID
6
0
App
42
Byte
0:
Opcode
0xA0:
Channel
Setup
Request
(Parameters
for
channel
to
iniVator)
0xA1:
Channel
Setup
Response
(Parameter
for
reverse
channel)
Byte
0:
Opcode
0xA3:
Test
will
be
answered
by
ConnecVon
Setup
Response
0xA4:
Break
Receiver
discards
data
since
last
ACK
0xA5:
Disconnect
Receiver
responds
with
disconnect,
too
0xA0
BS
Timing
Protocols:
K-Line,
CAN,
and
LIN
43
Opcode Nibble
Bytes 1 .. 7: Payload
/AR
EOM
Opcode Nibble
1
0
Op
1
SN
0
6
RS
1
7
Payload
Protocols:
K-Line,
CAN,
and
LIN
44
LIN
45
Numerous
extensions
Backwards
compaVble
(only)
Only
reached
partway
Diagnostic
Signal interaction
frame handler
LIN bus line
Protocols:
K-Line,
CAN,
and
LIN
46
no
quartz
needed
lax
Vming
constraints
Message oriented
No desVnaVon address
Master
Function
Slave
Function
Slave
Function
Slave
Function
47
No
error
correcVon
StarVng
with
LIN
2.0:
Response
Error
Bit
48
Data request
Bus Idle
1 bit
Sync Break
13 bit
Sync
Byte 55h
LIN
Identifier
Data
byte
Data
byte
Checksum
Data response
Bus Idle
1 bit
Sync Break
13 bit
Sync
Byte 55h
LIN
Identifier
Data
byte
Data
byte
Checksum
Types of requests
UncondiVonal
Frame
Event
Triggered
Frame
Sporadic
Frame
...
UncondiVonal
Frame
Most
simple
frame
type
Designed
for
periodic
polling
of
specic
data
point
Exactly
one
slave
answers
LIN
is
a
single
master
system
Vming
of
uncondiVonal
frames
fully
determinisVc
Sample
use
case:
51
Types of requests
UncondiVonal
Frame
Event
Triggered
Frame
Sporadic
Frame
...
52
Types of requests
UncondiVonal
Frame
Event
Triggered
Frame
Sporadic
Frame
...
Sporadic
Frame
Sent
(by
master)
only
when
needed
Shared
schedule
slot
with
other
Sporadic
Frames
Use
whenever
polling
for
specic
data
only
seldom
needed
If
more
than
one
Sporadic
Frame
needs
to
be
sent,
master
needs
to
decide
for
one
no
collision,
but
sVll
non-determinisVc
Sample
use
case:
53
Slot
Type
Unconditional
AC
Unconditional
Rain sensor
Unconditional
Tire pressure
Event triggered
Power window
Sporadic
(unused)
-ORFuel level
-OROutside temp
Signal
54
Standardized
protocol
LIN
dest
address
is
0x3C
(Byte
1
is
ISO
dest
address)
Dest
ECU
(according
to
ISO
address)
answers
with
address
0x3D
Independent
of
payload,
LIN
frame
padded
to
8
Bytes
LIN
slaves
have
to
also
support
KWP
2000
Contradicts
low
cost
approach
of
LIN
DiagnosVc
Class
indicates
level
of
support
55
Main Takeaways
Overall
Design
goals
Message
orientaVon
vs.
address
orientaVon,
Addressing
schemes
Medium
access
Flow
control
Real
Vme
guarantees
and
determinism
K-Line
CAN
Error
detecVon
Transport
layer:
ISO-TP
vs.
TP
2.0
LIN
Goals
Deployment
as
sub
bus
Message
types
and
scheduling
Determinism
56