LIN (Local Interconnected Network)



Similar documents
Introduction to LIN. Webinar

Local Interconnect Network Training. Local Interconnect Network Training. Overview

LIN (Local Interconnect Network):

LIN. Specification Package. Revision 2.0. This specification is provided on an "AS IS" basis only and cannot be the basis for any claims.

LOCAL INTERCONNECT NETWORK (LIN)

In-Vehicle Networking

Introduction to. LIN (Local Interconnect Network)

Introduction to RACE FUELS Hans-Christian von der Wense Munich, Germany

LOW COST AUTOMOTIVE NETWORKS. Local Interconnect Network (LIN)

Appendix B RCS11 Remote Communications

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

In-Vehicular Communication Networking Protocol

Standardized software components will help in mastering the. software should be developed for FlexRay were presented at

Getting Started with CANopen Version Application Note AN-AON

LIN-Basic Workshop. Speaker: Andreas Lipowsky Lipowsky Industrie-Elektronik GmbH

Dolphin In-Circuit programming Updating Firmware in the field

RS-485 Protocol Manual

Serial Communications / Protocol in AirTest Products

EnOcean Radio Protocol 2. September 26, 2013 SPECIFICATION V1.0. Subject to modifications EnOcean Radio Protocol 2 V1.0 Page 1/19

Based on Computer Networking, 4 th Edition by Kurose and Ross

Comparison of FlexRay and CAN-bus for Real-Time Communication

Application Note. Introduction AN2471/D 3/2003. PC Master Software Communication Protocol Specification

Chapter 4. Medium Access Control. IN2P3 Octobre 2002 Jean-Pierre Thomesse

Internet Packets. Forwarding Datagrams

Serial Communications

Industrial Networks & Databases

CIA405.lib. Contents. WAGO-I/O-PRO 32 Library

MBP_MSTR: Modbus Plus Master 12

Unit of Learning # 2 The Physical Layer. Sergio Guíñez Molinos sguinez@utalca.cl

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

CSE331: Introduction to Networks and Security. Lecture 6 Fall 2006

Tutorial.

Welcome to the Introduction to Controller Area Network web seminar My name is William Stuart, and I am a Applications Engineer for the Automotive

Internet Architecture and Philosophy

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

Ethernet. Ethernet Frame Structure. Ethernet Frame Structure (more) Ethernet: uses CSMA/CD

The OSI Model and the TCP/IP Protocol Suite PROTOCOL LAYERS. Hierarchy. Services THE OSI MODEL

Ring Local Area Network. Ring LANs

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

Computer Network. Interconnected collection of autonomous computers that are able to exchange information

4511 MODBUS RTU. Configuration Manual. HART transparent driver. No. 9107MCM100(1328)

Distributed Real-Time Systems (TI-DRTS) Track 2. CAN-BUS Introduction. Version Ref. VECTOR application note & Motorola note

TD-03011E. Identifier Usage in CANopen Networks

CAM-VGA100 User Manual

K-line Communication Description

standard. Acknowledgement: Slides borrowed from Richard Y. Yale

RPDO 1 TPDO 1 TPDO 5 TPDO 6 TPDO 7 TPDO 8

Cover. SEB SIMOTION Easy Basics. Collection of standardized SIMOTION basic functions. FAQ April Service & Support. Answers for industry.

Final for ECE374 05/06/13 Solution!!

Documentation. M-Bus 130-mbx

Using XGATE to Implement LIN Communication on HCS12X Daniel Malik 8/16-Bit Products Division East Kilbride, Scotland

ECE 358: Computer Networks. Solutions to Homework #4. Chapter 4 - The Network Layer

Serial Communications

First Semester Examinations 2011/12 INTERNET PRINCIPLES

Transport and Network Layer

Technical Support Bulletin Nr.18 Modbus Tips

UART-based LIN-bus Support for Linux with SocketCAN Interface

How To Communicate With A Token Ring Network (Dihon)

MAC Sublayer. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross

Transport Layer Protocols

PMC-XM-DIFF & EADIN/MODBUS Virtex Design

Simple and error-free startup of the communication cluster. as well as high system stability over long service life are

Industrial Networks & Databases. Protocols and Networks - Device Bus - - Field Bus -

LLC: Frame Construction. Layer 2: Division into two Parts. Error-detecting and -correcting Codes. Error-correcting Codes

