Automatic baud rate detection circuit and detection method

By designing an anti-interference automatic baud rate detection circuit and method in LIN bus communication, the problem of misjudgment of automatic baud rate detection in multi-node cascade or severe electromagnetic interference environment is solved, and the effect of enhancing the robustness of the detection circuit is achieved.

CN111181815BActive Publication Date: 2025-03-07SUZHOU NOVOSENSE MICROELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010167862.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-11
Publication Date
2025-03-07
Estimated Expiration
2040-03-11

AI Technical Summary

Technical Problem

In multi-node cascade or severe electromagnetic interference environment, the automatic baud rate detection of the LIN bus is prone to misjudgment due to interference, resulting in errors in baud rate calculation, affecting the normal recovery of communication.

Method used

An anti-interference automatic baud rate detection circuit and method is designed to obtain LIN data frames, synchronous interval field detection and synchronous field automatic baud rate detection. If the detection is successful, the temporary baud rate will be calculated and stored. If the identifier field detection is abnormal, the temporary baud rate will be discarded and re-detected.

Benefits of technology

By discarding the temporary baud rate in time and re-adopting the preset baud rate, irreversible communication abnormalities caused by using the wrong baud rate are avoided, and the robustness of the detection circuit is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111181815B_ABST
    Figure CN111181815B_ABST
Patent Text Reader

Abstract

The present invention provides an automatic baud rate detection circuit and a detection method thereof, the detection method comprising: obtaining a LIN data frame; performing a synchronization interval field detection on the LIN data frame according to a preset baud rate; performing a synchronization field automatic baud rate detection according to an agreed data mode; if the detection is successful, calculating and storing a temporary baud rate; performing an identifier field detection on the LIN data frame according to the temporary baud rate; if the identifier field detection result is abnormal, discarding the temporary baud rate, and re-performing a synchronization interval field detection on the LIN data frame according to the preset baud rate. When the circuit system is disturbed, resulting in a misjudgment of the automatic baud rate calculation or an abnormality in the identifier field detection, the temporary baud rate is discarded in time and the preset baud rate is re-adopted, thereby preventing irreversible communication abnormalities caused by using the wrong baud rate in the subsequent communication process, thereby enhancing the robustness of the detection circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of LIN bus communication, in particular to an anti-interference type automatic baud rate detection circuit and a detection method based on a LIN bus. Background Art

[0002] In the prior art, the following steps are required to perform automatic baud rate detection in LIN bus communication: first, the receiving controller completes the detection of the synchronization interval field according to the preset baud rate, and then performs automatic baud rate detection of the synchronization field, and detects and calculates to obtain the precise baud rate. The precise baud rate replaces the preset baud rate and enters the baud rate generator, thereby completing the detection of the identifier field based on the updated precise baud rate. If the detection passes, the control of the LIN bus will be officially switched to the sending controller, and the sending controller will send the response data, realizing the complete receiving and sending process of a LIN data frame.

[0003] In the above process, after the automatic baud rate detection of the synchronization field is completed, the preset baud rate is replaced by the calculated accurate baud rate. In the case of general master-slave single-point communication, since all the data in the receiving buffer are controlled by the LIN master node that initiates the communication, the baud rate information is true and reliable. However, in a multi-node cascade or a more severe communication environment, such as the electromagnetic interference environment in which automotive electronics is located, the synchronization field data is no longer uniquely constrained by the master node due to the possibility of various interferences being coupled to the LIN bus. These interferences can easily cause misjudgment of the automatic baud rate detection, and the baud rate generator will irreversibly generate an incorrectly calculated baud rate, and the communication cannot be restored to normal even if the interference is eliminated.

[0004] Therefore, in order to solve the above problems, a new anti-interference automatic baud rate detection circuit and detection method based on LIN bus must be designed. Summary of the invention

[0005] To solve one of the above problems, the present invention provides an automatic baud rate detection method, the detection method comprising:

[0006] Get LIN data frame;

[0007] Perform synchronization interval field detection on LIN data frame according to preset baud rate;

[0008] Perform automatic baud rate detection of the synchronization field according to the agreed data mode;

[0009] If the detection is successful, the temporary baud rate is calculated and stored;

[0010] Perform identifier field detection on the LIN data frame according to the temporary baud rate;

