Baud rate adaptive updating method based on LIN protocol

By detecting and updating the baud rate in real time in the LIN protocol, the frame loss problem caused by the baud rate calculation lag in the existing technology is solved, the baud rate synchronization between the slave device and the master device is realized, and communication interruption is avoided.

CN118677716AActive Publication Date: 2024-09-20DIOO MICROCIRCUITS CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411147214.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-09-20
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

There is a lag in the baud rate update technology in the existing LIN protocol, which causes the slave device to be unable to detect the complete synchronization interval segment and synchronization segment, resulting in frame loss and communication interruption.

Method used

Using the baud rate adaptive update method based on the LIN protocol, by detecting the level changes of the frame start time, synchronization interval segment, frame interval segment and synchronization segment, the baud rate is calculated and updated in real time to ensure the waveform between the slave device and the master device. Rate synchronization.

Benefits of technology

It effectively avoids frame loss and communication interruption, realizes real-time detection of message frame headers and baud rate updates by the slave device, and synchronizes with the current baud rate of the master device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677716A
    Figure CN118677716A
Patent Text Reader

Abstract

The invention discloses a Baud rate adaptive updating method based on an LIN protocol, which comprises the following steps: confirming a frame starting moment, marking a detected low level starting from a first falling edge as a synchronization interval section A, judging whether the length T0 of the synchronization interval section A is greater than or equal to a synchronization interval section threshold value, if so, entering a step S2, otherwise, executing the step S1 again, and if not, entering a step S3; s2, determining the frame interval segment, judging whether the length of the frame interval segment B meets the requirement or not, if yes, entering the step S3, and if not, executing the step S1 again; confirming the first bit data of the synchronization segment; confirming second bit data of the synchronization segment; confirming each bit of data of the synchronization segment; and calculating the Baud rate length and updating the Baud rate. According to the invention, the message frame header received by the slave device can be detected in real time and the baud rate is updated, so that the message frame header is synchronized with the current baud rate of the master device, and the frame loss condition caused by the hysteresis of baud rate calculation in the prior art is effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a baud rate updating method, in particular to a baud rate adaptive updating method based on a LIN protocol, belonging to the technical field of communication. Background Art

[0002] LIN is the abbreviation of Local Interconnect Network. It is a low-cost serial communication protocol based on UART / SCI (Universal Asynchronous Receiver-Transmitter / Serial Communication Interface). It can be used in many fields such as automobiles, home appliances, and office equipment. For example, the LIN bus is a message-based communication bus protocol often used in automobiles. The LIN communication frame structure of the prior art is as follows: Figure 3 shown.

[0003] The current LIN baud rate update technology starts calculating after receiving the complete synchronization interval and synchronization segment time. When the master device uses the LIN protocol to send a message frame to the slave device, it may change the transmission baud rate at any time. If the master device switches the baud rate in the middle of sending a message frame, the slave device will not be able to detect the complete synchronization interval and synchronization segment, which will cause errors in the received data. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a baud rate adaptive updating method based on LIN protocol, so as to solve the problem of frame loss caused by hysteresis of baud rate detection in existing LIN communication, thereby interrupting communication.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: A baud rate adaptive updating method based on LIN protocol comprises the following steps: S1, confirm the frame start time; mark the low level starting from the first falling edge detected as the synchronization interval A, and determine whether the length T0 of the synchronization interval A is greater than or equal to the synchronization interval threshold. If so, proceed to step S2, otherwise re-execute step S1; S2, confirm the frame interval; the first high level mark after the synchronization interval A is the frame interval B, and determine whether the length of the frame interval B meets the requirements. If so, proceed to step S3, otherwise re-execute step S1; S3, confirm the first bit data of the synchronization segment; S4, confirm the second bit of data in the synchronization segment; S5, confirm each bit of data in the synchronization segment; in steps S3-S5, when any step does not meet the data judgment condition, if the data of the current bit is a high level or a rising edge, the previous low level adjacent to the rising edge or high level is considered as the synchronization interval segment and enters step S2; if the data of the current bit is a low level, the low level is considered as the synchronization interval segment and enters step S1.

[0006] S6. Calculate the baud rate length and update the baud rate.