Movement/monitoring 1307/1.0 (6325xx)

WIZnet S2E (Serial-to-Ethernet) Device s Configuration Tool Programming Guide

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Applied Data Communication Lecture 14

Quectel Cellular Engine

Real-Time Systems Hermann Härtig Real-Time Communication (following Kopetz, Liu, Schönberg, Löser)

Implementing MOD bus and CAN bus Protocol Conversion Interface

Process Control and Automation using Modbus Protocol

Level 2 Routing: LAN Bridges and Switches

ESPA Nov 1984 PROPOSAL FOR SERIAL DATA INTERFACE FOR PAGING EQUIPMENT CONTENTS 1. INTRODUCTION 2. CHARACTER DESCRIPTION

Applications. Network Application Performance Analysis. Laboratory. Objective. Overview

IP - The Internet Protocol

ECE 358: Computer Networks. Homework #3. Chapter 5 and 6 Review Questions 1

EnDat 2.2 Bidirectional Interface for Position Encoders

Positioning Controllers. Communication Guide. Document ID: rel4054

Route Discovery Protocols

Modbus Protocol. PDF format version of the MODBUS Protocol. The original was found at:

EXAMPLES AND PROBLEMS. Competence Based Education Internet Protocols

PFB366 Profibus-DP Gateway User Manual

From Fieldbus to toreal Time Ethernet

Computer Networks. Definition of LAN. Connection of Network. Key Points of LAN. Lecture 06 Connecting Networks

HOST Embedded System. SLAVE EasyMDB interface. Reference Manual EasyMDB RS232-TTL. 1 Introduction

DS2401 Silicon Serial Number

RARP: Reverse Address Resolution Protocol

Introduction to Ethernet and IP in automotive vehicles

COMMUNICATION NETWORKS WITH LAYERED ARCHITECTURES. Gene Robinson E.A.Robinsson Consulting

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Brunata Optuna W (171)

Ethernet. Ethernet. Network Devices

Serial Bus Systems in the Automobile

From Signal Routing to complete AUTOSAR compliant CAN design with PREEvision (II)

Project 4: Pseudo USB Simulation Introduction to UNIVERSAL SERIAL BUS (USB) STANDARD

Transcription:

Slide 1 LIN (Local Interconnected Network) Fundamentals of the LIN Protocol Ralf Schwering,, Software Development Engineer Vector Informatik GmbH www.lin-subbus.org -1-

Slide 2 Agenda Communication Principle Message Format Scheduling Message Types Data Assurance Miscellaneous -2-

Slide 3 Centrally Controlled Message Distribution System LIN nodes do not have equal access to the bus due to Master-Slave architecture LIN Master delegates communication (Delegated Token Principle) Message distribution based on message addressing 64 message addresses (Identifiers) LIN Master Daten Data1 Slave- Task 1 Daten Data2 LIN- Slave LIN- Slave Producer Daten Data3 Slave- Task 2 Daten Data4 Consumer Daten Data5 Slave- Task 3 Daten Data6 Master- Task Daten Data Token LIN-Bus Schedule Schedule Schedule LIN Message Daten Data7 Daten Data8 Slave- Task 4 LIN- Slave Consumer -3- The LIN network is based on a Master-Slave architecture. One network node is chosen to control all communication. This is the LIN Master. The LIN Master performs the role of a bus arbiter with the help of the so-called Master Task and LIN Schedule. The LIN Schedule sets the send time point of the LIN message to be transmitted. According to the LIN Schedule, the LIN Master places special messages referred to as Tokens on the bus at specified time points. A Token can be understood as a Request, and it contains a message address. This is evaluated by the LIN Slaves. A LIN Slave has three alternatives for reacting to the Token: Send data, receive data, ignore data. Token and data together are referred to as the LIN message. Up to 64 LIN messages may be defined. Because of its message addressing method, each LIN message is available to be received by any LIN node even by the LIN Master if it has a Slave Task. The LIN network is therefore a centrallycontrolled message distribution system.

Slide 4 Agenda Communication Principle Message Format Scheduling Message Types Data Assurance Miscellaneous -4-

Slide 5 Message Header The Token is referred to as the Message Header The Message Header is sent by the Master Task The Message Header is used for synchronization The Message Header includes the identifier Message Header Sync Break Sync Field Protected Identifier (PID) (at least 13 bits) T SYNBRK T DEL 0x55-5- The Token is referred to as the Message Header in a LIN network. The entire Message Header is transmitted by the LIN Master. It is made up of the Sync Break, Sync Field and PID (Protected Identifier). Both the Sync Field and Sync Byte are used for initial synchronization. The PID is comprised of the message address (Identifier) and two parity bits. According to the message address the LIN nodes decide what they do immediately after the Message Header (send, receive or ignore the message response).

Slide 6 Message Response The Message Response is sent by a Slave Task The Message Response is comprised of the data and checksum Classic checksum over data field (LIN 1.x) Enhanced checksum over data field and ID field (LIN 2.0) Message Response Data Byte 1 Data Byte n Checksum... Data Field (max. 8 Byte) -6- The message response is sent by a Slave-Task delegated for this purpose based on the message address. A maximum of eight data bytes may be transmitted with a message response. It should be noted that byte transmission begins with the LSB. Transmitting a word the transmission begins with the low byte (Little Endian transmission, Intel mode). In principle a message response may be received and accepted by all Slaves-Tasks. The data bytes are protected with the help of a checksum. Checksum formation is based on Modulo- 2 arithmetic and Carry Bit over all data bytes. The individual data bytes are added by Modulo-2 arithmetic. Overflow bits are carried. Finally the result is inverted. Two different checksums exist: Classic and Enhanced checksums. With the Classic checksum only the data bytes are protected. With the Enhanced checksum the data bytes and the identifier are protected. For LIN 1.3 conformant LIN nodes the message responses to be transmitted are always equipped with the Classic checksum, since the Enhanced checksum is unknown in LIN 1.3. It should be noted that LIN messages with identifiers 60 and 61 (Diagnostics) are always protected with the Classic checksum.

Slide 7 State Flow Charts -7-

Slide 8 LIN Message (Nominal) LIN Message Message Header Message Response Sync Break Sync Field PID Field Data 1... Data n Checksum 14 Bit 10 Bit 10 Bit 10-80 Bit 10 Bit t Header_Nom t Response_Nom t Frame_Nom t Header_Nom =(N Sync_Field + N Sync_Byte + N PID_Byte ) t Bit = 34 t Bit t Response_Nom = 10 (N Data + 1) t Bit t Frame_Nom =t Header_Nom + t Response_Nom -8- The LIN message is made up of the Message Header and Message Response. The Message Header is always sent by the LIN Master. It contains synchronization information (Sync Field and Sync Byte), the message address and two parity bits (Protected Identifier - PID). The Message Response contains a maximum of eight data bytes and a checksum. LIN message transmission is based on the SCI interface. A SCI character is made up of eight data bits framed by a start bit and a stop bit. If the Sync Break must be 13 dominant bits and be terminated by a recessive bit, then the LIN Message Header has a nominal length of 34 bits. The length of the Message Response includes the number of data bytes and the checksum: Min. 20 bits (one data byte), max. 90 bits (eight data bytes). In the case of transmission of eight data bytes the LIN message has a nominal length of 124 bits (Message Header: 34 bits, Message Response: 90 bits). The shortest LIN message contains 54 bits (Message Header: 34 bits, Message Response: 20 bits).

Slide 9 Transmission of a LIN Message A time reserve of up to 40% is given for transmission of a LIN message t Frame_Max =t Header_Max + t Response_Max = 1.4 t Frame_Nom Message Header LIN Message Message Response Sync Break Sync Field PID Field Data 1 Data n Checksum Interbyte Space Interbyte Space Response Space Interbyte Space Interbyte Space t Header_Max t Response_Max t Frame_Max -9- A time reserve of up to 40 % is given for transmission of a LIN message. This is a very important piece of information, above all for the dimensioning of a LIN network. This reserve compensates for the fact that very low-performance controller chips might be used or the LIN Task might not be executed immediately. In other words, the LIN node is allowed to delay the start of the next UART character. However, the sum of all delay times may not exceed the time reserve of 40 %. Differentiation is made between two types of delay times: Interbyte Space and Response Space. The Response Space is located between the Message Header and Message Response, and the Interbyte Space between any two UART characters.

Slide 10 Agenda Communication Principle Message Format Scheduling Message Types Data Assurance Miscellaneous -10-