[0011] If the result of the identifier field detection is abnormal, the temporary baud rate is discarded and the synchronization interval field detection is performed on the LIN data frame again according to the preset baud rate.

[0012] As a further improvement of the present invention, the step of "performing automatic baud rate detection of synchronization field according to the agreed data mode" includes:

[0013] Perform falling edge detection on the synchronization field of the LIN data frame and obtain the number of falling edges;

[0014] The step "successful detection" includes: the number of falling edges meets the agreed data pattern.

[0015] As a further improvement of the present invention, the step of "performing falling edge detection on the synchronization field of the LIN data frame and obtaining the number of falling edges" includes:

[0016] Preset duration threshold;

[0017] Perform falling edge detection on the synchronization field of the LIN data frame and obtain the number of falling edges, and perform timing to obtain the timing result;

[0018] The step of “the number of falling edges satisfies the agreed data pattern” includes: the number of falling edges satisfies the agreed data pattern, and the timing result is less than the duration threshold.

[0019] As a further improvement of the present invention, the step of "detecting the identifier field of the LIN data frame according to the temporary baud rate" further includes:

[0020] If the identifier field detection result is normal, the response data is sent according to the temporary baud rate.

[0021] As a further improvement of the present invention, the step of "sending response data according to the temporary baud rate" includes:

[0022] The response data is compared with the real-time read-back LIN data frame. If they are consistent, the temporary baud rate will overwrite the preset baud rate and store it as the permanent baud rate. If they are inconsistent, the LIN data frame will be re-detected for the synchronization interval field according to the preset baud rate.

[0023] To solve one of the above problems, the present invention further provides an automatic baud rate detection circuit, the automatic baud rate detection circuit comprising:

[0024] LIN receiver;

[0025] A synchronization interval field detection module connected to the output end of the LIN receiver;

[0026] A synchronization field automatic baud rate detection module is connected to the synchronization interval field detection module and the output end of the LIN receiver;

[0027] A baud rate calculation module is connected to the output end of the synchronization field automatic baud rate detection module;

[0028] A temporary baud rate register connected to the output end of the baud rate calculation module;

[0029] The identifier field detection module is connected to the temporary baud rate register and the output of the LIN receiver.

[0030] As a further improvement of the present invention, the synchronous field automatic baud rate detection module includes: a falling edge detection counting module, the output end of the falling edge detection counting module is connected to the input end of the baud rate calculation module, its input end is connected to the output end of the LIN receiver, and its reset end is connected to the output end of the synchronous interval field detection module.

[0031] As a further improvement of the present invention, the synchronous field automatic baud rate detection module also includes: a synchronous field timer and a first comparator; the output end of the synchronous field timer is connected to the input end of the baud rate calculation module and the first input end of the first comparator, and the reset end of the synchronous field timer is connected to the output end of the synchronous interval field detection module; the second input end of the first comparator is used to input a duration threshold, and the output end is connected to the reset end of the baud rate calculation module.

[0032] As a further improvement of the present invention, the automatic baud rate detection circuit also includes a response data generation module, a response data sending module and a LIN transmitter connected in sequence; the input end of the response data sending module is also connected to the output end of the temporary baud rate register, and its reset end is connected to the output end of the identifier field detection module.

[0033] As a further improvement of the present invention, the automatic baud rate detection circuit also includes a second comparator, a permanent baud rate register, and a preset baud rate module, the input end of the permanent baud rate register is connected to the output end of the temporary baud rate register and the output end of the preset baud rate module, and its output end is connected to the input end of the synchronization interval field detection module.

[0034] The first input end of the second comparator is connected to the output end of the response data sending module, the second input end is connected to the output end of the LIN receiver; and the output end is connected to the input end of the permanent baud rate register.

[0035] Compared with the prior art, the present invention first generates and stores a temporary baud rate, and when the identifier field detection is abnormal, the temporary baud rate can be discarded, and the synchronous interval field detection is performed again according to the preset baud rate. When the circuit system is disturbed, resulting in a misjudgment of the automatic baud rate calculation or abnormal identifier field detection, the temporary baud rate is discarded in time and the preset baud rate is re-adopted, so that the wrong baud rate is used in the subsequent communication process to prevent irreversible communication abnormality, thereby enhancing the robustness of the detection circuit. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 Schematic diagram of the process of automatic baud rate detection method of the present invention;