[0007] Furthermore, the step S1 is specifically as follows: marking the low level starting from the first falling edge detected as the synchronization interval A, the length of the low level of the synchronization interval A is T0, and the data length of each bit of the synchronization interval is sampled by 16 times oversampling, then the synchronization interval threshold is 16*11, and judging whether the length T0 of the synchronization interval A is greater than or equal to the synchronization interval threshold 16*11, if so, entering step S2, otherwise re-executing step S1.

[0008] Furthermore, the step S2 is specifically as follows: the high level mark after the synchronization interval segment A is the frame interval segment B, the high level length of the frame interval segment B is T1, and it is determined whether the length T1 of the frame interval segment B is less than 1.5 times the length T0 of the synchronization interval segment A. If so, enter step S3, otherwise re-execute step S1.

[0009] Furthermore, the step S3 is specifically as follows: the low level after the frame interval segment B is marked as the first bit data C1 of the synchronization segment, and the length of the first bit data C1 of the synchronization segment is t1. It is determined whether the length t1 of the first bit data C1 of the synchronization segment, which is 8 times, is less than the length T0 of the synchronization interval segment A. If so, the process proceeds to step S4; otherwise, the first bit data C1 of the synchronization segment is marked as the synchronization interval segment A and the process proceeds to step S1.

[0010] Further, the step S4 is specifically as follows: the high level after the first bit data C1 of the synchronization segment is marked as the second bit data C2 of the synchronization segment, and the length of the second bit data C2 of the synchronization segment is t2. It is determined whether the length t2 of the second bit data C2 of the synchronization segment and the length t1 of the first bit data C1 of the synchronization segment satisfy t2>0.5*t1 and t2<1.5*t1. If so, proceed to step S5; otherwise, mark the first bit data C1 of the synchronization segment as the synchronization interval segment A and proceed to step S2.

[0011] Furthermore, the step S5 is specifically as follows: assuming that the synchronization segment has N bits of data, for the i-th bit of data, that is, the i-th bit of data in the synchronization segment, determine the i-th bit of data C in the synchronization segment. i The length t i and the i-1th bit data C of the synchronization segment i-1 The length t i-1Whether t is satisfied i >0.5*t i-1 And t i <1.5*t i-1 If it is satisfied, then go to step S6, otherwise determine the i-th bit data C of the synchronization segment i If the sync segment i bit data C i is low level, the i-th bit data C of the synchronization segment i Marked as synchronization interval segment A and enter step S1, if the i-th bit data C of the synchronization segment i is high, the i-1th bit data C of the synchronization segment i-1 Mark it as synchronization interval A and go to step S2.

[0012] Furthermore, the step S6 is specifically as follows: when the N-bit data of the synchronization segment are all detected and completed, the total length T2 of the synchronization segment data is calculated based on the N-bit data of the synchronization segment, then the baud rate F of the currently received frame structure is F=T2 / N, and the calculated baud rate F is updated to the baud rate of the transmitted signal to complete the baud rate update.

[0013] Compared with the prior art, the present invention has the following advantages and effects: the present invention provides a baud rate adaptive updating method based on the LIN protocol, which can detect the message frame header received by the slave device in real time and update the baud rate, thereby synchronizing with the current baud rate of the master device, thereby effectively avoiding the frame loss caused by the lag of the baud rate calculation in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 The invention discloses a flow chart of a baud rate adaptive updating method based on LIN protocol.

[0015] Figure 2 It is a schematic diagram of LIN bus frame header timing processing according to an embodiment of the present invention.

[0016] Figure 3 It is a schematic diagram of the LIN communication frame structure of the prior art. DETAILED DESCRIPTION

[0017] In order to elaborate on the technical scheme adopted by the present invention to achieve the predetermined technical purpose, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only partial embodiments of the present invention, rather than all embodiments, and the technical means or technical features in the embodiments of the present invention can be replaced without paying creative work. The present invention will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0018] like Figure 1As shown, a baud rate adaptive updating method based on LIN protocol of the present invention comprises the following steps: S1. Confirm the frame start time; mark the low level starting from the first falling edge detected as the synchronization interval A, and determine whether the length T0 of the synchronization interval A is greater than or equal to the synchronization interval threshold. If so, proceed to step S2, otherwise re-execute step S1.

