- A Comprehensible Guide to Local Interconnect Network (LIN)
A Comprehensible Guide to Local Interconnect Network (LIN)
The Local Interconnect Network (LIN) bus was introduced in the late 1990s to provide a standard for low-cost, low-end multiplexed communication in automotive networks. Though the Controller Area Network (CAN) bus covers the demand for high-bandwidth, advanced error-handling systems, the hardware and software costs of CAN Bus implementations have become prohibitive for lower performance devices such as power windows and seat controllers.
LIN Bus networks render cost-efficient communication in applications where the bandwidth and versatility of the CAN Bus technology are not required. LIN Bus applications are relatively inexpensive using the standard serial universal asynchronous receiver/transmitter (UART) technology, which are embedded into most modern low-cost microcontrollers.
Modern automotive networks utilize a mixture of LIN Bus for low-cost applications primarily in body electronics, CAN Bus for mainstream powertrain and body communications, and the FlexRay bus for high-speed synchronized data communications in advanced systems such as active suspension.
LIN Bus Features
- Low cost option (if speed/fault tolerance are not critical)
- Often used in vehicles for windows, wipers, air condition etc..
- LIN clusters consist of 1 master and up to 16 slave nodes
- Single wire (+ground) with 1-20 kbit/s at max 40 meter bus length
- Time triggered scheduling with guaranteed latency time
- Variable data length (2, 4, 8 bytes)
- LIN supports error detection, checksums & configuration
- Operating voltage of 12V
- Physical layer based on ISO 9141 (K-line)
- Sleep mode & wakeup support
- Most newer vehicles have 10+ LIN nodes
LIN Bus Applications
Most modern vehicles contain at least a dozen LIN nodes. They are used in applications where demand for data speed is not high and many operations are of digital nature. Common applications include:
- Power door locks
- Power windows
- Power seats
- Power mirrors
- Windshield wipers
- Seat heaters
- Heating and air-conditioning controls
- Interior lights
- Climate controls
- Steering-wheel controls (Cruise control, wiper, climate control, radio)
- Sun roof
Lin Bus vs. CAN Bus
- LIN is lower cost (less harness, no license fee, cheap nodes)
- CAN uses twisted shielded dual wires (5V), while LIN uses single wire (12V)
- A LIN master typically serves as gateway to the CAN bus
- LIN is deterministic, not event driven (i.e. no bus arbitration)
- LIN clusters have a single master - CAN Bus supports multi-master operation
- CAN uses 11 or 29 bit identifiers vs a 6 bit identifiers used by the LIN BUS
- CAN offers up to 1 Mbit/s vs. LIN at max 20 kbit/s
Further LIN Bus Resources
- LIN Protocol and Physical Layer Requirements (PDF)...
- LIN Specification Package - Revision 2.2A (PDF)...
LIN Bus Functionality
In general, LIN Bus is a relatively simple serial protocol. A single master node loops through each of the slave node, sending a request for information; each slave responds with data when polled. However, with each specification update, new features were added, thus increasing the protocol complexity.
The most widely implemented version is LIN 2.2A, but it was also standardized by the SAE as SAE J2602 and CiA (CAN-in-Automation) as ISO 17987:2016.
The following explains the LIN Bus data frames.
LIN Bus Message Frame
The LIN Bus message header consists of a break used to identify the start of the frame and the sync field used by the slave node for clock synchronization. The identifier (ID) consists of a 6-bit message ID and a 2-bit parity field. The ID denotes a specific message address but not the destination. Upon reception and interpretation of the ID, the polled slave begins the message response, which consists of one to eight bytes of data and an 8-bit checksum.
- Break: Every LIN frame begins with the Sync Break Field (SBF), which is at minimum 13+1 bits long but in practice often 18+2 bits. The SBF functions as a "start of frame" indicator to all nodes on the LIN bus.
- Sync: The 8-bit Sync filed is defined as the character 0x55 (binary 01010101), a structure that allows LIN nodes to measure the time between signal edges and consequently determine the master node's baud rate.
- Identifier: The ID field contains the actual 6-bit identifier followed by 2 parity bits. This provides identification for each message on the network and ultimately determines which nodes in the network receive or respond to the transmission. All slave tasks continuously listen for ID fields, check the parity, and decide whether they:
- Ignore the received data
- Listen to the data
- Transmit data in response to the header
The 6-bit ID allow for 64 IDs, of which ID 60-61 are used for diagnostics (more below) and 62-63 are reserved.
Typically, since only one slave at a time is polled for data, there is no risk of message collision and hence, no need for arbitration. The master controls the sequencing of message frames, which is defined in a schedule that can be changed as needed.
This is a work in progress and will be amended on a daily basis.