[0037] Figure 2 It is a structural schematic diagram of the automatic baud rate detection circuit of the present invention. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions 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 part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0039] like Figure 1 As shown, the present invention provides an automatic baud rate detection method, the detection method comprising:

[0040] Acquire LIN data frame; perform synchronization interval field detection on LIN data frame according to preset baud rate;

[0041] Perform automatic baud rate detection of the synchronization field according to the agreed data mode;

[0042] If the detection is successful, the temporary baud rate is calculated and stored;

[0043] Perform identifier field detection on the LIN data frame according to the temporary baud rate;

[0044] If the result of the identifier field detection is abnormal, the temporary baud rate is discarded and the synchronization interval field detection is performed on the LIN data frame again according to the preset baud rate.

[0045] Therefore, in the present invention, a temporary baud rate is first generated and stored, and when the identifier field detection is abnormal, the temporary baud rate can be discarded, and the synchronous interval field detection is performed again according to the preset baud rate. When the circuit system is disturbed, resulting in a misjudgment of the automatic baud rate calculation or abnormal identifier field detection, the temporary baud rate is discarded in time and the preset baud rate is re-adopted, so that the wrong baud rate is used in the subsequent communication process to prevent irreversible communication abnormality, thereby enhancing the robustness of the detection circuit.

[0046] Further, the step of "performing automatic baud rate detection of the synchronization field according to the agreed data mode" includes:

[0047] Perform falling edge detection on the synchronization field of the LIN data frame and obtain the number of falling edges;

[0048] The step "successful detection" includes: the number of falling edges meets the agreed data pattern.

[0049] It is known that a LIN data frame includes data in the receiving stage and the sending stage. The receiving stage includes the synchronization interval field, the synchronization field and the identifier field, and the sending stage includes the response data. Among them, the synchronization field in the receiving stage has an agreed data mode for realizing automatic baud rate detection. The agreed data mode has one byte, which is 0x55. 0x55 is hexadecimal, and the corresponding binary is 01010101. Therefore, the falling edge detection is usually performed on the data in the synchronization field to determine whether the synchronization field is correct. If the falling edges of the synchronization field are all detected and counted, it means that the detection is successful.

[0050] Further, in the present invention, the step of "performing falling edge detection on the synchronization field of the LIN data frame and obtaining the number of falling edges" includes:

[0051] Preset duration threshold;

[0052] Perform falling edge detection on the synchronization field of the LIN data frame and obtain the number of falling edges, and perform timing to obtain the timing result;

[0053] The step of “the number of falling edges satisfies the agreed data pattern” includes: the number of falling edges satisfies the agreed data pattern, and the timing result is less than the duration threshold.

[0054] That is, in addition to detecting the number of falling edges in the present invention, it is also necessary to time the falling edge detection process and compare the timing results. Therefore, the detection circuit in the present invention is provided with a synchronous field timer 32. If the detection circuit encounters interference, resulting in the missing of the falling edge of the synchronous field, then after setting the falling edge detection and timing in the present invention, if the falling edge does not appear for a long time, the synchronous field timer 32 may fall into a busy state. Therefore, a first comparator 33 is also provided in the present invention to compare the timing result of the synchronous field timer 32 with the duration threshold, and only when the number of falling edges meets the agreed data mode and the timing result is less than the duration threshold, can further calculation and storage of the temporary baud rate be performed. If the falling edge is missing due to interference, and the falling edge detection is not completed until the timing result reaches the duration threshold, the current process is directly suspended, and the synchronous interval field detection is performed on the LIN data frame again according to the preset baud rate.

[0055] The step of "detecting the identifier field of the LIN data frame according to the temporary baud rate" also includes:

[0056] If the identifier field detection result is normal, the response data is sent according to the temporary baud rate.

[0057] After the automatic baud rate detection of the synchronization field, the temporary baud rate is calculated and stored, and the identifier field detection of the LIN data frame is performed according to the temporary baud rate. If the identifier field detection is normal, it means that the received part of the LIN data frame is correct, and the control of the LIN bus is switched to the response data sending module 62. The response data sending module 62 loads the response data into the sending buffer 82 and the LIN transmitter 81, thereby realizing the complete receiving and sending process of a LIN data frame.

[0058] Further, in the present invention, the step of "sending response data according to the temporary baud rate" includes:

