Local Interconnect Network: Course: Automotive Electronics Faculties In-Charge: Nalini C Iyer
Local Interconnect Network: Course: Automotive Electronics Faculties In-Charge: Nalini C Iyer
Master
Local Interconnect Network
*
Slave Slave Slave
LIN Agenda?
1. Introduction
2. Network Architecture
3. Communication
4. Message Structure
5. Message Types
6. Data Protection
* School of ECE 3
Why LIN?
* School of ECE 4
What are the limitations of CAN?
• Maximum 8 bytes of data can be sent
• Speed is limited by 1mbps
• No redundant channel available
• Latency time
• Costly
• No peer-peer communication
• Overhead bits are more
• No master to control the BUS
1
Overhead bits
* School of ECE 6
2
Two wires
* School of ECE 7
3
* School of ECE 8
4
* School of ECE 9
5
Costly
* School of ECE 10
6
Latency time
* School of ECE 11
7
* School of ECE 12
LIN Consortium
BM
W
Daiml
LIN Volv
er-
o
Chrysl Spec
er
VW AUD
I
VCT
What are the features of LIN?
* School of ECE 14
– Low cost single-wire implementation (enhanced ISO 9141)
– Speed up to 20Kbit/s (limited for EMI-reasons)
– Single Master / Multiple Slave Concept
– No arbitration necessary
– Low cost silicon implementation based on common UART/SCI
interface hardware
– Almost any Microcontroller has necessary hardware on chip
– Self synchronization without crystal or ceramics resonator in the
slave nodes
– Significant cost reduction of hardware platform
– Guaranteed latency times for signal transmission (Predictability)
– Identifier denotes message content, not physical address
Low cost single-wire implementation
Slave Slave
Master
Local Interconnect Network
* School of ECE 16
Speed up to 20kbps
Slave Slave
Master
Local Interconnect Network
* School of ECE 17
– Single Master / Multiple Slave Concept
Slave Slave
Master
Local Interconnect Network
* School of ECE 18
– No arbitration necessary
Slave Slave
Master
Local Interconnect Network
* School of ECE 19
– based on common UART/SCI interface hardware
Slave Slave
Master
Local Interconnect Network
* School of ECE 20
– Almost any Microcontroller has necessary hardware on chip
Slave Slave
Master
Local Interconnect Network
* School of ECE 21
– Self synchronization without crystal or ceramics resonator in the slave nodes
Slave Slave
Master
Local Interconnect Network
* School of ECE 22
– Guaranteed latency times for signal transmission (Predictability)
Slave Slave
Master
Local Interconnect Network
* School of ECE 23
– Identifier denotes message content, not physical address
Slave Slave
Master
Local Interconnect Network
* School of ECE 24
How was the communication
before LIN?
* School of ECE 25
Conventional v/s LIN
* School of ECE 26
* School of ECE 27
* School of ECE 28
* School of ECE 29
* School of ECE 30
Unconditional
FRAME TYPES frame
Unconditional frames always carry signals and their identifiers are in the range 0 to 59(0x3b).
Event triggered frame
The purpose of an event triggered frame is to increase the responsitivity of the LIN
cluster without assigning too much of the bus bandwidth to the polling of multiple slave
nodes with seldom occurring events
Sporadic frame
The purpose of sporadic frames is to blend some dynamic behavior into the deterministic and real-
time focused schedule table without loosing the determinism in the rest of the schedule table.
Diagnostic frames
Diagnostic frames always carry diagnostic or configuration data and they always contain
eight data bytes. The identifier is either 60 (0x3c), called master request frame, or
61 (0x3d), called slave response frame
User-defined frames
User-defined frames carry any kind of information. Their identifier is 62 (0x3e). The header of a
user-defined frame is always transmitted when a frame slot allocated to the frame is processed.
Reserved frames
Reserved frames shall not be used in a LIN 2.0 cluster. Their identifier is 63 (0x3f).
* School of ECE 32
* School of ECE 33
0x10
0x10
* School of ECE 34
Automotive Body Network
• 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.
• serves as a reference with it’s clock base (stable clock necessary)
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
Data Transmission
13 bit
Brea Next 13 bit break
$5
k 5
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
Synchronisati
Identifier byte
on
frame
Synchronisation Message
field
LIN Physical Interface
Electronic Control Unit Bus Voltage
VBAT
8...18V recessive
master: 1kΩ logic ‘1’
slave: 60%
R 30kΩ controlled slope
UART x Bu 40% ~2V/µs
Tx s dominant
logic ‘0’
GN
Time
Example capacitances D
master: 2.2nF Note:
slave: 220pF The LIN specification refers to the ECU connector voltages !
* School of ECE 57
* School of ECE 58
* School of ECE 59
* School of ECE 60
How PID is calculated?
* School of ECE 61
* School of ECE 62
How checksum is calculated?
1. Classic method
2. Enhanced method
With the classic checksum, only the useful data is protected. 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.
* School of ECE 63
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)
* School of ECE 64
Classical Method?
1. Classic method
2. Enhanced method
With the classic checksum, only the useful data is protected. 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.
* School of ECE 65
* School of ECE 66
Enhannced
Method
* School of ECE 67
* School of ECE 68
* School of ECE 69
* School of ECE 70
* School of ECE 71
* School of ECE 72
* School of ECE 73
Types of frame formats
• Unconditional frame
* School of ECE 74
• The Standard Frame
• Unique Response
• No Collisions
* School of ECE 75
* School of ECE 76
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.
* School of ECE 77
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.
* School of ECE 78
diagnostic frame
• The protocol defines two diagnostic frames: the
master request frame and the slave response frame.
• They are defined based on the ISO 15765-2
transport and on uniform diagnostic services (UDS)
in accordance with ISO 14229.
• 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.
* School of ECE 79
Error Detection & Handling
* School of ECE 80
* School of ECE 81
* School of ECE 82
* School of ECE 83
* School of ECE 84
* School of ECE 85
* School of ECE 86
* School of ECE 87
* School of ECE 88