SLAAEK9 February   2025 MSPM0C1103 , MSPM0C1103-Q1 , MSPM0C1104 , MSPM0C1104-Q1 , MSPM0C1105 , MSPM0C1106 , MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G1518 , MSPM0G1519 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1 , MSPM0G3518 , MSPM0G3518-Q1 , MSPM0G3519 , MSPM0G3519-Q1 , MSPM0H3216 , MSPM0L1105 , MSPM0L1106 , MSPM0L1117 , MSPM0L1227 , MSPM0L1227-Q1 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346 , MSPM0L2227 , MSPM0L2228 , MSPM0L2228-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2How MSPM0 Support LIN Function
    1. 2.1 Clock
    2. 2.2 LIN Hardware
    3. 2.3 LIN Demo Code in SDK
      1. 2.3.1 LIN Commander
      2. 2.3.2 LIN Responder
  6. 3LIN Communication Realization
    1. 3.1 Hardware Connection
    2. 3.2 Test Results
      1. 3.2.1 Commander
      2. 3.2.2 Responder
  7. 4Summary
  8. 5References

LIN Responder

The main function of LIN commander demo code is to receive command from commander and execute the corresponding instructions. In this demo code, responder does not clock sync up but uses self-clock and only checks whether the sync byte is correct. Also, there is no timeout error detection.

Figure 2-2 shows the flow process of LIN responder demo code.

 LIN Responder Demo Code Flow
                    Process Figure 2-2 LIN Responder Demo Code Flow Process

In this demo code, a state machine is used to help receive command and give response, as shown in Figure 2-3. When an interrupt occurs, there are state flags to decide what is the next non-executed state and jump into.

 LIN Responder Demo Code State
                    Machine Figure 2-3 LIN Responder Demo Code State Machine

In this demo code, LIN hardware is initialized through Sysconfig. Besides pin configuration, interrupt and basic register needs to be set. LIN counter is used to detect and verify the break field. Also, Sync field is realized by the count and interrupt function of LINC0,LINC1. For detailed seeting, please refer to the .syscfg file in code example.

Table 2-4 is a summary for the LIN responder project, which includes the main used definitions and functions.

Table 2-4 LIN Responder Project Main Content
Name Task Description Location
LIN_RESPONDER_SYNC_CYCLES definition 5. The number of cycles in a sync validation lin_config.h
LIN_MESSAGE_NOT_FOUND definition 0xFF. UART LIN value for the message not found lin_config.h
LIN_SYNC_BYTE definition 0x55. UART LIN value for the sync byte lin_config.h
LIN_RESPONSE_LAPSE definition Number of delay cycles between PID STOP bit and data transmission START bit lin_config.h
SYSCFG_DL_init() function Initialize the peripherals, generated by Sysconfig ti_msp_dl_config.c
DL_UART_Extend_getLINCounterValue(UART_Regs *uart) function Get the LIN counter value dl_uart.c
DL_UART_Extend_getLINRisingEdgeCaptureValue(UART_Regs *uart) function Get the LINC1 counter value dl_uart.c
DL_UART_Extend_getLINFallingEdgeCaptureValue(UART_Regs *uart) function Get the LINC0 counter value dl_uart.c
DL_UART_Extend_receiveData(UART_Regs *uart) function Reads data from the RX FIFO dl_uart.c

setLINResponderRXMessage(UART_Regs *uart, uint8_t data, volatile LIN_STATE *gStateMachine)

function LIN give corresponding action lin_responder.c