lin 1.3 - iteso

Upload: ynot666

Post on 03-Jun-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 LIN 1.3 - ITESO

    1/28

    Embedded NetworksLocal Interconnect Network

    LIN 1.3

    Abraham Tezmol

  • 8/12/2019 LIN 1.3 - ITESO

    2/28

    Abraham Tezmol, M.S.E.E

    2

    Embedded Networks

    Local InterconnectNetwork (LIN 1.3)

  • 8/12/2019 LIN 1.3 - ITESO

    3/28

    Abraham Tezmol, M.S. E.E.

    LINWhat is LIN?

    The LIN (Local Interconnect Network) is a serialcommunications protocol which efficiently supports the controlof mechatronic nodes in distributed automotive applications.

    The domain is class-A multiplex buses with a single masternode and a set of slave nodes

  • 8/12/2019 LIN 1.3 - ITESO

    4/28

    Abraham Tezmol, M.S. E.E.

    LINLIN Features

    The main properties of the LIN bus are:

    1. Single-master / multiple-slave concept

    2. Low cost silicon implementation based on commonUART/SCI interface

    3. Hardware, an equivalent in software, or as pure statemachine.

    4. Self synchronization without quartz or ceramics resonatorin the slave nodes

    5. Deterministic signal transmission6. Low cost single-wire implementation

    7. Speed up to 20kbit/s

  • 8/12/2019 LIN 1.3 - ITESO

    5/28

    Abraham Tezmol, M.S. E.E.

    LINWhy LIN?

    Low Cost (Almost $1 per node)

    Half the price of CAN

    Baud Rate much slower than CAN networks.

    Self synchronization in the slave nodes without crystal or ceramics

    resonator

    Mainly used for lower demanding applications such as side view mirrors,seats, sensors, actuators, etc.

    Cuts on development costs.

    Implementation based on common UART/SCI interface hardware

  • 8/12/2019 LIN 1.3 - ITESO

    6/28

    Abraham Tezmol, M.S. E.E.

    LINLIN Versions

    1.2 , 1.3 , 2.0 and the new 2.1

    Most Products are developed using LIN version 1.3 because its ease of

    use and simplicity. Nowadays, LIN 2.0 is becoming more accepted amongAutomotive developers.

    2.0 or 2.1 versions are recommended for new designs.

    1.3 slaves will works in 2.0 systems, but won't work from 2.0 slaves to 1.3systems.

  • 8/12/2019 LIN 1.3 - ITESO

    7/28

    Abraham Tezmol, M.S. E.E.

    LINLIN and the OSI Model

  • 8/12/2019 LIN 1.3 - ITESO

    8/28

    Abraham Tezmol, M.S. E.E.

    LINApplications

    The LIN protocol was suggested in 1999 as a low cost sub-bus system to complementCAN in applications such as:

    Vehicle Roof (Rain Sensor, Light Sensor, Light Control, Sun Roof)

    Vehicle Doors (Mirror, Central Locking, Mirror Switch, Window Lift)

    Engine (Sensors, Small Motors, Steering Wheel, Cruise Control Switches, Wiper,Turn

    Signal, Radio, Climate Control)

    Seat (Seat Position Motors, Seat heater, Occupancy Sensor)

  • 8/12/2019 LIN 1.3 - ITESO

    9/28

    Abraham Tezmol, M.S. E.E.

    LIN

    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 themaster.

    The node serving as a master can be slave, too!

    Master / Slave Protocol

  • 8/12/2019 LIN 1.3 - ITESO

    10/28

    Abraham Tezmol, M.S. E.E.

    LINCommunication Concept

  • 8/12/2019 LIN 1.3 - ITESO

    11/28

    Abraham Tezmol, M.S. E.E.

    LINInformation Routing

    In LIN systems a node does not make use of any information about the systemconfiguration, except for the denomination of the single master node.

    System Flexibility: Nodes can be added to the LIN network without requiringhardware or software changes in other slave nodes.

    Message routing: The content of a message is named by an IDENTIFIER.

    The IDENTIFIER does not indicate the destination of the message, butdescribes the meaning of the data. The maximum number of identifier is 64,out of which 4 are reserved for special communication purposes such assoftware upgrades or diagnostics.

    Multicast: As a consequence of the Message Filtering any number of nodes

    can simultaneously receive and act upon messages.

  • 8/12/2019 LIN 1.3 - ITESO

    12/28

    Abraham Tezmol, M.S. E.E.

    LINBit Rate

    The maximum bit rate is 20kbit/s, given by the EMI limitation of the single wiretransmission medium. The minimum bit rate is 1kbit/s to avoid conflicts with thepractical implementation of time-out periods.

    In order to allow implementation of low cost LIN devices, the use of followingbit-rates is recommended

    Slow Medium Fast

    2400 bits/sec 9600 bits/sec 19200 bits/sec

  • 8/12/2019 LIN 1.3 - ITESO

    13/28

    Abraham Tezmol, M.S. E.E.

    LINMaster / Slave Protocol

    Master

    Has control over the whole Bus and Protocol

    The master controls which message at what time is to be transferred overthe bus. It also does the error handling.To accomplish this the master

    Sends Sync Break

    Sends Sync Byte

    Sends ID-Field

    Monitors Data Bytes and Check Byte, and evaluates them onconsistence

    Receives WakeUp Break from slave nodes when the bus is inactiveand they request some action.

    Serves as a reference with its clock base (stable clock necessary)

  • 8/12/2019 LIN 1.3 - ITESO

    14/28

    Abraham Tezmol, M.S. E.E.

    LINMaster/Slave Protocol

    Slave

    Is one of 2-16 Members on the Bus and receives or transmits Data whenan 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!

  • 8/12/2019 LIN 1.3 - ITESO

    15/28

    Abraham Tezmol, M.S. E.E.

    LINLIN Message Frame

    0 to 8 data fields checksum

    message response

    synch break

    13 bit

    synch field identifier

    message header

    byte field

    SCI / UART format

    start stop

    0 1 2 3 4 5 6 7

    LSB

  • 8/12/2019 LIN 1.3 - ITESO

    16/28

    Abraham Tezmol, M.S. E.E.

    LINMessage Frame - Header

    Synch Break:

    In order to identify clearly a beginning of a message frame its first field is asynchronization break (SYNCH BREAK). A SYNCH BREAK FIELD isalways sent by the master task.

  • 8/12/2019 LIN 1.3 - ITESO

    17/28

    Abraham Tezmol, M.S. E.E.

    LINMessage Frame - Header

    Synch Byte:

    Specific Pattern for Determination of Time Base(Determination of the time between two rising edges)

    A Synch Byte precedes any Message Frame

  • 8/12/2019 LIN 1.3 - ITESO

    18/28

    Abraham Tezmol, M.S. E.E.

    LINMessage Frame - Header

    ID-Field:

    Message Identifier: Incorporates Information about the sender, thereceiver(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 the2 LSB of the ID-Field. Each class has 16 Identifiers. A total of 64 MessageIdentifiers are possible.

    2 Parity Bits protect this highly sensitive ID-Field.

  • 8/12/2019 LIN 1.3 - ITESO

    19/28

    Abraham Tezmol, M.S. E.E.

    LINMessage Frame - Header

    2 Parity Bits protect this highly sensitive ID-Field.

    The identifiers 0x3C, 0x3D, 0x3E, and 0x3F with their respectiveIDENTIFIER FIELDS 0x3C, 0x7D, 0xFE, and 0xBF (all 8-byte messages)are reserved for command frames(e.g. sleep mode) and extended frames

  • 8/12/2019 LIN 1.3 - ITESO

    20/28

    Abraham Tezmol, M.S. E.E.

    LINResponse Fields Data Field

    The DATA FIELD consists of a BYTE FIELD containing eight bits of datato be transferred by a MESSAGE FRAME. The transmission happens LSBfirst.

  • 8/12/2019 LIN 1.3 - ITESO

    21/28

    Abraham Tezmol, M.S. E.E.

    LINResponse Fields Checksum

    The CHECKSUM FIELD contains the inverted modulo-256 sum over alldata bytes

    The sum is calculated by ADD with Carry where the carry bit of each

    addition is added to the LSB of its resulting sum. This guarantees security

    also for the MSBs of the data bytes.

  • 8/12/2019 LIN 1.3 - ITESO

    22/28

    Abraham Tezmol, M.S. E.E.

    LINIdentifier

    The identifier field is sent by the master node to all LIN nodesThis identifier normally contains one of 64 different values andincludes 2 parity bits in the 8 bit data

    The identifier is normally associated with a collection of signals thatare subsequently transmitted on the LIN bus

    In a specific case this can initiate SLEEP mode in the LIN slavenodesin this case no further data is transmitted on the LIN bus

    synch break13 bit

    synch field identifier

    message header

  • 8/12/2019 LIN 1.3 - ITESO

    23/28

    Abraham Tezmol, M.S. E.E.

    LINLIN Message Frame

    0 to 8 data fields checksum

    message response

    synch break

    13 bit

    synch field identifier

    message header

    byte field

    SCI / UART format

    start stop

    0 1 2 3 4 5 6 7

    LSB

  • 8/12/2019 LIN 1.3 - ITESO

    24/28

    Abraham Tezmol, M.S. E.E.

    LINLIN Message Frame

    0 to 8 data fields checksum

    message response

    synch break

    13 bit

    synch field identifier

    message header

    Synchronisation

    frame

    Synchronisation field

    Identifier byte

    Message

  • 8/12/2019 LIN 1.3 - ITESO

    25/28

    Abraham Tezmol, M.S. E.E.

    LINPhysical Layer - Connections

    The maximum number of nodes in a LIN network is not only limited by thenumber of but also by the physical properties of the bus line:

    Recommendation:

    - The number of nodes in a LIN network should not exceed 16. Otherwisethe reduced network impedance may prohibit a fault free communicationunder worst case conditions. Every additional node lowers the networkimpedance by approximately 3% (30 k || ~1 k).

    - The accumulated galvanicwire length in a network is less or equal 40 m.

    - The bus termination resistance is typically 1k for the master node and30k for the slave nodes.

  • 8/12/2019 LIN 1.3 - ITESO

    26/28

    Abraham Tezmol, M.S. E.E.

    LINPhysical Layer

    The Physical Layer is a single line, wired-AND bus with pull-up resistors inevery node, being supplied from the vehicle power net (VBAT).

    A diode in series with the pull-up resistor prevents the electronic control unit(ECU) from being powered by the bus in case of a local loss of battery

  • 8/12/2019 LIN 1.3 - ITESO

    27/28

    Abraham Tezmol, M.S. E.E.

    LINBus Values

    The bus can have two complementary logical values: dominantor recessive.

    The correspondence with bit and voltage values are given in the following table:

  • 8/12/2019 LIN 1.3 - ITESO

    28/28

    Abraham Tezmol, M.S. E.E.

    LINError and Exception Handling

    Types of Errors

    Bit-Error

    Check-sum error

    Identifier-Parity-Error

    Slave-Not-Responding-Error

    Inconsistent-Synch-Field-Error

    Physical-Bus-Error