CN118646614B - Method and circuit for preventing data transmission conflict in real time for LIN bus - Google Patents
Method and circuit for preventing data transmission conflict in real time for LIN bus Download PDFInfo
- Publication number
- CN118646614B CN118646614B CN202411124550.4A CN202411124550A CN118646614B CN 118646614 B CN118646614 B CN 118646614B CN 202411124550 A CN202411124550 A CN 202411124550A CN 118646614 B CN118646614 B CN 118646614B
- Authority
- CN
- China
- Prior art keywords
- signal
- time
- lin
- rising edge
- data transmission
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 27
- 238000000034 method Methods 0.000 title claims abstract description 23
- JLYXXMFPNIAWKQ-UHFFFAOYSA-N γ Benzene hexachloride Chemical compound ClC1C(Cl)C(Cl)C(Cl)C(Cl)C1Cl JLYXXMFPNIAWKQ-UHFFFAOYSA-N 0.000 title description 2
- 238000005070 sampling Methods 0.000 claims description 32
- 230000000630 rising effect Effects 0.000 claims description 27
- 230000002265 prevention Effects 0.000 claims 2
- 230000001105 regulatory effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/407—Bus networks with decentralised control
- H04L12/413—Bus networks with decentralised control with random access, e.g. carrier-sense multiple-access with collision detection [CSMA-CD]
- H04L12/4135—Bus networks with decentralised control with random access, e.g. carrier-sense multiple-access with collision detection [CSMA-CD] using bit-wise arbitration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
- H04L12/40013—Details regarding a bus controller
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/4013—Management of data rate on the bus
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40234—Local Interconnect Network LIN
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Quality & Reliability (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses a method and a circuit for preventing collision of data transmission in real time of a LIN bus, wherein a LIN processor sends a signal TX to the LIN bus through a TX end, a signal RX of the signal TX after passing through an analog circuit returns to the LIN processor from the RX end of the LIN processor, the signal TX sent by a LIN controller is regulated to enable the high level of the signal TX and the high level of the signal RX to be overlapped in a first time period, the low level of the signal TX and the low level of the signal RX to be overlapped in a second time period, the signal TX and the signal RX are sampled at time t0 and/or time t1, exclusive OR operation is carried out on sampled values, and if the result of the exclusive OR operation is 1, the LIN controller stops data transmission. The invention solves the problem that in the prior art, in the running process of a circuit of the LIN bus, the output of multiple devices in the circuit can cause level conflict to cause error of read data.
Description
Technical Field
The invention relates to a method and a circuit for preventing data collision, in particular to a method and a circuit for preventing data transmission collision of a LIN bus in real time, which belong to the technical field of semiconductor integrated circuits.
Background
LIN is an abbreviation of Local Interconnect Network, a low cost serial communication protocol based on UART/SCI (Universal Asynchronous Receiver-Transmitter/Serial Communication Interface, universal asynchronous receiver/serial communication interface). Can be used in various fields such as automobiles, household appliances, office equipment and the like. For example, the LIN bus is a message-based communication bus protocol that is often used in automobiles.
As shown in fig. 3, it is often the case that one master device is connected to two or more slave devices on the LIN bus. Because one device may send data while the other device is sending data, misjudgment of devices on the LIN bus is easily caused, and thus the LIN bus communication is failed.
Disclosure of Invention
The invention aims to solve the technical problem of providing a method and a circuit for preventing the collision of data transmission in real time for a LIN bus, and solves the problem of communication failure caused by the collision of multiple output levels of LIN bus devices in the prior art.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method for preventing data transmission conflict in real time of LIN bus comprises the following steps:
The method comprises the steps that S1, a LIN processor sends a signal TX to a LIN bus through a TX end, a signal RX of the signal TX after the signal TX passes through an analog circuit returns to the LIN processor from the RX end of the LIN processor, wherein in one signal period T, the rising edge time of the signal TX is T11, the falling edge time of the signal TX is T12, the rising edge time of the signal RX is T21, the falling edge time of the signal RX is T22, and a Delay is arranged between the signal TX and the signal RX, namely t21-t11=t22-t12=delay;
S2, adjusting a signal TX sent by the LIN controller, enabling the signal TX to overlap with the high level of the signal RX in a first time period, and enabling the signal TX to overlap with the low level of the signal RX in a second time period;
s3, sampling the signal TX and the signal RX at a time t0 and/or a time t1, wherein the time t0 is positioned in a first time period, and the time t1 is positioned in a second time period;
s4, performing exclusive OR operation on the sampled values, and stopping data transmission by the LIN controller if the exclusive OR operation result is 1.
Further, in the step S2, the signal TX transmitted by the LIN controller is adjusted, specifically, the baud rate or the duty cycle of the signal TX transmitted by the LIN controller is adjusted.
Further, in the step S2, the high level of the signal TX and the high level of the signal RX are overlapped in the first period, and the low level of the signal TX and the low level of the signal RX are overlapped in the second period, specifically, the rising edge time t21 of the signal RX is greater than the rising edge time t11 of the signal TX and less than the falling edge time t21 of the signal TX, and the falling edge time t22 of the signal RX is greater than the rising edge time t21 of the signal TX and less than the rising edge time t11' of the signal TX of the next period.
Further, in the step S3, the signal TX and/or the signal RX is sampled at a time t0 to obtain a first TX sampling value A1 and a first RX sampling value A2, the time t0 is greater than a rising edge time t21 of the signal RX and less than a falling edge time t12 of the signal TX, the signal TX and the signal RX are sampled at the time t1 to obtain a second TX sampling value B1 and a second RX sampling value B2, and the time t1 is greater than a falling edge time t22 of the signal RX and less than a rising edge time t11' of the signal TX in the next period.
Further, the time t0= (t 22-t 21)/2 and Delay < (t 22-t 21)/2, time t1= (t 21'-t 22)/2, where t21' is the rising edge time of the signal RX of the next cycle.
Further, in the step S4, specifically, the first TX sampling value A1 and the first RX sampling value A2 are subjected to an exclusive-or operation to obtain a first exclusive-or operation result Q1, if the first exclusive-or operation result Q1 is 1, the LIN controller stops data transmission, and the second TX sampling value B1 and the second RX sampling value B2 are subjected to an exclusive-or operation to obtain a second exclusive-or operation result Q2, and if the second exclusive-or operation result Q2 is 1, the LIN controller stops data transmission.
A LIN bus circuit capable of preventing data transmission collision in real time is used for realizing the method of preventing the data transmission collision of the LIN bus in real time, and comprises a data receiver, a data transmitter and a baud rate controller, wherein the baud rate controller is respectively connected with the data receiver and the data transmitter, the baud rate controller samples a signal RX received by the data receiver and calculates the baud rate to be adjusted, and then the baud rate to be adjusted is sent to the data transmitter so as to adjust the baud rate of the signal TX.
Compared with the prior art, the method and the circuit for preventing the LIN bus from data transmission conflict in real time have the advantages that the problem that in the operation process of a circuit of the LIN bus in the prior art, the read data is wrong due to level conflict caused by multi-device output in the circuit is solved, the method and the circuit are simple to realize, can judge whether the LIN bus data has conflict in one bit unit data, further immediately stop data transmission, interrupt the conflict, and are high in detection speed and efficiency and low in realization cost.
Drawings
Fig. 1 is a timing diagram of transmitting data and receiving data of a method for preventing collision of data transmission in real time for a LIN bus of the present invention.
Fig. 2 is a schematic diagram of a LIN bus circuit for preventing data transmission collisions in real time in accordance with the present invention.
Fig. 3 is a prior art LIN bus device connection schematic.
Detailed Description
In order to explain in detail the technical solutions adopted by the present invention to achieve the predetermined technical purposes, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, but not all embodiments, and that technical means or technical features in the embodiments of the present invention may be replaced without inventive effort, and the present invention will be described in detail below with reference to the accompanying drawings in combination with the embodiments.
As shown in fig. 1, the method for preventing the LIN bus from collision in real time according to the present invention comprises the following steps:
The method comprises the steps that S1, a LIN processor sends a signal TX to a LIN bus through a TX end, a signal RX after the signal TX passes through an analog circuit returns to the LIN processor from the LIN processor RX end, wherein in one signal period T, the rising edge time of the signal TX is T11, the falling edge time of the signal TX is T12, the rising edge time of the signal RX is T21, the falling edge time of the signal RX is T22, and a Delay is arranged between the signal TX and the signal RX, namely t21-t11=t22-t12=delay.
S2, adjusting the signal TX sent by the LIN controller, enabling the signal TX to overlap with the high level of the signal RX in a first time period, and enabling the signal TX to overlap with the low level of the signal RX in a second time period.
In step S2, the signal TX transmitted by the LIN controller is adjusted, in particular, the baud rate or the duty cycle of the signal TX transmitted by the LIN controller is adjusted.
In step S2, the high level of the signal TX and the high level of the signal RX are overlapped in the first period, and the low level of the signal TX and the low level of the signal RX are overlapped in the second period, specifically, the rising edge time t21 of the signal RX is greater than the rising edge time t11 of the signal TX and less than the falling edge time t21 of the signal TX, and the falling edge time t22 of the signal RX is greater than the rising edge time t21 of the signal TX and less than the rising edge time t11' of the signal TX of the next period.
S3, sampling the signal TX and the signal RX at a time t0 and/or a time t1, wherein the time t0 is in a first time period, and the time t1 is in a second time period.
In step S3, the signal TX and/or the signal RX is sampled at a time t0 to obtain a first TX sampling value A1 and a first RX sampling value A2, the time t0 is greater than a rising edge time t21 of the signal RX and less than a falling edge time t12 of the signal TX, the signal TX and the signal RX are sampled at the time t1 to obtain a second TX sampling value B1 and a second RX sampling value B2, and the time t1 is greater than a falling edge time t22 of the signal RX and less than a rising edge time t11' of the signal TX in the next period.
Preferably, time t0= (t 22-t 21)/2 and Delay < (t 22-t 21)/2, time t1= (t 21'-t 22)/2, where t21' is the rising edge time of the signal RX of the next cycle. In the prior art, the rest of sampling is mainly performed at the midpoint of the received signal, so the invention continues to seriously apply the sampling mode, and the original sampling circuit and the original sampling program can be directly applied, thereby reducing the difficulty of circuit design.
S4, performing exclusive OR operation on the sampled values, and stopping data transmission by the LIN controller if the exclusive OR operation result is 1.
In step S4, specifically, the first TX sampling value A1 and the first RX sampling value A2 are subjected to exclusive-or operation to obtain a first exclusive-or operation result Q1, if the first exclusive-or operation result Q1 is 1, the LIN controller stops data transmission, and the second TX sampling value B1 and the second RX sampling value B2 are subjected to exclusive-or operation to obtain a second exclusive-or operation result Q2, if the second exclusive-or operation result Q2 is 1, the LIN controller stops data transmission.
As shown in fig. 2, a LIN bus circuit for preventing data transmission collision in real time is used for implementing a method for preventing data transmission collision in real time of a LIN bus, and the LIN bus circuit comprises a data receiver, a data transmitter and a baud rate controller, wherein the baud rate controller is respectively connected with the data receiver and the data transmitter, and samples a signal RX received by the data receiver and calculates a baud rate to be adjusted, and then sends the baud rate to be adjusted to the data transmitter so as to adjust the baud rate of the signal TX.
The invention provides a method and a circuit for preventing data transmission conflict in real time of an LIN bus, which solve the problem of error of read data caused by level conflict due to multi-device output in the circuit in the operation process of the circuit of the LIN bus in the prior art.
The present invention is not limited to the preferred embodiments, and the present invention is described above in any way, but is not limited to the preferred embodiments, and any person skilled in the art will appreciate that the present invention is not limited to the embodiments described above, while the invention has been described with respect to specific examples including presently preferred modes of carrying out the invention, those skilled in the art will appreciate that there are numerous variations and permutations of the above described embodiments that fall within the spirit and scope of the invention as set forth in the appended claims.
Claims (4)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411124550.4A CN118646614B (en) | 2024-08-16 | 2024-08-16 | Method and circuit for preventing data transmission conflict in real time for LIN bus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411124550.4A CN118646614B (en) | 2024-08-16 | 2024-08-16 | Method and circuit for preventing data transmission conflict in real time for LIN bus |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN118646614A CN118646614A (en) | 2024-09-13 |
| CN118646614B true CN118646614B (en) | 2024-12-03 |
Family
ID=92669682
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202411124550.4A Active CN118646614B (en) | 2024-08-16 | 2024-08-16 | Method and circuit for preventing data transmission conflict in real time for LIN bus |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118646614B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119232533B (en) * | 2024-12-04 | 2025-05-16 | 江苏帝奥微电子股份有限公司 | LIN communication anti-interference method and circuit thereof |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102801573A (en) * | 2011-05-26 | 2012-11-28 | 上海固泰科技有限公司 | Method for testing local interconnect network (LIN) bus data link layer |
| CN102916716A (en) * | 2011-08-03 | 2013-02-06 | 株式会社电装 | Transceiver |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1342938A (en) * | 2000-09-11 | 2002-04-03 | 合肥创源智能网络有限责任公司 | Plug-and-play method for measuring-controlling module in RS-485 bus type measuring-controlling system and its measuring-controlling module |
| CN104184638B (en) * | 2014-09-15 | 2018-02-13 | 杭州万高科技股份有限公司 | The bus anti-collision methods of RS 485, interface chip and its communication network |
| CN105589828B (en) * | 2014-10-22 | 2018-11-30 | 炬芯(珠海)科技有限公司 | A kind of method and apparatus that high-speed interface data send and receive |
| JP7207991B2 (en) * | 2018-12-21 | 2023-01-18 | キヤノン株式会社 | Wireless communication system, wireless communication device, and wireless communication method |
| CN210609160U (en) * | 2019-11-22 | 2020-05-22 | 郑州祥和集团有限公司 | Power tunnel monitoring RS485 bus multi-host communication device |
| CN117608909B (en) * | 2024-01-22 | 2024-05-21 | 南京国兆光电科技有限公司 | MIPI data line conflict logic detection circuit |
-
2024
- 2024-08-16 CN CN202411124550.4A patent/CN118646614B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102801573A (en) * | 2011-05-26 | 2012-11-28 | 上海固泰科技有限公司 | Method for testing local interconnect network (LIN) bus data link layer |
| CN102916716A (en) * | 2011-08-03 | 2013-02-06 | 株式会社电装 | Transceiver |
Also Published As
| Publication number | Publication date |
|---|---|
| CN118646614A (en) | 2024-09-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0966128B1 (en) | Apparatus and method of determining a link status between network stations connected to a telephone line medium | |
| US4412326A (en) | Collision avoiding system, apparatus and protocol for a multiple access digital communications system including variable length packets | |
| EP0843414B1 (en) | Receiver | |
| US7170405B2 (en) | Method and apparatus for interfacing a power line carrier and an appliance | |
| US4539677A (en) | Multiple access data communication system | |
| CN118646614B (en) | Method and circuit for preventing data transmission conflict in real time for LIN bus | |
| CN103107870B (en) | Wireless network device and automatic parameter setting method thereof | |
| WO2011017997A1 (en) | Method and device for controlling communication bus | |
| WO2022021869A1 (en) | Single-level single-line full-duplex bus communication method and system | |
| EP4432091A1 (en) | Single signal debug port | |
| CN115022487A (en) | High-speed settling time adaptive circuit and data transmission method of mobile industry processor interface | |
| US20250086127A1 (en) | Variable Speed Data Transmission Between PHY Layer and MAC Layer | |
| CA2328256C (en) | Methods and apparatus for exchanging data | |
| CN114374579B (en) | RS485 bus competition type communication method | |
| CN109391250A (en) | A kind of synchronization system and synchronous method of modular multilevel pulsewidth modulation | |
| US20220103276A1 (en) | Robust link synchronization in ethernet networks | |
| US7245667B2 (en) | Method of transmitting data | |
| CN223067109U (en) | CAN interface circuit and bus equipment | |
| CN223260176U (en) | Signal shaping module, communication architecture and electronic equipment | |
| CN117595839A (en) | Delay clock circuit, signal transmission device and delay amount determination method | |
| JP2024130680A (en) | Communication Equipment | |
| TW202340900A (en) | Testing system and testing method | |
| JPS60145744A (en) | Two-line bidirectional burst transmission control system | |
| JP3565732B2 (en) | Network termination device | |
| Sun | A Half-duplex Synchronous Serial Fieldbus S^ sup 2^ CAN with Multi-host Structure |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |