SDAA220A January   2026  – April 2026 MSPM0G3519

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction to LIN Protocol
    1. 1.1 Break Field
    2. 1.2 SYNC Byte Field
    3. 1.3 PID Field
    4. 1.4 Data
    5. 1.5 Checksum
  5. 2Initial Baud Rate Setting
  6. 3Realization of LIN Protocol MSPM0 UART/ UNICOMM UART
    1. 3.1 LIN Transmission
      1. 3.1.1 Break Field
      2. 3.1.2 Sync Field
      3. 3.1.3 PID Field
      4. 3.1.4 Data Field
      5. 3.1.5 Checksum
    2. 3.2 LIN Reception
      1. 3.2.1 Break Field Detection
      2. 3.2.2 SYNC Field Validation
    3. 3.3 LIN Transceiver
  7. 4Automatic Baud Rate Detection
    1. 4.1 Procedure to Measure Bit-width using MSPM0 UART / UNICOMM UART
    2. 4.2 Calculation of Correct Baud Rate
      1. 4.2.1 Crystal Error at Responder Node
  8. 5Deviation in Baud Rate after Synchronization
  9. 6References
  10. 7Revision History

Checksum

The LIN protocol implements an 8-bit error detection mechanism utilizing an inverted checksum calculation. The checksum computation incorporates sequential byte summation with carry management for values exceeding 0xFF, followed by one's complement operation on the final sum.

Two checksum methodologies are specified:

  1. Classic Checksum: Computation encompasses data bytes exclusively
  2. Enhanced Checksum: Computation encompasses Protected Identifier (PID) concatenated with data bytes

Checksum Algorithm:

  • Sequential byte accumulation
  • Carry addition for sums exceeding 0xFF
  • Result inversion (one's complement)

Implementation Example:

Protected Identifier: 0x0D

Data Field: [0xAB, 0xBC, 0xCD, 0xDE, 0xEF]

Enhanced Checksum Computation Sequence:

Step 1: 0x0D

Initial value = 0x0D

Step 2: Add 0xAB

0x0D + 0xAB = 0xB8

(No need to subtract 255 as sum < 256)

Step 3: Add 0xBC

0xB8 + 0xBC = 0x174

When sum ≥ 256 (0x100), subtract 255 (0xFF)

0x174 - 0xFF = 0x75

Step 4: Add 0xCD

0x75 + 0xCD = 0x142

When sum ≥ 256, subtract 255

0x142 - 0xFF = 0x43

Step 5: Add 0xDE

0x43 + 0xDE = 0x121

When sum ≥ 256, subtract 255

0x121 - 0xFF = 0x22

Step 6: Add 0xEF

0x22 + 0xEF = 0x111

When sum ≥ 256, subtract 255

0x111 - 0xFF = 0x12

Final Step: Invert the result

Checksum = 0xFF - 0x12 = 0xED

 Transmission of
                    Checksum Figure 3-4 Transmission of Checksum

The code section attached below demonstrates the process to calculate and send the LIN Checksum.

 Software Sequence to Transmit
                    Checksum Figure 3-5 Software Sequence to Transmit Checksum