[0059] The response data is compared with the real-time read-back LIN data frame. If they are consistent, the temporary baud rate will overwrite the preset baud rate and store it as the permanent baud rate. If they are inconsistent, the LIN data frame will be re-detected for the synchronization interval field according to the preset baud rate.

[0060] That is, in the present invention, a second comparator 74 is also provided to read back the response data and the LIN data frame to determine whether they are consistent. If they are consistent, it means that the circuit system is not affected by the interference introduced by the multi-node cascade, and the temporary baud rate can be stored as the permanent baud rate. Thus, the correctness and stability of the temporary baud rate can be further determined to prevent the wrong baud rate from being stored as the permanent baud rate. On the other hand, if the response data is inconsistent with the original LIN data frame after the read-back check, the temporary baud rate is discarded, and the LIN data frame is re-detected for the synchronization interval field according to the preset baud rate. Figure 2 As shown, the present invention also provides an automatic baud rate detection circuit, the automatic baud rate detection circuit comprising:

[0061] LIN receiver 11;

[0062] A synchronization interval field detection module 21 is connected to the output end of the LIN receiver 11;

[0063] A synchronization field automatic baud rate detection module connected to the synchronization interval field detection module 21 and the output end of the LIN receiver 11;

[0064] The baud rate calculation module 41 is connected to the output end of the synchronization field automatic baud rate detection module;

[0065] A temporary baud rate register 42 is connected to the output end of the baud rate calculation module 41;

[0066] The identifier field detection module 51 is connected to the temporary baud rate register 42 and the output end of the LIN receiver 11 .

[0067] Then, corresponding to the above detection method, the detection circuit in the present invention is provided with a temporary baud rate register 42, which can be used to store the temporary baud rate calculated by the baud rate calculation module 41. Moreover, the temporary baud rate is not permanent, and when the detection result of the identifier field detection module 51 is abnormal, the temporary baud rate is abandoned.

[0068] Of course, if Figure 2 As shown in the figure, the automatic baud rate detection circuit in the present invention includes a LIN bus 9, the LIN bus 9 sends a LIN data frame, and the LIN receiver 11 receives the LIN data frame. In fact, the automatic baud rate detection circuit also includes a receiving buffer 12, and the LIN receiver 11 loads the LIN data frame into the receiving buffer 12. In fact, the synchronization interval field detection module 21 is connected to the LIN receiver 11 through the receiving buffer 12, the synchronization field automatic baud rate detection module is connected to the LIN receiver 11 through the receiving buffer 12, and the identifier field detection module 51 is connected to the LIN receiver 11 through the receiving buffer 12.

[0069] Therefore, the synchronization interval field detection module 21, the synchronization field automatic baud rate detection module, and the identifier field detection module 51 are all indirectly connected to the output end of the LIN receiver 11, so the synchronization interval field, the synchronization field, and the identifier field in a LIN data frame received by the LIN receiver 11 can be detected respectively.

[0070] The synchronous field automatic baud rate detection module includes: a falling edge detection counting module 31, the output end of the falling edge detection counting module 31 is connected to the input end of the baud rate calculation module 41, the input end of the falling edge detection counting module 31 is connected to the output end of the LIN receiver 11, and the reset end of the falling edge detection counting module 31 is connected to the output end of the synchronous interval field detection module 21. Figure 2 As shown, the falling edge detection and counting module 31 is connected to the LIN receiver 11 via the receiving buffer 12 .

[0071] Corresponding to the above detection method, the falling edge detection and counting module 31 is used to detect the falling edge of the synchronization field, and its reset end is connected to the synchronization interval field detection module 21, that is, after the detection of the synchronization interval field detection module 21 is completed, the falling edge detection and counting module 31 can perform falling edge detection and counting.

[0072] Furthermore, as described above, the synchronous field automatic baud rate detection module also includes: a synchronous field timer 32 and a first comparator 33; the output end of the synchronous field timer 32 is connected to the input end of the baud rate calculation module 41 and the first input end of the first comparator 33, and the reset end of the synchronous field timer 32 is connected to the output end of the synchronous interval field detection module 21; the second input end of the first comparator 33 is used to input a duration threshold, and the output end is connected to the reset end of the baud rate calculation module 41.

[0073] The synchronous field timer 32 is used to time the counting process of the falling edge detection and counting module and form a timing result. The first comparator 33 is used to compare the timing result with the duration threshold. By adding the first comparator 33, the synchronous field automatic baud rate detection process can be protected from timeout. If the interference causes the falling edge of the synchronous field to be missing, the timing result of the synchronous field timer 32 will inevitably time out. Since the first comparator 33 is connected to the reset end of the baud rate calculation module 41, the first comparator 33 can reset the baud rate calculation module 41 in time to prevent the synchronous field timer 32 from falling into busy waiting. In addition, the first comparator 33 can reset the baud rate calculation module 41, so that the synchronous interval field detection of the LIN data frame can be performed again according to the preset baud rate.

[0074] like Figure 2As shown, the automatic baud rate detection circuit further includes a response data generation module 61, a response data sending module 62 and a LIN transmitter 81 which are connected in sequence; the input end of the response data sending module 62 is also connected to the output end of the temporary baud rate register 42, and the reset end thereof is connected to the output end of the identifier field detection module 51. If the detection result of the identifier field detection module 51 is normal, the response data sending module 62 is adjusted to a sendable state, the response data generation module 61 generates response data and loads it into the response data sending module 62, and the response data sending module 62 then sends the response data to the LIN transmitter 81 to realize the sending of the response data; on the other hand, the response data sending module 62 obtains the temporary baud rate from the temporary baud rate register 42, and sends the response data at the temporary baud rate.

[0075] Of course, in the present invention, the automatic baud rate detection circuit further includes a sending buffer 82 , and the sending buffer 82 is connected between the LIN transmitter 81 and the response data sending module 62 .

[0076] Furthermore, the automatic baud rate detection circuit also includes a second comparator 74, a permanent baud rate register 71, and a preset baud rate module 72, wherein the input end of the permanent baud rate register 71 is connected to the output end of the temporary baud rate register 42 and the output end of the preset baud rate module 72, and its output end is connected to the input end of the synchronization interval field detection module 21.

[0077] The first input terminal of the second comparator 74 is connected to the output terminal of the response data sending module 62 , the second input terminal thereof is connected to the output terminal of the LIN receiver 11 ; and the output terminal thereof is connected to the input terminal of the permanent baud rate register 71 .

[0078] like Figure 2 As shown in the figure, specifically, the response data sent from the response data sending module 62 is sent to the first input terminal of the second comparator 74 on the one hand; on the other hand, it is also sent to the LIN transmitter 81, and then circulated to the LIN receiver 11 according to the LIN bus 9. Therefore, the second comparator 74 can determine whether there is other interference data in the LIN bus by comparing the response data with the LIN data frame of the read-back check.

[0079] The interference introduced by the multi-node cascade connection may cause bus contention conflicts during data transmission. The second comparator 74 can detect the occurrence of conflicts in time to prevent the wrong baud rate calculation results from being stored in the permanent baud rate register 71.

[0080] After the above steps, the sending, receiving and checking of a LIN data frame is completed. When the LIN bus receives a new LIN data frame task, it will send and receive the LIN data frame again.

[0081] The preset baud rate module 72 outputs the preset baud rate and inputs it into the permanent baud rate register 71. When the synchronous interval field detection is performed at the beginning, the preset baud rate is input to the synchronous interval field detection module 21 through the permanent baud rate register 71, so that the synchronous interval field detection module 21 performs the synchronous interval field detection on the LIN data frame according to the preset baud rate. Only when the detection result of the second comparator 74 is that the response data is consistent with the LIN data frame, the temporary baud rate in the temporary baud rate register 42 can overwrite the original preset baud rate in the permanent baud rate register 71 and be stored in the permanent baud rate register 71.

[0082] Furthermore, the detection circuit in the present invention actually further includes a selector 73 , the output end of the selector 73 is connected to the input end of the permanent baud rate register 71 , and the temporary baud rate register 42 and the second comparator 74 are both connected to the permanent baud rate register 71 through the selector 73 .

