FIELDBUSES
LIN bus
A simple bus used in vehicle components and other embedded systems. Inspect a LIN frame on a time axis, calculate its PID and checksum, and test fault conditions.
Who communicates with whom?
One commander (formerly master) schedules communication and sends every header. Exactly one configured publisher supplies each response; the commander itself can also be that publisher. Other nodes can subscribe. The six-bit frame ID identifies a message as defined by the LDF, rather than simply identifying a physical node. LIN has no CAN arbitration and no separate ACK bit. Receiving a valid frame does not prove that an actuator physically executed a command.
Voltage and waveform
LIN uses one signal wire, plus a common reference and node power supplies. Recessive is high, towards the supply voltage; dominant is low, towards ground. The plot uses ideal 0 and 12 V levels. Actual levels, edges and thresholds depend on the transceiver. The maximum bit rate is 20 kbit/s. A header contains at least 13 dominant break bits, at least one recessive delimiter bit, sync 0x55 and a protected identifier (PID). UART bytes contain one start bit, eight data bits LSB-first and one stop bit.
Measuring with an oscilloscope
Measure the LIN wire relative to the appropriate reference with suitable equipment. Identify the long break, alternating sync bits, then PID, data and checksum. At 19,200 bit/s a bit lasts approximately 52.08 µs. The simulation shows the minimum nominal duration without extra spaces or analog edges. A stuck-low bus or a header without a response requires a different diagnosis from a checksum error.
The principle
The PID contains six identifier bits and two parity bits. P0 = ID0 XOR ID1 XOR ID2 XOR ID4; P1 = NOT(ID1 XOR ID3 XOR ID4 XOR ID5). A response contains 1–8 data bytes and a checksum. Classic includes only the data; enhanced includes the PID as well. Fold back each carry (subtract 255 when the sum exceeds 255), then invert the eight bits. Diagnostic IDs 0x3C and 0x3D always use classic. Reserved IDs 0x3E and 0x3F are not offered as ordinary frames here.
An example
For frame ID 0x12 and data 10 27, the PID is 0x92 and the enhanced checksum is 0x36. A minimum frame with two data bytes occupies 64 bit times: 3.2 ms at 20,000 bit/s. Use the fault selector to test checksum errors, PID parity errors, missing headers and missing responses. This example only draws frames.
Important
This is an educational signal simulation, not a LIN interface or vehicle diagnostic tool. The LDF and device documentation define publisher, length, meaning, schedule and checksum type. It cannot control a vehicle network. Sources: Microchip LIN data-link documentation and LIN 2.2A.