Knowledge summary of LIN Bus development

Source: Internet
Author: User
Tags error handling time interval advantage

Knowledge summary of LIN Bus development

2018-1-23

1.LIN Bus Introduction

Lin Bus (Local interconnect Network) is inevitably used in the development of automotive electronics. As a can bus as a low-cost auxiliary bus, Lin bus in the body control of a wide range of applications, doors, windows, lights, as well as the use of Lin line lock. In fact, regardless of the cost of new energy-making vehicles, can use the can line more simple unified implementation of these functions, but limited to the car parts are too much, to be compatible with the traditional car control ECU suppliers. Perhaps one day Lin Line's price advantage no longer exists, the automaker has enough other such as can, ETH spare parts supply optional, Lin really want to gradually quit. But before this, it is necessary to summarize the main characteristics of Lin and the development process.

The main difference between Lin Line and can is three points.

One, single-line communication, low transmission rate. Lin Line is physically a pull-up to 12V collector open-drain bus, multiple nodes can be parallel to the same line, similar to the IIC SDA, but it does not have a separate clock line, by the communication between the two agreed baud rate to communicate, similar to the UART, but because of the UART, It is possible to synchronize the clocks by synchronizing the fields to make the transmission more reliable. This can be compared with a pair of differential twisted pair, its anti-jamming ability is greatly weakened, the communication rate can be up to 20Kbps, and can up to 1Mbps.

Second, the master-slave structure, centralized topology.

Lin line topology is a master-slave structure of the star model, all transmissions are master initiated, slave can not initiate the request. This is actually more similar to Modbus. You can also think of slave as the publisher of the message, master as the subscriber of the message, want to get a variable value, you need to constantly poll read the corresponding node of the message. This structure determines that the Lin line transmission of the message can not be too much, in order to ensure the real-time update of the message, usually a Lin line is defined on a message than a can line defined on a message less than an order of magnitude. Of course, if there is a problem with the central node, the whole network is dead.

Third, the more lightweight processing protocol stack.

In Automotive electronics development, can bus protocol stack occupies a considerable amount of code, including can drive layer, TP, NM, UDS, router, bootloader and so on, but Lin development will also be less than an order of magnitude, including the driver, scheduling table, simple sleep wake, simple TP, etc., The service on top of it is also to be transferred to a can signal.


2.LIN Bus Data frame format

The frame format of the Lin bus is shown in the figure above. If you are learning Lin protocol, using an oscilloscope to capture a frame of messages for analysis may be the best entry point. As you can see, a typical Lin data frame consists of header, header response, and response domain. Lin one frame of data can be transmitted 8bytes, it is interesting to note that lin2.x specifies that the number of Lin bytes can be transferred is 2,4,8 is not 1-8 any number. In general, the car will choose a uniform number of bytes, most commonly used for example, 8 bytes per frame.

The header field contains the Break,synch and the protected ID. In fact, break is to tell the bus to start, and then synchronize with synch always, and then use the protected ID to address, if there is a Lin slave node can provide the service of this ID, then after the master issued protected ID, he will insert a reply, Similar response to the IIC slave on SDA. It is worth noting that this protected ID is not slave from the machine address, but want to subscribe to the message ID, in other words, a slave can provide multiple message ID service, such as a lamp control ECU, can provide light control, status, fault code, Multiple Lin ID services such as software and hardware version information. The slave slave address is implicit and has a corresponding relationship with the message ID provided.

Unlike the CRC checksum of Can bus, Lin provides parity and checksum, parity of the protected ID in the header, and checksum checksum of data, with classic and enhanced distinction.


3.LIN bus Transfer scheduling

The master-slave structure of Lin Bus determines that the master node should periodically go to slave to read the data, and can also set a message. There are multiple slave nodes on a Lin bus, and each slave to publish multiple ID messages requires master to read sequentially or to set each ID message for each slave in the context of real-time rows. For each slave can provide what message, have LDF file Unified description, and can's DBC file is different. LDF file is all called Lin Configuration Description file, describes a Lin bus complete master-slave node information, as well as message format, scheduling information. According to the LDF file can get schedule tables, this dispatch table to master set the read slave node message ID time interval, such as 10ms,100ms. The dispatch table can be generated by the LDF file by a specialized build tool.


4.LIN Bus Diagnostics

In the entire automotive network, the most complex is the can diagnosis section, Lin diagnosis can be said to be just a supplement, Lin support using 0x3c (Master Request frame) and 0x3d (slave response frame) two messages to Lin Slave's diagnosis, its frame format (8 bytes data within the message) is as follows:


Where NAD is address of the slave node, indicating which ECU to diagnose; PCI is a protocol Control information, indicating what kind of diagnostic eco the message represents; The SID is the service Identifier, which indicates what services the message corresponds to, and the other is the data length and data fragmentation.

The diagnosis of Lin bus is consistent with the various services of can diagnosis, but does not need to support so many services, generally only need to support such as communication control, read did, read DTC and other services, a few can be firmware upgrade Lin ECU also need to support security access, program download, reset services.


5.LIN Bus Development content

(1) EE topology planning and the definition of LDF file;

(2) According to the LDF file by a specialized tool to generate schedule tables, as well as the signal layer;

(3) Development or integration of Lin driver, Lin TP;

(4) Develop related Lin Send and receive task, poll each node message;

(5) receive the upper control signal to set the slave, accept the change of the slave signal to the upper application;

(6) Treatment of the diagnostic part;

(7) Error handling;

(8) Lin Sleep and wake control.


6. Summary

        with the development of new Energy automotive electronics, and the establishment of next-generation OEMs and supplier systems, there are many different places to be seen. In particular, the Internet car-making mode, the new bus, the protocol will continue to evolve, Lin bus its cost advantage may become smaller, but in the emergence of alternative solutions is still the first choice of the car control bus solution.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.