[0083] Specifically, the negative input terminal of the selector 73 is connected to the output terminal of the permanent baud rate register 71, the positive input terminal is connected to the output terminal of the temporary baud rate register 42, and the control terminal is connected to the output terminal of the second comparator 74. When the output result of the second comparator 74 is that the response data is consistent with the LIN data frame, the selector 73 selects the positive input terminal for input, and the temporary baud rate register 42 outputs the temporary baud rate to cover the preset baud rate and store it in the permanent baud rate register 71; when the output result of the second comparator 74 is that the response data is inconsistent with the LIN data frame, the selector 73 still selects the negative input terminal for input, and the preset baud rate is still stored in the permanent baud rate register 71, and the temporary baud rate in the temporary baud rate register 42 can be discarded and the synchronization interval field detection can be performed again.

[0084] In addition, the output end of the permanent baud rate register 71 is connected to the second input end of the first comparator 33 through the multiplier 34. Since the preset baud rate is still stored in the permanent baud rate register 71 during the above-mentioned synchronization field automatic baud rate detection process, the duration threshold can be obtained by calculating the original preset baud rate.

[0085] In summary, the present invention provides an automatic baud rate detection circuit and a detection method. First, the automatic baud rate detection circuit of the present invention is provided with a temporary baud rate register 42, and the temporary baud rate is stored in the temporary baud rate register 42. When the identifier field detection is abnormal, the temporary baud rate can be discarded, and the synchronization interval field detection is performed again according to the preset baud rate. When the circuit system is disturbed, resulting in a misjudgment of the calculation of the automatic baud rate or an abnormality in the identifier field detection, the temporary baud rate is discarded in time and the preset baud rate is re-adopted, so that the irreversible communication abnormality caused by using the wrong baud rate in the subsequent communication process will not be caused, thereby enhancing the robustness of the detection circuit.

[0086] Secondly, the detection circuit is also provided with a first comparator 33 for detecting the timing result and the duration threshold of the synchronization field timer 32 during the automatic baud rate detection process of the synchronization field. If interference causes the missing falling edge of the synchronization field, the first comparator 33 can prevent the synchronization field timer 32 from falling into a busy state, and can perform timeout protection on the detection process, reset the baud rate calculation module 41 in time, and enhance the anti-interference ability of the entire detection circuit.

[0087] In addition, the detection circuit is also provided with a second comparator 74, which is used to cooperate with the selector 73. Only when the response data is consistent with the LIN data frame read back in real time by the LIN receiver 11, the temporary baud rate in the temporary baud rate register 42 is selected to be stored in the permanent baud rate register 71 to prevent the erroneous baud rate calculation result from being latched; and the bus contention conflict caused by the interference introduced by the multi-node cascade in the response data sending process can be detected in time, which also further enhances the anti-interference ability of the entire detection circuit.

[0088] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation mode may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

[0089] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. All equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.

Claims

1. An automatic baud rate detection method, characterized in that: The detection method comprises: Get LIN data frame; Perform synchronization interval field detection on LIN data frame according to preset baud rate; Perform automatic baud rate detection of the synchronization field according to the agreed data mode, wherein the agreed data mode is 0x55; If the automatic baud rate detection of the synchronization field is successful, a temporary baud rate is calculated and stored; the temporary baud rate represents the baud rate in the synchronization field; Perform identifier field detection on the LIN data frame according to the temporary baud rate; If the result of the identifier field detection is abnormal, the temporary baud rate is discarded, and the synchronization interval field detection is performed on the LIN data frame again according to the preset baud rate; The steps for performing automatic baud rate detection of the synchronization field according to the agreed data mode include: Perform falling edge detection on the synchronization field of the LIN data frame and obtain the number of falling edges; The success of the automatic baud rate detection of the synchronization field includes: the number of falling edges meets the agreed data mode.

2. The automatic baud rate detection method according to claim 1, characterized in that: The steps of detecting the falling edge of the synchronization field of the LIN data frame and obtaining the number of falling edges include: Preset duration threshold; Perform falling edge detection on the synchronization field of the LIN data frame and obtain the number of falling edges, and simultaneously time the falling edge detection process to obtain a timing result; The step of the number of falling edges satisfying the agreed data pattern includes: the number of falling edges satisfies the agreed data pattern, and the timing result is less than a duration threshold.

3. The automatic baud rate detection method according to claim 1, characterized in that: The step further includes: after detecting the identifier field of the LIN data frame according to the temporary baud rate: If the identifier field detection result is normal, the response data is sent according to the temporary baud rate.

