Ch1 Seminar/IP

LIN overview (3) Schedule table - 1

베린이 2023. 10. 16. 18:48
반응형

LIN은 overload를 막기 위해 schedule tabe을 통해 모든 통신을 진행합니다.
 

- Time base

한 Frame에는 Header와 Response가 있고 최대 8-byte 통신이 가능하다고 했습니다. 한 Frame 통신당 걸리는 시간이 정해져 있는데, time base를 기반으로 정해집니다.
 

 
한 Frame이 진행되는 시간은 time base의 n배이고, 통상적으로 time base는 5ms 또는 10ms입니다. 그러니까 LIN이 굉~~장히 느리다는 거죠.
 
이전에 LIN protocol overview에서 PID를 통해 모든 통신을 정의한다고 했는데요, LDF 파일을 통해 모든 통신이 사전에 정의됩니다.
2023.10.04 - [Ch1 Seminar/IP] - LIN overview (1) Protocol

LIN overview (1) Protocol

오늘날의 자동차는 단순히 이동 수단이 아니라 여러 가지 기능이 있습니다. 이를 구현하기 위해서 자동차에는 내부 통신 규격이 필요한데요, 대표적으로 CAN과 LIN이 있습니다. 이 글에서는 LIN에

veriln-e.tistory.com

 
이 LDF파일을 기반으로 api를 짜고 이를 통해 LIN controller를 제어하는 겁니다.
 

출처: microchipdeveloper

 

- LDF format

<LIN_description_file> ::=
	LIN_description_file ;
	<LIN_protocol_version_def>
	<LIN_language_version_def>
	<LIN_speed_def>
	(<Channel_name_def>)
	<Node_def>
	(<Node_composition_def>)
	<Signal_def>
	(<Diag_signal_def>)
	<Frame_def>
	(<Sporadic_frame_def>)
	(<Event_triggered_frame_def>)
	(<Diag_frame_def>)
	<Node_attributes_def>
	<Schedule_table_def>
	(<Signal_groups_def>)
	(<Signal_encoding_type_def>)
	(<Signal_representation_def>)

기본적으로 LIN protocol 버전과 Node 정보, signal과 Frame, 마지막으로 실제 통신이 진행되는 순서인 Schedule table로 구성됩니다.
 

1.  Global definition

<LIN_protocol_version_def> ::=
    LIN_protocol_version = char_string ;
<LIN_language_version_def> ::=
    LIN_language_version = char_string ;
<LIN_speed_def> ::=
    LIN_speed = real_or_integer kbps ;
<Channel_name_def> ::= 
    Channel_name = identifier ;

Global definition에서는 LIN 버전과 통신속도, 그리고 채널 이름을 정합니다.
 

Global definition 예시

 

2. Node definition

다음으로 Node를 정의하는데요, 여기서 통신에 참여하는 Master와 Slave들이 정해집니다.

<node_def> ::=
    Nodes {
        Master: <node_name>, <time_base> ms, <jitter> ms ;
        Slaves: <node_name>([, <node_name>]) ;
    }

 

Node def 예시

 
위의 예시에는 Master가 CEM이고 Slave로 LSM/RSM 두 개를 사용하네요. Time base가 5ms이므로 한 Frame 당 5,10,15,20...ms가 걸릴 것으로 예상됩니다.
 

<node_attributes_def> ::=
    Node_attributes {
        [<node_name> {
            LIN_protocol = <protocol_version> ;
            configured_NAD = <diag_address> ;
            (initial_NAD = <diag_address> ;)
            <attributes_def> ;
        }]
    }
    
<attributes_def> ::=
    product_id = <supplier_id>, <function_id> (, <variant>) ;
    response_error = <signal_name> ;
    (fault_state_signals = <signal_name>([, <signal_name>]) ;)
    (P2_min = real_or_interger ms ;)
    (ST_min = real_or_interger ms ;)
    (N_As_timeout = real_or_integer ms ;)
    (N_Cr_timeout = real_or_integer ms ;)
    <configurable_frames_20_def> | <configurable_frames_21_def>

Node attribute를 통해 상세한 정보를 기술합니다. 특히, product_id는 Diagnostic frame(PID: 0x3C or 0x3D)에 필요합니다.
 

Node attribute definition 예시

 

'Ch1 Seminar > IP' 카테고리의 다른 글

LIN overview (4) LIN 검증  (0) 2023.12.08
LIN overview (3) Schedule table - 2  (0) 2023.10.30
LIN overview (2) Sleep, Wake up  (0) 2023.10.11
LIN overview (1) Protocol  (0) 2023.10.04
UART 통신 overview  (0) 2023.07.26