[0019] Specifically, step S1 marks the low level starting from the first falling edge detected as the synchronization interval A. The length of the low level of the synchronization interval A is T0, and the data length of each bit of the synchronization interval is sampled by 16 times oversampling. The synchronization interval threshold is 16*11. It is determined whether the length T0 of the synchronization interval A is greater than or equal to the synchronization interval threshold 16*11. If so, enter step S2, otherwise re-execute step S1.

[0020] S2, confirm the frame interval; the first high level mark after the synchronization interval A is the frame interval B, and determine whether the length of the frame interval B meets the requirements. If so, proceed to step S3, otherwise re-execute step S1.

[0021] Specifically, step S2 is: the high level after the synchronization interval A is marked as the frame interval B, and the high level length of the frame interval B is T1. It is determined whether the length T1 of the frame interval B is less than 1.5 times the length T0 of the synchronization interval A. If so, enter step S3, otherwise re-execute step S1.

[0022] S3. Confirm the first bit of data in the synchronization segment.

[0023] Specifically, step S3 is: the low level after the frame interval segment B is marked as the first bit data C1 of the synchronization segment; the length of the first bit data C1 of the synchronization segment is t1; and it is determined whether the length t1 of the first bit data C1 of the synchronization segment, which is 8 times, is less than the length T0 of the synchronization interval segment A; if so, the process proceeds to step S4; otherwise, the first bit data C1 of the synchronization segment is marked as the synchronization interval segment A and the process proceeds to step S1.

[0024] S4. Confirm the second bit of data in the synchronization segment.

[0025] Specifically, step S4 is as follows: the high level after the first bit data C1 of the synchronization segment is marked as the second bit data C2 of the synchronization segment; the length of the second bit data C2 of the synchronization segment is t2; and it is determined whether the length t2 of the second bit data C2 of the synchronization segment and the length t1 of the first bit data C1 of the synchronization segment satisfy t2>0.5*t1 and t2<1.5*t1; if so, the process proceeds to step S5; otherwise, the first bit data C1 of the synchronization segment is marked as the synchronization interval segment A and the process proceeds to step S2.

[0026] S5. Confirm each bit of data in the synchronization segment.

[0027] Specifically, step S5 is as follows: assuming that the synchronization segment has N bits of data, for the i-th bit of data, that is, the i-th bit of data in the synchronization segment, determine the i-th bit of data C in the synchronization segment. i The length t i and the i-1th bit data C of the synchronization segment i-1 The length t i-1 Whether t is satisfied i >0.5*t i-1 And t i <1.5*t i-1 If it is satisfied, then go to step S6, otherwise determine the i-th bit data C of the synchronization segment i If the sync segment i bit data C i is low level, the i-th bit data C of the synchronization segment i Marked as synchronization interval segment A and enter step S1, if the i-th bit data C of the synchronization segment i is high, the i-1th bit data C of the synchronization segment i-1 Mark it as synchronization interval A and go to step S2.

[0028] S6. Calculate the baud rate length and update the baud rate.

[0029] Step S6 is specifically, when the N-bit data of the synchronization segment are all detected, the total length T2 of the synchronization segment data is calculated according to the N-bit data of the synchronization segment, then the baud rate F of the currently received frame structure is F=T2 / N, and the calculated baud rate F is updated to the baud rate of the transmitted signal to complete the baud rate update.

[0030] The present invention provides a baud rate adaptive updating method based on LIN protocol, which can detect the message frame header received by the slave device in real time and update the baud rate, so as to synchronize with the current baud rate of the master device, thereby effectively avoiding the frame loss caused by the lag of baud rate calculation in the prior art.

[0031] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement made to the above embodiments without departing from the content of the technical solution of the present invention, based on the technical essence of the present invention, within the spirit and principles of the present invention, still fall within the protection scope of the technical solution of the present invention.

Claims