4. The automatic baud rate detection method according to claim 3, characterized in that: The steps after sending the response data according to the temporary baud rate include: The response data is compared with the real-time read-back LIN data frame. If they are consistent, the temporary baud rate will overwrite the preset baud rate and store it as the permanent baud rate. If they are inconsistent, the LIN data frame will be re-detected for the synchronization interval field according to the preset baud rate.

5. An automatic baud rate detection circuit, characterized in that: The automatic baud rate detection circuit comprises: LIN receiver, used to obtain LIN data frames; A synchronization interval field detection module is connected to the output end of the LIN receiver, and the synchronization interval field detection module is used to perform synchronization interval field detection on the LIN data frame according to a preset baud rate; A synchronous field automatic baud rate detection module is connected to the synchronous interval field detection module and the output end of the LIN receiver, and the synchronous field automatic baud rate detection module is used to perform synchronous field automatic baud rate detection according to an agreed data mode, and the agreed data mode is 0x55; A baud rate calculation module is connected to the output end of the synchronization field automatic baud rate detection module, and the baud rate calculation module is configured to calculate and store a temporary baud rate if the synchronization field automatic baud rate detection is successful; the temporary baud rate represents the baud rate in the synchronization field; A temporary baud rate register connected to the output end of the baud rate calculation module; an identifier field detection module connected to the temporary baud rate register and the output end of the LIN receiver, the identifier field detection module being used to perform identifier field detection on the LIN data frame according to the temporary baud rate, and being configured to discard the temporary baud rate if the identifier field detection result is abnormal; The synchronous field automatic baud rate detection module comprises: a falling edge detection and counting module, the output end of the falling edge detection and counting module is connected to the input end of the baud rate calculation module, the input end is connected to the output end of the LIN receiver, and the reset end is connected to the output end of the synchronous interval field detection module; the falling edge detection and counting module is used to count the number of falling edges in the synchronous field; The success of the automatic baud rate detection of the synchronization field includes: the number of falling edges meets the agreed data mode.

6. The automatic baud rate detection circuit according to claim 5, characterized in that: The synchronous field automatic baud rate detection module also includes: a synchronous field timer and a first comparator; the output end of the synchronous field timer is connected to the input end of the baud rate calculation module and the first input end of the first comparator, and the reset end of the synchronous field timer is connected to the output end of the synchronous interval field detection module; the second input end of the first comparator is used to input the duration threshold, and the output end is connected to the reset end of the baud rate calculation module; The synchronous field timer is used to time the falling edge detection process to obtain a timing result; The first comparator is used to compare the timing result with the duration threshold. If the timing result is greater than the duration threshold, the first comparator outputs a signal to reset the baud rate calculation module.

7. The automatic baud rate detection circuit according to claim 5, characterized in that: The automatic baud rate detection circuit also includes a response data generation module, a response data sending module and a LIN transmitter connected in sequence; the input end of the response data sending module is also connected to the output end of the temporary baud rate register, and its reset end is connected to the output end of the identifier field detection module; Among them, if the identifier field detection result is normal, the response data generation module generates response data and transmits it to the response data sending module, the response data sending module obtains the temporary baud rate from the temporary baud rate register, and sends the response data to the LIN transmitter at the temporary baud rate, and the LIN transmitter sends the response data.

8. The automatic baud rate detection circuit according to claim 7, characterized in that: The automatic baud rate detection circuit also includes a second comparator, a permanent baud rate register and a preset baud rate module, wherein the input end of the permanent baud rate register is connected to the output end of the temporary baud rate register and the output end of the preset baud rate module, and the output end thereof is connected to the input end of the synchronization interval field detection module; The first input terminal of the second comparator is connected to the output terminal of the response data sending module, and the second input terminal thereof is connected to the output terminal of the LIN receiver; Its output is connected to the input of the permanent baud rate register; The preset baud rate module is used to store the preset baud rate; The permanent baud rate register is used to store the preset baud rate in the preset baud rate module; The second comparator is used to compare the response data with the LIN data frame checked by reading back to determine whether there is interference data in the LIN bus; When the detection result of the second comparator is that the response data is consistent with the LIN data frame, the temporary baud rate in the temporary baud rate register overwrites the preset baud rate in the permanent baud rate register and is stored in the permanent baud rate register.

Citation Information

Patent Citations

  • Synchronization signal detection apparatus

    CN102170347A

  • Method for controlling the transmission speed on a LIN bus

    EP1760952A1