Two-in-one communication method and system based on integrated service digital network and USART (Universal Synchronous Asynchronous Receiver Transmitter)
By analyzing the device signal characteristics in the device interface circuit and controlling the transmission circuit according to the baud rate, two-in-one communication between first-line and USART is realized, which solves the problems of complex communication mode switching and high resource occupation in the prior art, and improves data compatibility and communication stability.
Patent Information
- Application Number
- CN202510280333.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-03-11
AI Technical Summary
In the prior art, the communication mode switching between first-line communication and USART is complex, with high resource usage, poor data compatibility, low communication stability, and lack of balanced control of communication rate and stability.
When the device signal receiving circuit of the device interface circuit is connected to the device signal of the communication device, the control device signal sending circuit is disconnected, and the device signal is obtained, the signal characteristics are analyzed to determine whether it is a one-line signal or a USART signal, and the transmission circuit is turned on according to the signal baud rate to transmit a signal with a specific baud rate.
It realizes two-in-one communication between first-line communication and USART, simplifies communication mode switching, reduces resource usage, improves data compatibility and communication stability, and achieves balanced control of communication rate and stability.
Smart Images

Figure CN119788763A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a composite communication method and system combining a Single-wire Interface (SIF) and a Universal Synchronous / Asynchronous Receiver / Transmitter (USART). Background Art
[0002] The One-Line protocol achieves communication between devices through a single line, and has the advantages of low hardware resource consumption and low cost, but its communication rate is low, and it usually adopts a simplex communication mode, which is suitable for scenarios with small data volume and low requirements for communication quality. USART is a hardware interface widely used in serial communication, which supports full-duplex communication and has the characteristics of high data transmission rate and flexible configuration. However, USART requires two data lines (TX and RX) for communication, and the hardware resource consumption is relatively large. In the prior art, One-Line and USART are separate communication methods with separate hardware. These methods often have shortcomings such as low communication efficiency, complex switching mechanism, high resource occupation or compatibility issues.
[0003] In summary, the existing communication technologies of One-Line and USART have technical problems such as complex communication mode switching, high resource occupation, poor data compatibility, low communication stability, and lack of balanced control of communication rate and stability. Summary of the invention
[0004] In view of the deficiencies in the above-mentioned prior art, the present invention provides a two-in-one communication method and system based on one-line communication and USART to realize two-in-one communication of one-line communication and USART, so that communication mode switching is simple, resource occupation is reduced, data compatibility is improved, communication stability is improved, and communication rate and stability are balanced.
[0005] In a first aspect, the present invention provides a two-in-one communication method based on a one-line communication and a USART, comprising: When the device signal receiving circuit of the device interface circuit is connected to the device signal of the communication device, the device signal sending circuit of the device interface circuit is controlled to be disconnected, and the device signal connected to the device signal receiving circuit is obtained, and after the device signal is obtained, the signal feature of the device signal is analyzed to determine whether the obtained device signal is a one-line signal or a USART signal; After obtaining that the device signal is a one-line signal, determining the signal baud rate of the one-line signal, and after obtaining the specific signal baud rate of the one-line signal, controlling the device signal sending circuit of the device interface circuit to be turned on, and sending the one-line signal with the specific signal baud rate to the communication device; After obtaining that the device signal is a USART signal, the signal baud rate of the USART signal is determined, and after obtaining the specific signal baud rate of the USART signal, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the USART signal with the specific signal baud rate is sent to the communication device.
[0006] In a second aspect, the present invention provides a two-in-one communication system based on a one-line communication and a USART, comprising: The device interface circuit includes a device signal receiving circuit and a device signal sending circuit; the device signal receiving circuit is used to access the device signal of the communication device, and the device signal sending circuit is used to send a USART signal or a one-line signal with a specific signal baud rate to the communication device; Microcontroller, running a two-in-one communication method based on one-line and USART.
[0007] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a two-in-one communication method and system based on one-line communication and USART. When a device signal receiving circuit of a device interface circuit is connected to a device signal of a communication device, a device signal sending circuit of the device interface circuit is controlled to be disconnected, and the device signal connected to the device signal receiving circuit is obtained. After the device signal is obtained, the signal feature of the device signal is analyzed to determine whether the obtained device signal is a one-line communication signal or a USART signal. After obtaining that the device signal is a one-line communication signal, the signal baud rate of the one-line communication signal is determined. After obtaining the specific signal baud rate of the one-line communication signal, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the one-line communication signal with the specific signal baud rate is sent to the communication device. After obtaining that the device signal is a USART signal, the signal baud rate of the USART signal is determined. After obtaining the specific signal baud rate of the USART signal, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the USART signal with the specific signal baud rate is sent to the communication device, thereby realizing two-in-one communication of one-line communication and USART, making communication mode switching simple, reducing resource occupation, and improving data compatibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their description are used to explain the present invention and do not constitute an improper limitation of the present invention. Some specific embodiments of the present invention will be described in detail in an exemplary and non-restrictive manner with reference to the drawings. The same reference numerals in the drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 It is a flow chart of a two-in-one communication method based on a one-line communication and USART according to an embodiment of the present invention; Figure 2 The present invention is a schematic structural diagram of a two-in-one communication system based on a one-line communication and a USART.
[0009] Description of reference numerals: 100, device connection circuit; 200, short-circuit current limiting protection circuit; 300, device signal receiving circuit; 400, device signal sending circuit. DETAILED DESCRIPTION
[0010] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only an embodiment of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.
[0011] Embodiment 1 See also Figure 1-Figure 2 This embodiment provides a two-in-one communication method based on a one-line communication and a USART, comprising the following steps: S101, when a device signal receiving circuit of a device interface circuit is connected to a device signal of a communication device, controlling a device signal sending circuit of the device interface circuit to be disconnected, and obtaining the device signal connected to the device signal receiving circuit, and after obtaining the device signal, analyzing a signal feature of the device signal to determine whether the obtained device signal is a one-line signal or a USART signal; S102, after obtaining that the device signal is a one-line signal, determining the signal baud rate of the one-line signal, and after obtaining the specific signal baud rate of the one-line signal, controlling the device signal sending circuit of the device interface circuit to be turned on, and sending the one-line signal with the specific signal baud rate to the communication device; S103, after obtaining that the device signal is a USART signal, determining the signal baud rate of the USART signal, and after obtaining the specific signal baud rate of the USART signal, controlling the device signal sending circuit of the device interface circuit to be turned on, and sending the USART signal with the specific signal baud rate to the communication device.
[0012] It should be noted that, in the present embodiment, when the device signal receiving circuit of the device interface circuit is connected to the device signal of the communication device, the device signal sending circuit of the device interface circuit is controlled to be disconnected, and the device signal connected to the device signal receiving circuit is obtained. After the device signal is obtained, the signal characteristics of the device signal are analyzed to determine whether the obtained device signal is a one-line signal or a USART signal. After obtaining that the device signal is a one-line signal, the signal baud rate of the one-line signal is determined. After obtaining the specific signal baud rate of the one-line signal, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the one-line signal with the specific signal baud rate is sent to the communication device. After obtaining that the device signal is a USART signal, the signal baud rate of the USART signal is determined. After obtaining the specific signal baud rate of the USART signal, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the USART signal with the specific signal baud rate is sent to the communication device, thereby realizing two-in-one communication of one-line and USART, making communication mode switching simple, reducing resource occupation, and improving data compatibility.
[0013] It should also be noted that when parsing the signal characteristics of the device signal to determine whether the acquired device signal is a one-line signal or a USART signal, different signal characteristics of the device signal can be parsed, so as to determine whether the acquired device signal is a one-line signal or a USART signal according to the specific signal characteristics of the device signal obtained by the analysis. Specifically, when parsing the signal characteristics of the device signal to determine whether the acquired device signal is a one-line signal or a USART signal, it can include: parsing the synchronization signal characteristics of the device signal to obtain the synchronization signal characteristics of the device signal; after obtaining the synchronization signal characteristics of the device signal, judging whether the acquired device signal is a one-line signal or a USART signal according to the synchronization signal characteristics of the device signal. Specifically, when parsing the signal characteristics of the device signal to determine whether the acquired device signal is a one-line signal or a USART signal, it may include: parsing the data level characteristics of the device signal to obtain the data level characteristics of the device signal; after obtaining the data level characteristics of the device signal, judging whether the acquired device signal is a one-line signal or a USART signal according to the data level characteristics of the device signal. Specifically, when parsing the signal characteristics of the device signal to determine whether the acquired device signal is a one-line signal or a USART signal, it may include: parsing the stop signal characteristics of the device signal to obtain the stop signal characteristics of the device signal; after obtaining the stop signal characteristics of the device signal, judging whether the acquired device signal is a one-line signal or a USART signal according to the stop signal characteristics of the device signal.
[0014] It should also be noted that when the signal characteristics of the device signal are parsed to determine whether the acquired device signal is a one-line signal or a USART signal, multiple different signal characteristics of the device signal can be parsed, so as to determine whether the acquired device signal is a one-line signal or a USART signal based on multiple specific signal characteristics of the device signal obtained through the analysis. In some preferred embodiments, when the signal characteristics of the device signal are parsed to determine whether the acquired device signal is a one-line signal or a USART signal, it can include: parsing the data level characteristics and stop signal characteristics of the device signal to obtain the data level characteristics and stop signal characteristics of the device signal; after obtaining the data level characteristics and stop signal characteristics of the device signal, judging whether the acquired device signal is a one-line signal or a USART signal based on the data level characteristics and stop signal characteristics of the device signal. It should be noted that, in this embodiment, the data level characteristics and stop signal characteristics of the device signal are analyzed to obtain the data level characteristics and stop signal characteristics of the device signal. After obtaining the data level characteristics and stop signal characteristics of the device signal, the acquired device signal is judged to be a one-line signal or a USART signal according to the data level characteristics and stop signal characteristics of the device signal. Compared with the analysis and judgment method of the single data level characteristics or stop signal characteristics, the communication stability can be improved, and the communication rate and stability can be balanced. In some other preferred embodiments, when the signal characteristics of the device signal are analyzed to determine whether the acquired device signal is a one-line signal or a USART signal, it can include: analyzing the synchronization signal characteristics and stop signal characteristics of the device signal to obtain the synchronization signal characteristics and stop signal characteristics of the device signal; after obtaining the synchronization signal characteristics and stop signal characteristics of the device signal, judging whether the acquired device signal is a one-line signal or a USART signal according to the synchronization signal characteristics and stop signal characteristics of the device signal. It should be noted that, in the present embodiment, the synchronization signal characteristics and the stop signal characteristics of the device signal are analyzed to obtain the synchronization signal characteristics and the stop signal characteristics of the device signal. After obtaining the synchronization signal characteristics and the stop signal characteristics of the device signal, it is determined whether the acquired device signal is a one-line signal or a USART signal based on the synchronization signal characteristics and the stop signal characteristics of the device signal. Compared with the analysis and judgment method of the synchronization signal characteristics or the stop signal characteristics alone, the communication stability can be improved, so that the communication rate and stability can be balanced and controlled.In some other preferred embodiments, when the signal characteristics of the device signal are analyzed to determine whether the acquired device signal is a one-line signal or a USART signal, it may include: analyzing the synchronization signal characteristics and data level characteristics of the device signal to obtain the synchronization signal characteristics and data level characteristics of the device signal; after obtaining the synchronization signal characteristics and data level characteristics of the device signal, judging whether the acquired device signal is a one-line signal or a USART signal according to the synchronization signal characteristics and data level characteristics of the device signal. It should be noted that in this embodiment, by analyzing the synchronization signal characteristics and data level characteristics of the device signal to obtain the synchronization signal characteristics and data level characteristics of the device signal, after obtaining the synchronization signal characteristics and data level characteristics of the device signal, judging whether the acquired device signal is a one-line signal or a USART signal according to the synchronization signal characteristics and data level characteristics of the device signal, compared with the analysis and judgment method of the synchronization signal characteristics or data level characteristics alone, the communication stability can be improved, and the communication rate and stability can be balanced and controlled.
[0015] In some further preferred embodiments, when parsing the signal characteristics of the device signal to determine whether the acquired device signal is a one-line signal or a USART signal, it can include: parsing the synchronization signal characteristics, data level characteristics and stop signal characteristics of the device signal to obtain the synchronization signal characteristics, data level characteristics and stop signal characteristics of the device signal; after obtaining the synchronization signal characteristics, data level characteristics and stop signal characteristics of the device signal, judging whether the acquired device signal is a one-line signal or a USART signal according to the synchronization signal characteristics, data level characteristics and stop signal characteristics of the device signal. It should be noted that, in this embodiment, the synchronization signal characteristics, data level characteristics and stop signal characteristics of the device signal are analyzed to obtain the synchronization signal characteristics, data level characteristics and stop signal characteristics of the device signal. After obtaining the synchronization signal characteristics, data level characteristics and stop signal characteristics of the device signal, it is determined whether the acquired device signal is a one-line signal or a USART signal according to the synchronization signal characteristics, data level characteristics and stop signal characteristics of the device signal. Compared with the analysis and judgment method of the synchronization signal characteristics or data level characteristics alone, the communication stability can be improved, and the communication rate and stability can be balanced. Compared with the analysis and judgment method of any two of the synchronization signal characteristics, data level characteristics and stop signal characteristics of the device signal, the best communication stability can be achieved, greatly reducing the communication error rate.
[0016] In some preferred embodiments, after obtaining that the device signal is a one-line signal, if the one-line signal is determined to be a one-line signal at a baud rate of 9600, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the one-line signal at a baud rate of 9600 is sent to the communication device; after obtaining that the device signal is a USART signal, if the USART signal is determined to be a USART signal at a baud rate of 9600, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the USART signal at a baud rate of 9600 is sent to the communication device. In some other preferred embodiments, after obtaining that the device signal is a one-line signal, if it is determined that the one-line signal is a one-line signal at a baud rate of 11520, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the one-line signal at a baud rate of 11520 is sent to the communication device; after obtaining that the device signal is a USART signal, if it is determined that the USART signal is a USART signal at a baud rate of 11520, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the USART signal at a baud rate of 11520 is sent to the communication device. It should be noted that, in the present embodiment, by determining the specific baud rate of the device signal, and then controlling the device signal sending circuit of the device interface circuit to be turned on, a device signal at a specific baud rate is sent to the communication device. For example, a USART signal at a baud rate of 11520 is sent to the communication device, a USART signal at a baud rate of 9600 is sent to the communication device, a one-line signal at a baud rate of 11520 is sent to the communication device, a one-line signal at a baud rate of 9600 is sent to the communication device, etc., thereby realizing the communication needs of the specific device.
[0017] In some further preferred embodiments, the device interface circuit includes a device connection circuit, a short-circuit current limiting protection circuit, a device signal receiving circuit and a device signal sending circuit; the device connection circuit is electrically connected to the short-circuit current limiting protection circuit, and the short-circuit current limiting protection circuit is electrically connected to the device signal receiving circuit and the device signal sending circuit; after the device connection circuit is connected to the communication device, the device signal of the communication device passes through the short-circuit current limiting protection of the short-circuit current limiting protection circuit and is connected to the device signal receiving circuit. When the device signal receiving circuit is connected to the device signal of the communication device, the device signal sending circuit is disconnected according to the disconnection control signal issued by the microcontroller; the device signal sending circuit is turned on according to the conduction control signal issued by the microcontroller, and sends a one-line signal with a specific signal baud rate or a USART signal with a specific signal baud rate to the communication device through the short-circuit current limiting protection circuit and the device connection circuit. Specifically, the device connection circuit includes a pull-up resistor R6 and a diode D1; one end of the pull-up resistor R6 is connected to the power supply VDD, and the other end of the pull-up resistor R6 is connected to the anode of the diode D1 as the connection end for connecting the communication device; the cathode of the diode D1 is electrically connected to the short-circuit current limiting protection circuit. The short-circuit current limiting protection circuit includes a fuse FUSE, one end of the fuse FUSE is electrically connected to the cathode of the diode D1, and the other end of the fuse FUSE is connected to the device signal receiving circuit and the device signal sending circuit; the device signal receiving circuit includes a resistor R4, a photocoupler U2B and a resistor R5; one end of the resistor R4 is connected to the device signal of the communication device, the other end of the resistor R4 is connected to the first end of the photocoupler U2B, the second end of the photocoupler U2B is connected to the power supply VCC, the third end of the photocoupler U2B is connected to the ground, the fourth end of the photocoupler U2B is connected to one end of the resistor R5 and the microcontroller, the microcontroller obtains the device signal through the connection end connected between the fourth end of the photocoupler U2B and the resistor R5, and the other end of the resistor R5 is grounded.The device signal sending circuit includes a resistor R2, a resistor R1, a transistor Q1, a resistor R3 and a photocoupler U1A; one end of the resistor R2 is connected to the microcontroller for receiving a disconnection control signal or a conduction control signal sent by the microcontroller; the other end of the resistor R2 is connected to one end of the resistor R1, the other end of the resistor R1 is connected to the base of the transistor Q1, the emitter of the transistor Q1 is connected to the power supply VCC, the collector of the transistor Q1 is connected to one end of the resistor R3, the other end of the resistor R3 is connected to the first end of the photocoupler U1A, the third end of the photocoupler U1A is grounded, the fourth end of the photocoupler U1A is grounded, and the second end of the photocoupler U1A is connected to the short-circuit current limiting protection circuit; after the resistor R2 receives the disconnection control signal sent by the microcontroller, the transistor Q1 is disconnected and the photocoupler U1A is disconnected; after the resistor R2 receives the conduction control signal sent by the microcontroller, the transistor Q1 is turned on and the photocoupler U1A is turned on. It should be noted that, in the present embodiment, by being compatible with both the one-line signal and the USART signal on the same interface, hardware resources, port quantity and PCB space can be greatly saved, and the cost of the one-line signal and the USART signal communication can be reduced. In addition, the microcontroller only needs to analyze the received signal in the initial stage to determine which communication protocol the current external device uses, without the need for manual or additional jumpers or switches to switch modes, which greatly reduces the complexity of use. The compatibility of signals of devices with different baud rates can improve the compatibility and adaptability to different peripherals or different rate requirements when the one-line signal and the USART signal communicate. The FUSE fuse can provide protection in the event of an abnormal short circuit to avoid damage to the subsequent circuit; in combination with the electrical isolation of the optocoupler, the overall stability and safety are higher. The photoelectric coupler can effectively block high voltage or clutter from coupling to the core circuit, improving the anti-interference and reliability of the system.
[0018] Embodiment 2 See also Figure 1-Figure 2 This embodiment provides a two-in-one communication system based on a one-line communication and a USART, including: The device interface circuit includes a device signal receiving circuit and a device signal sending circuit; the device signal receiving circuit is used to access the device signal of the communication device, and the device signal sending circuit is used to send a USART signal or a one-line signal with a specific signal baud rate to the communication device; A microcontroller runs any one of the two-in-one communication methods based on one-line communication and USART in the first embodiment, and controls the device signal sending circuit of the device interface circuit to be disconnected when the device signal receiving circuit of the device interface circuit is connected to the device signal of the communication device, and obtains the device signal connected to the device signal receiving circuit. After obtaining the device signal, the signal characteristics of the device signal are analyzed to determine whether the acquired device signal is a one-line communication signal or a USART signal. After obtaining that the device signal is a one-line communication signal, the signal baud rate of the one-line communication signal is determined. After obtaining the specific signal baud rate of the one-line communication signal, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the one-line communication signal with the specific signal baud rate is sent to the communication device. After obtaining that the device signal is a USART signal, the signal baud rate of the USART signal is determined. After obtaining the specific signal baud rate of the USART signal, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the USART signal with the specific signal baud rate is sent to the communication device, thereby realizing two-in-one communication of one-line communication and USART, making communication mode switching simple, reducing resource occupation, and improving data compatibility. Among them, the device interface circuit can also include a device connection circuit and a short-circuit current limiting protection circuit; the device connection circuit is electrically connected to the short-circuit current limiting protection circuit, and the short-circuit current limiting protection circuit is electrically connected to the device signal receiving circuit and the device signal sending circuit; after the device connection circuit is connected to the communication device, the device signal of the communication device passes through the short-circuit current limiting protection of the short-circuit current limiting protection circuit and is connected to the device signal receiving circuit. When the device signal receiving circuit is connected to the device signal of the communication device, the device signal sending circuit is disconnected according to the disconnection control signal issued by the microcontroller; the device signal sending circuit is turned on according to the conduction control signal issued by the microcontroller, and a one-line signal with a specific signal baud rate or a USART signal with a specific signal baud rate is sent to the communication device through the short-circuit current limiting protection circuit and the device connection circuit. Specifically, the device connection circuit includes a pull-up resistor R6 and a diode D1; one end of the pull-up resistor R6 is connected to the power supply VDD, and the other end of the pull-up resistor R6 is connected to the anode of the diode D1 as the connection end for connecting the communication device; the cathode of the diode D1 is electrically connected to the short-circuit current limiting protection circuit.The short-circuit current limiting protection circuit includes a fuse FUSE, one end of the fuse FUSE is electrically connected to the cathode of the diode D1, and the other end of the fuse FUSE is connected to the device signal receiving circuit and the device signal sending circuit; the device signal receiving circuit includes a resistor R4, a photocoupler U2B and a resistor R5; one end of the resistor R4 is connected to the device signal of the communication device, the other end of the resistor R4 is connected to the first end of the photocoupler U2B, the second end of the photocoupler U2B is connected to the power supply VCC, the third end of the photocoupler U2B is connected to the ground, the fourth end of the photocoupler U2B is connected to one end of the resistor R5 and the microcontroller, the microcontroller obtains the device signal through the connection end where the fourth end of the photocoupler U2B and the resistor R5 are connected, and the other end of the resistor R5 is grounded. The device signal sending circuit includes a resistor R2, a resistor R1, a transistor Q1, a resistor R3 and a photocoupler U1A; one end of the resistor R2 is connected to the microcontroller for receiving a disconnection control signal or a conduction control signal sent by the microcontroller; the other end of the resistor R2 is connected to one end of the resistor R1, the other end of the resistor R1 is connected to the base of the transistor Q1, the emitter of the transistor Q1 is connected to the power supply VCC, the collector of the transistor Q1 is connected to one end of the resistor R3, the other end of the resistor R3 is connected to the first end of the photocoupler U1A, the third end of the photocoupler U1A is grounded, the fourth end of the photocoupler U1A is grounded, and the second end of the photocoupler U1A is connected to the short-circuit current limiting protection circuit; after the resistor R2 receives the disconnection control signal sent by the microcontroller, the transistor Q1 is disconnected and the photocoupler U1A is disconnected; after the resistor R2 receives the conduction control signal sent by the microcontroller, the transistor Q1 is turned on and the photocoupler U1A is turned on. It should be noted that, in the present embodiment, by being compatible with both the one-line signal and the USART signal on the same interface, hardware resources, port quantity and PCB space can be greatly saved, and the cost of the one-line signal and the USART signal communication can be reduced. In addition, the microcontroller only needs to analyze the received signal in the initial stage to determine which communication protocol the current external device uses, without the need for manual or additional jumpers or switches to switch modes, which greatly reduces the complexity of use. The compatibility of signals of devices with different baud rates can improve the compatibility and adaptability to different peripherals or different rate requirements when the one-line signal and the USART signal communicate. The FUSE fuse can provide protection in the event of an abnormal short circuit to avoid damage to the subsequent circuit; in combination with the electrical isolation of the optocoupler, the overall stability and safety are higher. The photoelectric coupler can effectively block high voltage or clutter from coupling to the core circuit, improving the anti-interference and reliability of the system.
[0019] It should be pointed out that the above embodiments are only preferred specific implementation modes of the present invention, and the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. The protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A two-in-one communication method based on a one-line communication and USART, characterized in that: include: When the device signal receiving circuit of the device interface circuit is connected to the device signal of the communication device, the device signal sending circuit of the device interface circuit is controlled to be disconnected, and the device signal connected to the device signal receiving circuit is obtained, and after the device signal is obtained, the signal feature of the device signal is analyzed to determine whether the obtained device signal is a one-line signal or a USART signal; After obtaining that the device signal is a one-line signal, determining the signal baud rate of the one-line signal, and after obtaining the specific signal baud rate of the one-line signal, controlling the device signal sending circuit of the device interface circuit to be turned on, and sending the one-line signal with the specific signal baud rate to the communication device; After obtaining that the device signal is a USART signal, the signal baud rate of the USART signal is determined, and after obtaining the specific signal baud rate of the USART signal, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the USART signal with the specific signal baud rate is sent to the communication device.
2. The two-in-one communication method based on one-line communication and USART as claimed in claim 1, characterized in that: The signal characteristics of the device signal are parsed to determine whether the acquired device signal is a one-line signal or a USART signal, comprising: parsing the synchronization signal characteristics of the device signal to obtain the synchronization signal characteristics of the device signal; after obtaining the synchronization signal characteristics of the device signal, determining whether the acquired device signal is a one-line signal or a USART signal according to the synchronization signal characteristics of the device signal.
3. The two-in-one communication method based on one-line communication and USART as claimed in claim 1, characterized in that: The signal characteristics of the device signal are parsed to determine whether the acquired device signal is a one-line signal or a USART signal, comprising: parsing the data level characteristics of the device signal to obtain the data level characteristics of the device signal; after obtaining the data level characteristics of the device signal, determining whether the acquired device signal is a one-line signal or a USART signal according to the data level characteristics of the device signal.
4. The two-in-one communication method based on one-line communication and USART as claimed in claim 1, characterized in that: The signal characteristic of the device signal is parsed to determine whether the acquired device signal is a one-line signal or a USART signal, comprising: parsing a stop signal characteristic of the device signal to obtain the stop signal characteristic of the device signal; after obtaining the stop signal characteristic of the device signal, determining whether the acquired device signal is a one-line signal or a USART signal according to the stop signal characteristic of the device signal.
5. The two-in-one communication method based on one-line communication and USART as claimed in claim 1, characterized in that: When the signal characteristics of the device signal are parsed to determine whether the acquired device signal is a one-line signal or a USART signal, the method includes: parsing the data level characteristics and the stop signal characteristics of the device signal to obtain the data level characteristics and the stop signal characteristics of the device signal; after obtaining the data level characteristics and the stop signal characteristics of the device signal, determining whether the acquired device signal is a one-line signal or a USART signal according to the data level characteristics and the stop signal characteristics of the device signal.
6. The two-in-one communication method based on one-line communication and USART as claimed in claim 1, characterized in that: When the signal characteristics of the device signal are parsed to determine whether the acquired device signal is a one-line signal or a USART signal, the method includes: parsing the synchronization signal characteristics and the stop signal characteristics of the device signal to obtain the synchronization signal characteristics and the stop signal characteristics of the device signal; after obtaining the synchronization signal characteristics and the stop signal characteristics of the device signal, determining whether the acquired device signal is a one-line signal or a USART signal according to the synchronization signal characteristics and the stop signal characteristics of the device signal.
7. The two-in-one communication method based on one-line communication and USART as claimed in claim 1, characterized in that: When the signal characteristics of the device signal are parsed to determine whether the acquired device signal is a one-line signal or a USART signal, the method includes: parsing the synchronization signal characteristics and the data level characteristics of the device signal to obtain the synchronization signal characteristics and the data level characteristics of the device signal; after obtaining the synchronization signal characteristics and the data level characteristics of the device signal, determining whether the acquired device signal is a one-line signal or a USART signal according to the synchronization signal characteristics and the data level characteristics of the device signal.
8. The two-in-one communication method based on one-line communication and USART as claimed in claim 1, characterized in that: After obtaining that the device signal is a one-line signal, if it is determined that the one-line signal is a one-line signal at a baud rate of 9600, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the one-line signal at a baud rate of 9600 is sent to the communication device; after obtaining that the device signal is a USART signal, if it is determined that the USART signal is a USART signal at a baud rate of 9600, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the USART signal at a baud rate of 9600 is sent to the communication device.
9. The two-in-one communication method based on one-line communication and USART as claimed in claim 1, characterized in that: After obtaining that the device signal is a one-line signal, if it is determined that the one-line signal is a one-line signal at a baud rate of 11520, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the one-line signal at a baud rate of 11520 is sent to the communication device; after obtaining that the device signal is a USART signal, if it is determined that the USART signal is a USART signal at a baud rate of 11520, the device signal sending circuit of the device interface circuit is controlled to be turned on, and the USART signal at a baud rate of 11520 is sent to the communication device.
10. A two-in-one communication system based on a one-line communication and USART, characterized in that: include: The device interface circuit includes a device signal receiving circuit and a device signal sending circuit; the device signal receiving circuit is used to access the device signal of the communication device, and the device signal sending circuit is used to send a USART signal or a one-line signal with a specific signal baud rate to the communication device; A microcontroller runs the two-in-one communication method based on one-line communication and USART as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Industry bus system self-adaptive to three industry bus protocols and conversion method
CN106598897A
CAN switch and robot
CN108616436A
Processing method of communication processing based on integrated service digital network interface and battery management system
CN116224067A
Communication method based on CAN and RS485 bus two-in-one BMS protocol
CN118210751A
Method and communication system compatible with integrated service digital network (SDN) communication and inter-integrated circuit (I2C) communication
CN118740957A