UART communication isolation level conversion circuit
By designing a UART communication isolation level conversion circuit and using transistors and diodes for high-level voltage division and current limiting, the problem of communication failure caused by differences in signal reference levels of different module circuits is solved, achieving stable and safe signal transmission and preventing static electricity. damage.
Patent Information
- Application Number
- CN202410830279.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-06-25
AI Technical Summary
When communicating between different module circuits through UART, differences in signal reference levels may cause communication failure or receiver damage.
A UART communication isolation level conversion circuit is designed, which uses triodes and diodes for high-level voltage division and current limiting to ensure signal stability, and achieves effective signal propagation through two-stage triode conversion.
It effectively avoids the problem of communication failure, ensures stable and safe transmission of signals, prevents electrostatic damage, and achieves effective communication between modules of different levels.
Smart Images

Figure CN118677434A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of electronic applications and relates to a UART communication isolation level conversion circuit. Background Art
[0002] When it comes to communication between different module circuits, a common problem is the difference between the signal reference levels of the internal module and the external module. In circuit design, these modules are usually set to different signal reference levels according to their respective functions and working environments. However, when these two modules try to communicate directly through UART (Universal Asynchronous Receiver / Transmitter), this level difference may cause the following problems.
[0003] First, when the TX (transmit) port of the internal module attempts to send data to the RX (receive) port of the external module, it generates a signal based on its internal reference level. However, if the TX output level of the internal module is lower than the high level threshold that the external module RX can recognize, the external module will not be able to correctly interpret the signal, resulting in communication failure.
[0004] Secondly, when the TX port of the external module sends data, it generates a signal based on its high-level reference voltage. If this voltage exceeds the maximum withstand voltage of the internal module RX port, it may damage the receiver of the internal module and may even cause irreversible damage to the entire internal module.
[0005] In summary, when different module circuits attempt to communicate directly via UART (Universal Asynchronous Receiver / Transmitter), the inconsistency of communication levels may lead to communication failure problems and even damage the receiver of the circuit module. Summary of the invention
[0006] The purpose of the present invention is to provide a UART communication isolation level conversion circuit to solve the technical problem that the inconsistency of communication levels between different module circuits will lead to communication failure and even damage the receiver of the circuit module. The present invention can realize the effective transmission of electrical signals between external modules and internal modules, ensure the stability of level signal transmission, and avoid the problem of communication failure between different level module circuits.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] The invention discloses a UART communication isolation level conversion circuit, comprising an external module and an internal module;
[0009] The output end of the external module is connected to the resistor R1, the resistor R1 is respectively connected to the b-pole of the transistor Q1 and the resistor R11, the resistor R11 is connected to the e-pole of the transistor Q1, the c-pole of the transistor Q1 is connected to the b-pole of the transistor Q2 through the resistor R3, the resistor R3 and the transistor Q2 are grounded through the resistor R4, the c-pole of the transistor Q2 is connected to the input end of the internal module, the c-pole of Q1 is connected to the DC power supply DC through the resistor R2, and the resistor R2 and the DC power supply DC are connected to the c-pole of the transistor Q2 through the diode Z1 and the resistor R5 in sequence;
[0010] The output end of the internal module is connected to resistor R10, which is respectively connected to the b-pole of transistor Q4 and resistor R12, resistor R12 is connected to the e-pole of transistor Q4, the c-pole of transistor Q4 is connected to the b-pole of transistor Q3 through resistor R8, resistor R8 and transistor Q3 are grounded through resistor R7, the c-pole of transistor Q3 is connected to the input end of the external module, the c-pole of Q4 is connected to the DC power supply DC through resistor R9, and the DC power supply DC is connected to the c-pole of transistor Q3 through resistor R6.
[0011] Furthermore, the e-poles of the transistors Q1 , Q2 , Q3 and Q4 are all grounded.
[0012] Furthermore, the output end and the input end of the external module are both universal asynchronous receiver-transmitter transmitters.
[0013] Furthermore, the output end and the input end of the internal module are both universal asynchronous receiver-transmitter transmitters.
[0014] Furthermore, the resistor R4 is connected in parallel with a first capacitor.
[0015] Furthermore, the resistor R7 is connected in parallel with a first capacitor.
[0016] Furthermore, the resistor R11 is connected in parallel with a second capacitor.
[0017] Furthermore, the resistor R12 is connected in parallel with a second capacitor.
[0018] Furthermore, the first capacitor has a size of 100PF.
[0019] Furthermore, the second capacitor has a value of 1NF.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] 1. The external module of the present invention is used to connect the external circuit, and the internal module is used to connect the internal circuit.
[0022] R1 and R11 are used for high-level voltage division in the circuit to stabilize the high and low levels from the output end of the external module to the transistor Q1. R3 and R4 are used for high-level voltage division in the circuit to stabilize the high and low levels from the transistor Q1 to the transistor Q2. The DC power supply DC provides a high-level signal to the transistor Q2 through the resistor R2. When the external module uses the internal DC power supply DC as a pull-up, the unidirectional conductivity of the diode Z1 is used to prevent the circuit from being cross-connected. The resistor R5 mainly plays the role of current limiting in the circuit, reducing power consumption and preventing the internal DC power supply DC from damaging the input end of the internal module, thereby ensuring that the electrical signal of the external circuit is effectively transmitted to the internal module to avoid being affected by static electricity.
[0023] R10 and R12 are used for high-level voltage division in the circuit to stabilize the high and low levels from the output end of the internal module to the transistor Q4, R7 and R8 are used for high-level voltage division in the circuit to stabilize the high and low levels from the transistor Q4 to the transistor Q3, the DC power supply DC provides a high-level signal to the transistor Q3 through the resistor R9, and the DC power supply DC is connected to the c pole of the transistor Q3 through the resistor R6, thereby ensuring that the electrical signal of the internal circuit is effectively transmitted to the external module to avoid being affected by static electricity. The electrical signal input and output of the present invention are respectively converted by two-stage transistors to achieve effective propagation of the original signal, ensure stable and safe communication signals, and avoid the problem of failure of communication between different level module circuits.
[0024] 2. The output and input ends of the external module and the internal module of the present invention are both UART port conversion circuits, which can ensure that the communication signal is stable and safe. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a schematic diagram of the overall structure of the present invention.
[0026] Among them: 1. External module; 2. Internal module. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0030] See also Figure 1 The present invention discloses a UART communication isolation level conversion circuit, comprising an external module 1 and an internal module 2, wherein the external module 1 is used to connect an external circuit, and the internal module 2 is used to connect an internal circuit.
[0031] The output end of the external module 1 is connected to the resistor R1, and the resistor R1 is respectively connected to the b-pole of the transistor Q1 and the resistor R11. R1 and R11 are used for high-level voltage division in the circuit to stabilize the high and low levels from the output end of the external module 1 to the transistor Q1. The resistor R11 is connected to the e-pole of the transistor Q1, and the c-pole of the transistor Q1 is connected to the b-pole of the transistor Q2 through the resistor R3. The resistor R3 and the transistor Q2 are grounded through the resistor R4. R3 and R4 are used for high-level voltage division in the circuit to stabilize the high and low levels from the transistor Q1 to the transistor Q2. The c-pole of the transistor Q2 is connected to the input end of the internal module 2, Q1 The c-pole of the transistor Q2 is connected to the DC power supply DC through the resistor R2, and the DC power supply DC provides a high-level signal to the transistor Q2 through the resistor R2. The resistor R2 and the DC power supply DC are connected to the c-pole of the transistor Q2 through the diode Z1 and the resistor R5 in turn. When the external module 1 uses the internal DC power supply DC as a pull-up, the unidirectional conductivity of the diode Z1 is used to prevent the circuit from being electrically connected. The resistor R5 mainly plays a current limiting role in the circuit, reducing power consumption and preventing the internal DC power supply DC from damaging the input end of the internal module 2, thereby ensuring that the electrical signal of the external circuit is effectively transmitted to the internal module 2 to avoid being affected by static electricity.
[0032] The output end of the internal module 2 is connected to the resistor R10, and the resistor R10 is respectively connected to the b-pole of the transistor Q4 and the resistor R12. R10 and R12 are used for high-level voltage division in the circuit to stabilize the high and low levels from the output end of the internal module 2 to the transistor Q4. The resistor R12 is connected to the e-pole of the transistor Q4, and the c-pole of the transistor Q4 is connected to the b-pole of the transistor Q3 through the resistor R8. The resistor R8 and the transistor Q3 are grounded through the resistor R7. R7 and R8 are used for high-level voltage division in the circuit to stabilize the high and low levels from the transistor Q4 to the transistor Q3. The c-pole of the transistor Q3 is connected to the input end of the external module 1, and the c-pole of Q4 is connected to the DC power supply DC through the resistor R9. The DC power supply DC provides a high-level signal to the transistor Q3 through the resistor R9. The DC power supply DC is connected to the c-pole of the transistor Q3 through the resistor R6, thereby ensuring that the electrical signal of the internal circuit is effectively transmitted to the external module 1 to avoid being affected by static electricity. The electrical signal input and output of the present invention are converted through two-stage triodes respectively, so as to realize the effective propagation of the original signal, ensure the stability and safety of the communication signal, and avoid the problem of failure of communication between module circuits of different levels.
[0033] The specific working process is as follows:
[0034] When the external module 1 receives a high level, it drives the transistor Q1 after voltage division by the resistors R1 and R11, and the b pole of the transistor Q1 becomes a high level, the c pole and the e pole of the transistor Q1 are turned on, and the c pole of the transistor Q1 is a low level 0V. At this time, the b pole of the transistor Q2 changes to 0V, and the transistor Q2 enters the cut-off state. The c pole of the transistor Q2 turns to a high level, and the input end of the internal module 2 receives the high level signal from the output end of the external module 1;
[0035] When the external module 1 receives a low level, after the voltage is divided by the resistors R1 and R11, the b-pole of the transistor Q1 becomes a low level, the transistor Q1 enters the cut-off state, the c-pole and the e-pole of the transistor Q1 are disconnected, the c-pole of the transistor Q1 becomes a high level, at this time the b-pole of the transistor Q2 becomes a high level, the c-pole and the e-pole of the transistor Q2 are turned on, the c-pole of the transistor Q2 changes to 0V, and the input end of the internal module 2 receives the low level signal of the output end of the external module 1;
[0036] When the internal module 2 receives a high level, after the voltage is divided by the resistors R10 and R12, the b pole of the transistor Q4 becomes a high level, the c pole and the e pole of the transistor Q4 are turned on, and the c pole of the transistor Q4 is a low level 0V. At this time, the b pole of the transistor Q3 changes to 0V, the transistor Q3 enters the cut-off state, and the c pole of the transistor Q3 turns to a high level. The input end of the external module 1 receives the high level signal of the output end of the internal module 2;
[0037] When the internal module 2 receives a low level, after the voltage is divided by the resistors R10 and R12, the b pole of the transistor Q4 becomes a low level, the transistor Q4 enters the cut-off state, the c pole and the e pole of the transistor Q4 are disconnected, and the c pole of the transistor Q4 becomes a high level. At this time, the b pole of the transistor Q4 becomes a high level, the c pole and the e pole of the transistor Q3 are turned on, and the c pole of the transistor Q3 changes to 0V. The input end of the external module 1 receives the low level signal from the output end of the internal module 2.
[0038] Embodiment 1:
[0039] See also Figure 1 , the present invention discloses a UART communication isolation level conversion circuit, comprising an external module 1 and an internal module 2;
[0040] The output end of the external module 1 is connected to the resistor R1, the resistor R1 is respectively connected to the b-pole of the transistor Q1 and the resistor R11, the resistor R11 is connected to the e-pole of the transistor Q1, the c-pole of the transistor Q1 is connected to the b-pole of the transistor Q2 through the resistor R3, the resistor R3 and the transistor Q2 are grounded through the resistor R4, the c-pole of the transistor Q2 is connected to the input end of the internal module 2, the c-pole of Q1 is connected to the DC power supply DC through the resistor R2, and the resistor R2 and the DC power supply DC are connected to the c-pole of the transistor Q2 through the diode Z1 and the resistor R5 in sequence;
[0041] The output end of the internal module 2 is connected to the resistor R10, and the resistor R10 is respectively connected to the b-pole of the transistor Q4 and the resistor R12, the resistor R12 is connected to the e-pole of the transistor Q4, the c-pole of the transistor Q4 is connected to the b-pole of the transistor Q3 through the resistor R8, the resistor R8 and the transistor Q3 are grounded through the resistor R7, the c-pole of the transistor Q3 is connected to the input end of the external module 1, the c-pole of Q4 is connected to the DC power supply DC through the resistor R9, and the DC power supply DC is connected to the c-pole of the transistor Q3 through the resistor R6.
[0042] Select transistors according to the anti-static level. Ordinary plastic-encapsulated transistors meet the vehicle-mounted 8KV direct contact discharge requirements, saving the cost of adding ESD tubes.
[0043] Preferably, the e-poles of the transistors Q1 , Q2 , Q3 and Q4 are all grounded.
[0044] Preferably, the output end and the input end of the external module 1 are both universal asynchronous receiver-transmitter transmitters, specifically UART_TX_MCU.
[0045] Preferably, the output end and the input end of the internal module 2 are both universal asynchronous receiver-transmitter transmitters, specifically UART_TX_OUT.
[0046] Preferably, the resistor R4 is connected in parallel with a first capacitor.
[0047] Preferably, the resistor R7 is connected in parallel with a first capacitor.
[0048] Preferably, the resistor R11 is connected in parallel with a second capacitor.
[0049] Preferably, the resistor R12 is connected in parallel with a second capacitor.
[0050] Preferably, the first capacitor has a value of 101, that is, 100 PF.
[0051] Preferably, the second capacitor has a value of 102, ie, 1NF.
[0052] Embodiment 2:
[0053] See also Figure 1 This embodiment discloses a UART communication isolation level conversion circuit, including signal input and output, resistor voltage division, driving the first-stage transistor switch, and the second-stage transistor switch switching the positive and negative levels. Any power supply can be selected to pull up to keep the level from being cross-connected and the same as the power supply of the corresponding module circuit.
[0054] Furthermore, in the signal conversion process, the three-bit TX signal of the external module 1 sends a high level from one module end, drives Q1 after voltage division by resistors R1 and R11, and the ce end of Q1 is turned on, so the c pole of Q2 is at a low level at this time; the ce end of Q2 is cut off, and the c pole of Q2 is at a high level at this time, and the circuit restores the TX signal to a high level. The pull-up resistor R5 can be selected to be connected to the receiving end, which will not affect the operation of other modules.
[0055] Another set of RX signals sends a high-level signal from the internal module 2, which drives the Q4 NPN tube after being divided by resistors R10 and R12. After Q4 is turned on, the voltage of the c pole is 0. At this time, the b pole of Q3 is at a low level. After Q3 is turned off, the c pole is at a high level, and the circuit restores the RX signal to a high level.
[0056] When converting a low level signal, all conversion levels are reversed.
[0057] In order to solve the problem of signal abnormality caused by different communication levels between different module circuits, the present invention provides a UART communication isolation level conversion circuit to replace the level conversion chip and solve the problem of communication failure between different level module circuits.
[0058] Embodiment three:
[0059] like Figure 1 As shown, a UART communication isolation level conversion circuit of the present invention includes a resistor voltage divider, a transistor switch, and a diode unidirectional conductive circuit.
[0060] The circuit pull-up is set to DC3.3V. If the power supply voltage of internal module 2 is different from that of external module 1, the diode Z1 power supply needs to be connected to the power supply on internal module 2. The UART communication port selects the ordinary transistor BC846B with a β value of about 200 and a frequency of 100MHz.
[0061] Preferably, the resistors R1, R11, R3, R4, R7, R8, R10 and R12 are set to be equal to 10KΩ, and the resistors R2, R5, R6 and R9 are set to be equal to 4.7KΩ.
[0062] The external module 1TX sends a high-level signal of DC 3.3V, which is divided by the resistors R1 and R11 to realize that the b-pole of the transistor Q1 becomes a high-level 0.7V, the c-pole and the e-pole of the transistor Q1 are turned on, and the c-pole is converted from a high-level 3.3V to a low-level 0V; at this time, the b-pole of the transistor Q2 changes from a high-level DC0.7V to 0V, the transistor Q2 enters the cut-off state, the c-pole changes from a low-level 0V to a high-level, and the internal module 2 receives the high-level signal from the external module 1; if the external module 1 continues to send a low-level signal, the b-pole of the first-stage transistor Q1 is low-level, and the c-pole and the e-pole are disconnected after the transistor Q1 is cut off, and the voltage of the c-pole changes from a low-level 0V to a high-level 3.3V, and the b-pole of the transistor Q2 is also converted to a high-level 3.3V at this time. After the transistor Q2 is turned on, the c-pole voltage is 0V, and the internal module 2 receives the low-level signal from the external module 1; in this way, the high and low level signals can be effectively and continuously converted in a cycle.
[0063] Internal module 2 sends a high-level 3.3V signal to external module 1. After the voltage is divided by resistors R10 and R12, the b-pole of transistor Q4 becomes a high-level 0.7V. The c-pole and e-pole of transistor Q4 are turned on, and the c-pole is converted from a high-level 3.3V to a low-level 0V. At this time, the b-pole of transistor Q3 changes from a high-level DC0.7V to 0V, and transistor Q3 enters the cut-off state. The c-pole is converted from a low-level 0V to a high-level 3.3V. The external module 1 receives the internal module. The high-level signal of the block 2 end; if the internal module 2 end continues to send a low-level signal, the b-pole of the first-stage transistor Q4 is at a low level of 0V, and the c-pole and e-pole are disconnected after the transistor Q4 is turned off, and the voltage of the c-pole changes from a low level of 0V to a high level of 3.3V. The b-pole of the transistor Q3 is also converted to a high level of 3.3V at this time. After the transistor Q3 is turned on, the c-pole voltage is 0V, and the external module 1 end receives the low-level signal of the internal module 2 end; in this way, the high and low level signals can be effectively and continuously converted in a cycle.
[0064] In summary, the UART port conversion circuit of the embodiment of the present invention can ensure the stability and safety of communication signals.
[0065] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A UART communication isolation level conversion circuit, It is characterized in that It comprises an external module (1) and an internal module (2); The output end of the external module (1) is connected to a resistor R1, which is respectively connected to the b-pole of transistor Q1 and resistor R11, which is connected to the e-pole of transistor Q1, the c-pole of transistor Q1 is connected to the b-pole of transistor Q2 via resistor R3, the resistor R3 and transistor Q2 are grounded via resistor R4, the c-pole of transistor Q2 is connected to the input end of the internal module (2), the c-pole of Q1 is connected to a direct current power source DC via resistor R2, and the resistor R2 and the direct current power source DC are connected to the c-pole of transistor Q2 via diode Z1 and resistor R5 in sequence; The output end of the internal module (2) is connected to a resistor R10, which is respectively connected to the b-pole of the transistor Q4 and the resistor R12, which is connected to the e-pole of the transistor Q4, the c-pole of the transistor Q4 is connected to the b-pole of the transistor Q3 via a resistor R8, the resistor R8 and the transistor Q3 are grounded via a resistor R7, the c-pole of the transistor Q3 is connected to the input end of the external module (1), the c-pole of Q4 is connected to a direct current power source DC via a resistor R9, and the direct current power source DC is connected to the c-pole of the transistor Q3 via a resistor R6.
2. A UART communication isolation level conversion circuit according to claim 1, It is characterized in that The e-poles of the transistors Q1 , Q2 , Q3 and Q4 are all grounded.
3. A UART communication isolation level conversion circuit according to claim 1, It is characterized in that The output end and the input end of the external module (1) are both universal asynchronous receiver-transmitter transmitters.
4. A UART communication isolation level conversion circuit according to claim 1, It is characterized in that The output end and the input end of the internal module (2) are both universal asynchronous receiver-transmitter transmitters.
5. A UART communication isolation level conversion circuit according to claim 1, It is characterized in that The resistor R4 is connected in parallel with a first capacitor.
6. A UART communication isolation level conversion circuit according to claim 1, It is characterized in that The resistor R7 is connected in parallel with a first capacitor.
7. A UART communication isolation level conversion circuit according to claim 1, It is characterized in that The resistor R11 is connected in parallel with a second capacitor.
8. A UART communication isolation level conversion circuit according to claim 1, It is characterized in that The resistor R12 is connected in parallel with a second capacitor.
9. A UART communication isolation level conversion circuit according to any one of claims 5 to 6, It is characterized in that The first capacitor has a size of 100PF.
10. A UART communication isolation level conversion circuit according to any one of claims 7 to 8, It is characterized in that The second capacitor has a size of 1NF.
Citation Information
Patent Citations
UART communication isolation circuit and lithium battery BMS system applying same
CN111464177A
Level conversion circuit for isolating UART communication
CN210007688U
Single-wire serial port circuit
CN214311725U
TTL (transistor-transistor logic) level-to-serial communication interface circuit with isolation structure
CN215642689U
High-speed asynchronous digital signal level conversion circuit
US20080129338A1
