UART (Universal Asynchronous Receiver / Transmitter) interface circuit and device, processing equipment and communication system
By adding a buffer isolation filter circuit and a main controller to the UART interface circuit, the problem of insufficient anti-interference ability of the UART interface circuit is solved, correct signal reception is achieved, the programming speed is improved, and bit errors and data packet loss are avoided.
Patent Information
- Application Number
- CN202420192352.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-25
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2034-01-25
AI Technical Summary
The anti-interference ability of the UART interface circuit is weak, which causes interference signals to be easily generated in long-distance communications, affecting data transmission. The RC low-pass filter circuit will reduce the transmission rate during the burning process, resulting in bit errors and data packet loss.
Add a buffer to the UART interface circuit to isolate the receiving end of the main controller from the filter circuit and eliminate the impedance effect of the resistor on the input end of the main controller, thereby effectively filtering out interference signals and using another pin to receive during programming. Burn the signal to avoid the burning speed being affected by the filter circuit.
It achieves the effective elimination of interference signals in long-distance communication, avoids bit errors and data packet loss, and at the same time increases the programming speed of the main controller.
Smart Images

Figure CN221804690U_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a UART interface circuit, device, processing equipment and communication system. Background Art
[0002] Universal Asynchronous Receiver / Transmitter (UART) is a serial communication interface that uses two data lines for sending and receiving to achieve data transmission. It has a simple hardware circuit and can achieve full-duplex communication. It is widely used in digital communications, especially in the field of sensor data transmission.
[0003] The UART interface circuit has a weak anti-interference ability and cannot communicate over long distances. Therefore, long-distance communication is usually achieved by converting it into a differential signal. However, converting it into a differential signal is prone to generate interference signals, making it impossible for the main controller to distinguish normal signals. At present, the elimination of interference signals is mainly achieved through RC low-pass filtering circuits, which filter out interference signals based on the characteristics of capacitors blocking direct current and passing alternating current. Utility Model Content
[0004] The present application provides a UART interface circuit, device, processing equipment and communication system, which are used to avoid bit errors or data packet loss in a main controller while eliminating interference signals, and to increase the burning speed of the main controller.
[0005] In a first aspect, a UART interface circuit is provided, the circuit comprising: a main controller, a buffer and a filter circuit. The main controller comprises a first pin and a second pin, the first pin is used to receive a burning signal, the second pin is connected to a first end of the buffer, the second end of the buffer is connected to a first end of the filter circuit, and the second end of the filter circuit is used to receive a data signal.
[0006] The main controller is used to process the burning signal or data signal, the filter circuit is used to filter out the interference signal in the data signal, and the buffer is used to isolate the filter circuit and the main controller to avoid inconsistent impedance before and after the buffer, which affects the level amplitude of the data signal.
[0007] In the present application, the main controller in the UART interface circuit includes two pins, the first pin is used to directly receive the burning signal, the second pin is connected to the buffer, the buffer is connected to the filter circuit, and the filter circuit is used to receive the data signal. The present application adds a buffer between the filter circuit and a pin of the main controller to isolate the receiving end of the main controller from the filter circuit, eliminate the influence of the resistor on the input impedance of the main controller, thereby achieving the interference signal eliminated by the filter circuit, and enabling the main controller to receive a signal with the correct amplitude. When the main controller is burning, another pin of the main controller receives the burning signal, thereby achieving the burning speed of the main controller is not affected by the filter circuit.
[0008] In a possible implementation of the present application, the main controller is further used to switch the pin for receiving data, for example, switching the first pin to the second pin.
[0009] In a possible implementation of the present application, when the second end of the filter circuit receives a burning signal, the main controller is used to receive the burning signal through the first pin; when the second end of the filter circuit receives a data signal, the main controller is used to switch the pin from the first pin to the second pin.
[0010] In a possible implementation of the present application, the filter circuit includes a capacitor and a resistor. The first end of the resistor is connected to the first end of the capacitor, the first end of the resistor is connected to the buffer as the first end of the filter circuit, the second end of the resistor is used as the second end of the filter circuit to receive the data signal, and the second end of the capacitor is grounded.
[0011] As an example, the resistance of the resistor is 10 kΩ, and the capacitance of the capacitor is 220 pF. The resistor and capacitor may also be of other specifications, which are not limited in the embodiments of the present application.
[0012] In a second aspect, a UART interface device is provided, including a UART interface circuit, the circuit including: a main controller, a buffer and a filter circuit. The main controller includes a first pin and a second pin, the first pin is used to receive a burning signal, the second pin is connected to a first end of the buffer, the second end of the buffer is connected to a first end of the filter circuit, and the second end of the filter circuit is used to receive a data signal.
[0013] The main controller is used to process the burning signal or data signal, the filter circuit is used to filter out the interference signal in the data signal, and the buffer is used to isolate the filter circuit and the main controller to avoid inconsistent impedance before and after the buffer, which affects the level amplitude of the data signal.
[0014] In a possible implementation of the present application, the main controller is further used to switch the pin for receiving data, such as switching the first pin to the second pin.
[0015] In a possible implementation of the present application, when the second end of the filter circuit receives a burning signal, the main controller is used to receive the burning signal through the first pin; when the second end of the filter circuit receives a data signal, the main controller is used to switch the pin from the first pin to the second pin.
[0016] In a possible implementation of the present application, the filter circuit includes a capacitor and a resistor. The first end of the resistor is connected to the first end of the capacitor, the first end of the resistor is connected to the buffer as the first end of the filter circuit, the second end of the resistor is used as the second end of the filter circuit to receive the data signal, and the second end of the capacitor is grounded.
[0017] In a third aspect, a processing device is provided, the processing device comprising the UART interface device as described in the second aspect and any one item of the second aspect.
[0018] In a fourth aspect, a communication system is provided, which comprises a programmer, an external device and a processing device as described in the third aspect. The programmer is used to send a programming signal to the processing device, and the external device is used to send a data signal to the processing device.
[0019] It can be understood that the beneficial effects of the second, third and fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a schematic diagram of a communication system provided in an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of a UART interface circuit provided in an embodiment of the present application;
[0023] Figure 3 It is a circuit structure diagram of a UART interface circuit provided in an embodiment of the present application;
[0024] Figure 4 It is a specific implementation schematic diagram of a UART interface circuit provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with basically the same functions and effects. For example, the first optical port and the second optical port are only used to distinguish different optical ports, and their order is not limited. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit them to be different.
[0026] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0027] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0028] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0029] Before explaining the embodiments of the present application in detail, the application scenarios of the embodiments of the present application are first described.
[0030] like Figure 1 As shown, Figure 1A communication system provided in an embodiment of the present application includes a main controller 10, an external device 20 communicating with the main controller 10, and a burning device 30 for burning the main controller 10. When the external device 20 sends a data signal to the main controller 10, an interference signal higher than the frequency band of the data signal will affect the transmission of the data signal, so an RC low-pass filter circuit is used between the main controller 10 and the external device 20 to eliminate it.
[0031] The resistance of the RC low-pass filter circuit and the input impedance of the UART interface of the main controller 10 form a voltage divider circuit, which reduces the amplitude of the data signal received by the main controller 10 from the external device 20, which may cause bit errors or packet loss in the data signal received by the main controller 10.
[0032] When the programming device 30 programs the main controller, the transmission rate of the programming signal is reduced due to the addition of the RC low-pass filter circuit, resulting in a slower programming speed.
[0033] In order to solve the above problems, the present application proposes a UART interface circuit, device, processing equipment and communication system. The circuit adds a buffer between the filter circuit and a UART interface of the main controller to isolate the receiving end of the main controller from the filter circuit, eliminate the influence of the resistor on the input impedance of the main controller, thereby eliminating the interference signal eliminated by the filter circuit and enabling the main controller to receive a signal with the correct amplitude. When the main controller is burning, another UART interface of the main controller receives the burning signal, thereby realizing that the burning speed of the main controller is not affected by the filter circuit.
[0034] The following is a detailed explanation of a UART interface circuit, device, processing equipment and communication system provided in an embodiment of the present application.
[0035] like Figure 2 The figure shows a UART interface circuit provided by an embodiment of the present application, and the circuit includes: a main controller 210, a buffer 220, and a filter circuit 230. The main controller 210 includes a first pin IO1 and a second pin IO2, the first pin IO1 is used to receive a burning signal, the second pin IO2 is connected to a first end of the buffer 220, the second end of the buffer 220 is connected to a first end of the filter circuit 230, and the second end of the filter circuit 230 is used to receive a data signal. The main controller 210 is used to process a burning signal or a data signal, the filter circuit 230 is used to convert a data signal into a filter signal, and the buffer 220 is used to store the filter signal.
[0036] The main controller 210 is used to process or receive and send external signals.
[0037] For example, the main controller 210 may be a microcontroller unit (MCU) processor, which has the advantages of low cost and strong processing capability. The main controller 210 may also be a central processing unit (CPU), which is not limited in the embodiments of the present application.
[0038] The programming signal is used for programming by the main controller 210. For example, the programmer sends programming data to the main controller 210 and engraves the data in the main controller 210.
[0039] For example, taking the main controller 210 as a single-chip microcomputer, the burning signal is a compiled program, and the burning process is to burn the program into the single-chip microcomputer.
[0040] The buffer 220 is an isolation circuit. Specifically, the buffer 220 includes an input pin and an output pin. When a signal enters the buffer 220 from the input pin, the buffer 220 isolates the signal to prevent the impedance before and after the buffer 220 from being inconsistent, thereby affecting the level amplitude of the data signal.
[0041] For example, the model of the buffer 220 may be SN74LV1T34DBVR, or MC74VHC1GT50, or other models, which are not limited in the embodiments of the present application.
[0042] The filter circuit 230 can realize the function of passing low frequencies and blocking high frequencies, and the high-frequency signal is filtered out by the filter circuit 230 .
[0043] In one possible implementation, when the main controller 210 needs to be burned, the main controller 210 can receive the burning signal through the first pin IO1; when data transmission with the main controller 210 is required, the data signal is first filtered out by the filtering circuit 230 to obtain a filtered signal, and the filtered signal is then amplified by the buffer 220 to obtain an amplified filtered signal, and the main controller 210 receives the amplified filtered signal through the second pin IO2.
[0044] In the present application, the main controller 210 in the UART interface circuit includes two pins, the first pin IO1 is used to directly receive the burning signal, and the second pin IO2 is connected to the buffer 220, the buffer 220 is connected to the filter circuit 230, and the filter circuit 230 is used to receive the data signal. The present application adds a buffer 220 between the filter circuit 230 and a pin of the main controller 210, so that the receiving end of the main controller 210 is isolated from the filter circuit 230, and the influence of the resistor on the input impedance of the main controller 210 is eliminated, thereby achieving the interference signal eliminated by the filter circuit 230, and enabling the main controller 210 to receive a signal with the correct amplitude. When the main controller 210 is burning, another pin of the main controller 210 receives the burning signal, so that the burning speed of the main controller 210 is not affected by the filter circuit 230.
[0045] In a possible embodiment of the present application, the main controller 210 is further used to switch pins, for example, switching the pin for receiving data from the first pin IO1 to the second pin IO2.
[0046] The main controller 210 may configure the pin to be in a high impedance state so that the pin no longer receives data.
[0047] As an example, the UART interface circuit receives a burning signal and a data signal through an interface. When the interface receives a burning signal, the main controller 210 defaults to the first pin IO1 for receiving the signal; when the interface receives a data signal, the main controller 210 configures the first pin IO1 to a high-impedance state, thereby switching the second pin IO2 to receive the data signal.
[0048] In a possible embodiment of the present application, when the second end of the filter circuit 230 receives a data signal, the main controller 210 is configured to switch the pin receiving the signal from the first pin IO1 to the second pin IO2.
[0049] As an example, Figure 3 As shown, Figure 3 This is a circuit structure diagram of a UART interface circuit provided in an embodiment of the present application, in which a first pin IO1 of the main controller 210 is connected to a second end of the filter circuit 230 .
[0050] In a possible embodiment of the present application, Figure 3 As shown, the filter circuit 230 includes a capacitor C and a resistor R. The first end of the resistor R is connected to the first end of the capacitor C, the first end of the resistor R is connected to the buffer 220 as the first end of the filter circuit 230, the second end of the resistor R is used as the second end of the filter circuit 230 to receive the data signal, and the second end of the capacitor C is grounded.
[0051] As an example, Figure 3 As shown, the first pin IO1 of the main controller 210 is connected to the second end of the resistor R.
[0052] For example, the resistance of the resistor R is 10 kΩ, and the capacitance of the capacitor C is 220 pF.
[0053] It is worth noting that the resistor R and the capacitor C may also be of other specifications, which are not limited in the embodiments of the present application.
[0054] An embodiment of the present application provides a UART interface device, the device includes a UART interface circuit, and the circuit includes a main controller, a buffer and a filter circuit.
[0055] The main controller includes a first pin and a second pin, the first pin is used to receive a burning signal, the second pin is connected to a first end of a buffer, the second end of the buffer is connected to a first end of a filter circuit, and the second end of the filter circuit is used to receive a data signal.
[0056] The main controller is used to process the burning signal or the data signal, the filter circuit is used to filter out the interference signal in the data signal, and the buffer is used to play an isolation role to avoid the impedance inconsistency before and after the buffer affecting the level amplitude of the data signal.
[0057] The specific implementation method of the UART interface device provided in the embodiment of the present application refers to the embodiment of the above-mentioned UART interface circuit, which will not be repeated here.
[0058] In a possible embodiment of the present application, the main controller in the UART interface device is further configured to switch the first pin to the second pin.
[0059] It can be understood that the default data receiving pin of the main controller in the UART interface device is the first pin, which is used to receive the programming data.
[0060] In a possible implementation, the UART interface device, when the second end of the filter circuit receives the burning signal, the main controller is used to receive the burning signal through the first pin. When the second end of the filter circuit receives the data signal, the main controller is used to switch the pin from the first pin to the second pin.
[0061] In a possible implementation, the filtering circuit in the UART interface device includes a capacitor and a resistor. The first end of the resistor is connected to the first end of the capacitor, the first end of the resistor is connected to the buffer as the first end of the filtering circuit, the second end of the resistor is used as the second end of the filtering circuit to receive the data signal, and the second end of the capacitor is grounded. The specific implementation refers to the above embodiment and will not be repeated here.
[0062] An embodiment of the present application provides a processing device, which includes the UART interface device described in the above embodiment.
[0063] For example, the processing device may be a single chip microcomputer, a microcontroller, etc. After receiving the burning data and completing the burning, the processing device receives the signal data and performs signal processing.
[0064] The embodiment of the present application provides a communication system, which includes a burner, an external device and the processing device described in the above embodiment. The burner is used to send a burning signal to the processing device, and the external device is used to send a data signal to the processing device.
[0065] As an example, the external device sends a data signal to the processing device through an interface of the RS485 bus interface protocol, and the burner sends a burning signal to the processing device.
[0066] In a possible implementation of the present application, Figure 4 As shown, the external device 420 and the burner 430 are connected to the processing device 410 through an interface. The processing device 410 includes a main controller (for example, the main controller BF2). The main controller BF2 includes multiple pins, wherein the pin IO7 (i.e., the first pin) is used to receive the burning signal, and any one of the pins IO5, IO2, IO11, and IO17 (i.e., the second pin) can be used to receive the data signal, with the pin IO11 (the second pin) being taken as an example. When the processing device 410 is in the burning mode, the main controller BF2 configures the pin IO11 to a high impedance state, and receives the burning signal sent by the burner 430 through the pin IO7; when the software of the main controller BF2 in the processing device 410 runs normally, the pin IO11 is configured as a receiving function, and the pin IO7 is configured to a high impedance state, and the RS485 data sent by the external device 420 is received.
[0067] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0068] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0069] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A UART interface circuit, characterized in that: The circuit comprises: a main controller, a buffer and a filtering circuit; The main controller comprises a first pin and a second pin, the first pin is used to receive a programming signal, the second pin is connected to a first end of the buffer, the second end of the buffer is connected to a first end of the filter circuit, and the second end of the filter circuit is used to receive a data signal; The main controller is used to process the burning signal or the data signal, the filter circuit is used to filter out interference signals in the data signal, and the buffer is used to isolate the filter circuit from the main controller.
2. The UART interface circuit according to claim 1, characterized in that: The main controller is also used to switch the pin for receiving data.
3. The UART interface circuit according to claim 2, characterized in that: In the case where the second end of the filter circuit receives the burning signal, the main controller is used to receive the burning signal through the first pin; In a case where the second end of the filter circuit receives the data signal, the main controller is configured to switch the pin from the first pin to the second pin.
4. The UART interface circuit according to any one of claims 1 to 3, characterized in that: The filter circuit includes a capacitor and a resistor; The first end of the resistor is connected to the first end of the capacitor, the first end of the resistor is connected to the buffer as the first end of the filter circuit, the second end of the resistor is used to receive the data signal as the second end of the filter circuit, and the second end of the capacitor is grounded.
5. A UART interface device, characterized in that: The device comprises a UART interface circuit, and the circuit comprises: a main controller, a buffer and a filter circuit; The main controller comprises a first pin and a second pin, the first pin is used to receive a programming signal, the second pin is connected to a first end of the buffer, the second end of the buffer is connected to a first end of the filter circuit, and the second end of the filter circuit is used to receive a data signal; The main controller is used to process the burning signal or the data signal, the filter circuit is used to filter out interference signals in the data signal, and the buffer is used to isolate the filter circuit from the main controller.
6. The UART interface device according to claim 5, characterized in that: The main controller is also used to switch the pin for receiving data.
7. The UART interface device according to claim 6, characterized in that: In the case where the second end of the filter circuit receives the burning signal, the main controller is used to receive the burning signal through the first pin; In a case where the second end of the filter circuit receives the data signal, the main controller is configured to switch the pin from the first pin to the second pin.
8. The UART interface device according to any one of claims 5 to 7, characterized in that: The filter circuit includes a capacitor and a resistor; The first end of the resistor is connected to the first end of the capacitor, the first end of the resistor is connected to the buffer as the first end of the filter circuit, the second end of the resistor is used to receive the data signal as the second end of the filter circuit, and the second end of the capacitor is grounded.
9. A processing device, characterized in that: The processing device comprises the UART interface device according to any one of claims 5 to 8.
10. A communication system, characterized in that: The system comprises: a burner, an external device and the processing device as claimed in claim 9; The burner is used to send a burning signal to the processing device, and the external device is used to send a data signal to the processing device.