Slide 11 Principle of Scheduling The LIN Master controls communication in the LIN network; it does this by placing Message Headers with the specified identifiers on the LIN bus at the specified send times Send times and identifiers are defined by the LIN Schedule; the send times must be selected so that the transmission of the LIN messages is guaranteed t Frame_Max =1.4 t Frame_Nom t Sende_n+1 t Sende_n + t Frame_Max LIN Schedule t Sende_n Message Header (ID a) t Sende_n+1 Message Header (ID b) t Sende_n Message Header (ID a) Message Response t Sende_n+1 Message Header (ID b)... t Sende_n+2 Message Header (ID c) t Frame_Nom t Frame_Max =1.4 t Frame_Nom -11- In a LIN network the LIN Master controls communications. This involves the LIN Master transmitting very specific Message Headers at defined time points. The LIN Master takes both the send time and identifier from the so-called LIN Schedule. The send times in the LIN Schedule must be selected such that sufficient time is available for transmission of the LIN messages. 40 % additional time according to the nominal time must always be permitted for transmission of a LIN message.

Slide 12 Organization of the LIN Schedule The LIN Schedule is organized in Mini Slots (t Mini Slot =t Time-Base ) LIN Schedule (t Time-Base ) t n Mini Slot An adequate number of Mini Slots must be provided to guarantee transmission of a LIN message t n+1 : t n + t Time-Base t n+2 : t n+1 + 2 t Time-Base t n+3 : t n+2 + 3 t Time-Base... Mini Slot Mini Slot Mini Slot Frame Slot n Frame Slot n+1 Frame Slot n+2 t Frame Slot t Frame Slot t Frame Slot Mini Mini Mini Mini Mini Mini Mini Slot Slot Slot Slot Slot Slot Slot t n t n+1 t n+2 t n+3 t n+4 t n+5 t n+6 t n+7 t LIN Message a LIN Message b LIN Message c t Frame_max t Frame_max t Frame_max t Spare t Spare t Spare -12- The LIN Schedule is organized in Mini Slots. The length of these Mini Slots correspond to the underlying time base of the LIN Schedule (e.g. 5 msec), and it represents the smallest time resolution for processing the LIN Schedule. While sending a LIN message enough Mini Slots must be provided to guarantee transmission of the specific LIN message. The sum of the necessary Mini Slots is referred to as the Frame Slot.

Slide 13 Agenda Communication Principle Message Format Scheduling Message Types Data Assurance Miscellaneous -13-

Slide 14 Message Types Unconditional Frames (ID 0-59) One Message Response is assigned to the Message Header Message Header is always sent in the reserved frame slot Diagnostic Frames (ID 60-61) Master Request Frame (ID=60, ID=0x3C) Slave Response Frame (ID=61, ID=0x3D) Other Frames (ID 62-63) User-defined (ID=62, ID=0x3E) Future extensions (ID=63, ID=0x3F) -14- Various frame types are available for data transmission in a LIN network: Unconditional Frame, Event Triggered Frame, Sporadic Frame and Diagnostic Frame. The Unconditional Frame is characterized in that there is exactly one sender of the Message Response. The Event Triggered Frame is characterized in that there are multiple senders of the Message Response. Several unconditional frames from different LIN Slaves can be assigned to one event triggered frame. The first data byte of such an unconditional frame must contain the PID. The Message Response is only sent by the LIN Slave if a signal it contains has actually changed. Due to its event-orientation collisions are not excluded and must be resolved by the LIN master.

In a Sporadic Frame Slot different Unconditional Frames from different LIN Slaves can be transmitted. The Message Header in the Sporadic Frame Slot of an Unconditional Frame is sent by the LIN Master if it knows that a signal it contains may have changed. Two special LIN messages are used for diagnostics in a LIN network. The Master Request Frame with identifier ID=0x3C and the Slave Response Frame with identifier ID=0x3D. The identifiers 0x3D and 0x3F are reserved and not used in the actual specification.