1. A baud rate adaptive update method based on LIN protocol, Features The following steps are involved: S1. Confirm the frame start time; mark the low level starting from the first falling edge detected as the synchronization interval A, and determine the length T of the synchronization interval A. 0 Is it greater than or equal to the synchronization interval threshold? If so, proceed to step S2, otherwise, re-execute step S1; S2, confirm the frame interval; the first high level mark after the synchronization interval A is the frame interval B, and determine whether the length of the frame interval B meets the requirements. If so, proceed to step S3, otherwise re-execute step S1; S3, confirm the first bit data of the synchronization segment; S4, confirm the second bit of data in the synchronization segment; S5, confirm each bit of data in the synchronization segment; S6. Calculate the baud rate length and update the baud rate.

2. A baud rate adaptive updating method based on LIN protocol according to claim 1, Features: Specifically, step S1 is to mark the low level starting from the first falling edge detected as the synchronization interval A, and the length of the low level of the synchronization interval A is T. 0 , and the length of each bit of data in the synchronization interval is sampled by 16 times oversampling, then the threshold of the synchronization interval is 16*11, and the length T of the synchronization interval A is determined. 0 Is it greater than or equal to the synchronization interval threshold 16*11? If so, go to step S2, otherwise re-execute step S1.

3. A baud rate adaptive updating method based on LIN protocol according to claim 1, Features: Specifically, step S2 includes: the high level after the synchronization interval A is marked as a frame interval B, and the high level length of the frame interval B is T. 1 , determine the length T of the frame interval B 1 Is it less than 1.5 times the length T of the synchronization interval A? 0 If yes, go to step S3, otherwise re-execute step S1.

4. The baud rate adaptive updating method based on the LIN protocol according to claim 1, Features: Specifically, step S3 includes: marking the low level after the frame interval B as the first bit data C of the synchronization segment. 1 , the first bit data C of the synchronization segment 1 The length is t 1 , determine the first bit data C of the 8-fold synchronization segment 1 The length t 1 Is it less than the length T of the synchronization interval A? 0 If yes, then go to step S4, otherwise the first bit data C of the synchronization segment 1 Mark it as synchronization interval A and go to step S1.

5. A baud rate adaptive updating method based on LIN protocol according to claim 4, Features: The step S4 is specifically as follows: the first bit data C of the synchronization segment 1 The high level after that is marked as the second bit data C of the synchronization segment 2 , the second bit data C of the synchronization segment 2 The length is t 2 , determine the second bit data C of the synchronization segment 2 The length t 2 and the first bit of the synchronization segment C 1 The length t 1 Whether t is satisfied 2 >0.5*t 1 And t 2 <1.5*t 1 If it is satisfied, then go to step S5, otherwise the first bit data C of the synchronization segment 1 Mark it as synchronization interval A and go to step S2.

6. A baud rate adaptive updating method based on LIN protocol according to claim 5, Features: Specifically, step S5 is as follows: assuming that the synchronization segment has N bits of data, for the i-th bit of data, that is, the i-th bit of data in the synchronization segment, determine the i-th bit of data C in the synchronization segment. i The length t i and the i-1th bit data C of the synchronization segment i-1 The length t i-1 Whether t is satisfied i >0.5*t i-1 And t i <1.5*t i-1 If it is satisfied, then go to step S6, otherwise determine the i-th bit data C of the synchronization segment i If the sync segment i bit data C i is low level, the i-th bit data C of the synchronization segment i Marked as synchronization interval segment A and enter step S1, if the i-th bit data C of the synchronization segment i is high, the i-1th bit data C of the synchronization segment i-1 Mark it as synchronization interval A and go to step S2.

7. A baud rate adaptive updating method based on LIN protocol according to claim 6, Features: Specifically, step S6 is as follows: when the N-bit data of the synchronization segment are all detected and completed, the total length T2 of the synchronization segment data is calculated based on the N-bit data of the synchronization segment, then the baud rate F of the currently received frame structure is equal to T2 / N, and the calculated baud rate F is updated to the baud rate of the transmitted signal to complete the baud rate update.

Citation Information

Patent Citations

  • LIN bus decoding, triggering and analyzing technology

    CN106021165A

  • Baud rate updating method and device based on LIN protocol, equipment and medium

    CN114006688A

  • Bus communication method, communication system control method and communication system

    CN116866108A

  • Baud rate detection method and device based on LIN bus

    CN117201366A

  • Baud rate detecting device for serial communication, baud rate correcting device for serial communication, and baud rate detecting method for serial communication

    JP2011234128A