title: Linbus
categories: [cheatsheets]
LIN Bus - Local Interconnect Network
- Version 1.0 was published 1999
- Used to connect ECU's
- Master-Slave Principle with up to 16 Slaves
- Transceiver is based on the UART protocol and LIN only has one cable
- Baud rate of about 20kBaud (as defined in the standard)
- Mostly 19.2kBaud are implemented in reality
- maximum of 40m cable
- Only the master is able to initiate connections
- Slaves can only answer to master-requests
- Master needs to init. the communication between two slaves
- Messages are send as in the scheduling table defined (in the master)
<-----[ Header ]-----> <-----[ Response ]----->
- Sync-Break - used for Frame Synchronisation
- Sync-Field - used for Bit Synchronisation (mostly 0x55)
- ID - Unique Identifier (6 bytes + 2 parity bytes)
- Datafield - contains data
- Checksum - modulo 256 checksum of the data-field
- Diagnostic Frames are send via Broadcast
- Event-Triggered Frames: Master asks for a Value, Slave only answers if the value changed.
-> If two slaves answer: Buscollision
-> Master requests the message with the higher priority first
- The checksum is calculated via a modulo 256 calculation
- The Carry-Bit is added to the LSB bit of the checksum
Data | Checksum
0x41 0x41
+ 0x55 0x9f
+ 0x93 0x132
0x33
0x12
The Checksum is 0x12 and gets appended to the data.