Slide 15 Unconditional Frames Schedule LIN Slave 1 LIN Master LIN Slave 2 Unconditional Frame 1 ID = 0x11 Frame Slot 1 Response Header ID=0x11 Communication cycle Unconditional Frame 2 ID = 0x12 Unconditional Frame 3 ID = 0x13 Frame Slot 2 Frame Slot 3 Response Header ID=0x12 Header ID=0x13 Response Unconditional Frame 4 ID = 0x14 Frame Slot 4 Header ID=0x14 Response -15- A sufficiently large frame slot is provided for transmission of an Unconditional Frame. The Unconditional Frame belonging to a frame slot may be transmitted once or multiple times per communication cycle depending on the application. The frame slot must be large enough to be able to send the Message Header and the Message Response. There is exactly one sender for the Message Response. Due to message addressing the Message Response is available for every LIN Slave to receive. In the example four different Unconditional Frames are sent sequentially according to the entries in the Schedule. One frame slot is available for transmission of each Unconditional Frame. At the beginning of the frame slot the LIN Master sends the Message Header. The relevant LIN Slave sends the Message Response. Once all four frame slots have been processed, or all four Unconditional Frames have been transmitted, execution of the Schedule is repeated.

Slide 16 Diagnostic Frames Master Request Frame (ID=0x3C) Message Header and Message Response are sent by the LIN Master Used for: Diagnostic Request and Configuration Services Slave Response Frame (ID=0x3D) Message Header is sent by the LIN Master Message Response is sent by the relevant LIN Slave Used for: Diagnostic Response and Configuration Services Diagnostic Schedule LIN Slave 1 LIN Master LIN Slave 2 Master Request Frame ID = 0x3C Frame Slot 1 Header ID=0x3C Response Slave Response Frame ID = 0x3D Frame Slot 2 Response Header ID=0x3D -16- Diagnostic handling in a LIN network is performed with the help of two special LIN messages: Master Request Frame and Slave Response Frame. The Master Request Frame is characterized in that the LIN Master sends both the Message Header and the Message Response. The Message Header of the Master Request Frame is always sent with the identifier ID=0x3C. The Master Request Frame is used for the so-called Diagnostic Request. This may consist of several Master Request Frames. This is called a segmented Diagnostic Request. The Slave Response Frame is characterized in that the LIN Master sends the Message Header, and a LIN Slave sends the Message Response. The Message Header of the Slave Response Frame is always sent with the identifier ID=0x3D. The Slave Response Frame is used for the so-called Diagnostic Response. The Diagnostic Response may consist of several Slave Response Frames. In that case one speaks of a segmented Diagnostic Response.

The Diagnostic Schedule is used for diagnostics. It must contain two frame slots: One for the Master Request Frame, and one for the Slave Response Frame. The number of repeats depends on the diagnostic implementation itself. For a segmented Diagnostic Request the Slave Response Frame is suppressed, and for a segmented Diagnostic Response the Master Request Frame is suppressed.

Slide 17 Agenda Communication Principle Message Format Scheduling Message Types Data Assurance Miscellaneous -17-

Slide 18 Data Assurance Each LIN Slave monitors its operating state and creates a status report The status report is sent periodically to the LIN Master (LIN 2.0) Monitoring by error detection mechanisms Parity check Checksum LIN messages detected as corrupt are rejected Error handling is not part of the LIN specification Error handling must be defined separately -18- In a LIN network a LIN Slave has the task of monitoring its own operating state (since LIN 2.0). This involves the LIN Slave checking, with the help of parity and checksum checks, to determine whether the send and receive messages were transmitted correctly. The user is free to implement additional error detection mechanisms. It is conceivable that the user might want to implement a check to determine whether there is any bus activity at all, and if yes whether the expected Message Response is transmitted and whether it satisfies the defined time requirements. The results of monitoring are recorded in a status report. This is provided to the LIN Master. The LIN Master evaluates the status report. This entire process is also referred to as Status Management. LIN messages detected as incorrect are rejected by the LIN Slave. Important: Error handling is not part of the LIN specification and must be defined by the user. This generally takes into account the special constraints of the application area.

Slide 19 Agenda Communication Principle Message Format Scheduling Message Types Data Assurance Miscellaneous -19-

Slide 20 LIN Fact Sheet Data rates up to 20 KBit/sec UART interface Delegated Token Method Deterministic communication Message distribution (Broadcast) Short messages (max. 8 data bytes) Simple transmission checking (parity, checksum) Status Management Network Management -20-

Slide 21 LIN on the Internet Internet http://www.vector-informatik.com/ http://www.lin-subbus.org -21-