A collection terminal using TTL and RS-232 level conversion circuit

By designing negative voltage power generation circuit and level conversion circuit, using discrete devices to build level conversion between TTL and RS-232 communication interface, the high cost problem in the existing technology is solved and low-cost and high-compatibility electricity is achieved Flat conversion effect.

CN114285401BActive Publication Date: 2024-11-29QINGDAO TOPSCOMM COMM +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111393259.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2024-11-29
Estimated Expiration
2041-11-23

Smart Images

  • Figure CN114285401B_ABST
    Figure CN114285401B_ABST
Patent Text Reader

Abstract

The present invention discloses a TTL and RS-232 level conversion circuit for an acquisition terminal. The TTL and RS-232 level conversion circuit of the present invention includes a negative voltage power supply generation circuit, a first level boost circuit, and a second level buck circuit. The input end of the negative voltage power supply generation circuit is a single-chip microcomputer PWM pin and a power supply VCC, and the output end of the negative voltage power supply generation circuit is a negative voltage -VCC_OUT; the first level boost circuit has three input ends: a TTL signal interface transmission port TTL_TX, a power supply VCC, and an output end -VCC_OUT of the negative voltage power supply generation circuit, and the output end of the first level boost circuit is an RS-232 signal receiving interface RX-232_RX; the input end of the second level buck circuit is an RS-232 signal transmission interface RS-232_TX, and the output end of the second level buck circuit is a TTL signal interface TTL_RX. The present invention is completely implemented using discrete devices, and provides a low-cost, high-compatibility solution for various systems that require level conversion between a TTL communication interface and an RS-232 communication interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of communication interface conversion, in particular to a design method for a TTL and RS-232 level conversion circuit applied to a collection terminal. Background Art

[0002] At present, RS-232 communication is one of the most widely used communication methods in acquisition terminals. It has the characteristics of fewer signal lines, strong anti-interference ability and long transmission distance. However, most of the TTL communication interface and RS-232 communication interface level conversion solutions on the market are integrated chip solutions. The price of the level conversion integrated chip is about 1 yuan, which is expensive. Most acquisition terminals have strict cost requirements and need a low-cost and compatible TTL communication interface and RS-232 communication interface level conversion solution. Summary of the invention

[0003] The technical problem to be solved by the present invention is to overcome the problems existing in the above-mentioned prior art and provide a method for designing a TTL and RS-232 level conversion circuit for an acquisition terminal. To achieve the above-mentioned purpose of the invention, the present invention adopts the following technical solutions:

[0004] A TTL and RS-232 level conversion circuit applied in an acquisition terminal comprises a negative voltage power supply generating circuit, a first level boosting circuit and a second level bucking circuit.

[0005] The negative voltage power supply generating circuit includes a resistor R17, an NPN transistor VT7, a resistor R15, a resistor R16, a resistor R14, a PNP transistor VT6, an NPN transistor VT8, a capacitor C1, a capacitor C2, a diode VD1 and a diode VD2. The input port of the negative voltage power supply generating circuit is the PWM pin of the single chip microcomputer and the power supply VCC, and the output port is the negative voltage power supply output -VCC_OUT. The single-chip computer PWM pin is connected to the resistor R17, the other end of the resistor R17 is connected to the base of the transistor VT7, the emitter of the transistor VT7 is connected to the ground GND, the collector of the transistor VT7 is connected to one end of the resistor R15, one end of the resistor R16 and the base of the transistor VT8, the other end of the resistor R15 is connected to the power supply VCC, the other end of the resistor R16 is connected to the base of the transistor VT6, the emitter of the transistor VT6 is connected to one end of the resistor R14, the other end of the resistor R14 is connected to the power supply VCC, the collector of the transistor VT6 is connected to one end of the capacitor C1 and the collector of the transistor VT8, the emitter of the transistor VT8 is connected to the ground, the other end of the capacitor C1 is connected to the anode of the diode VD2 and the cathode of the diode VD1, the cathode of the diode VD2 is connected to the ground, the anode of the diode VD1 is connected to the negative voltage power supply -VCC_OUT and one end of the capacitor C2, and the other end of the capacitor C2 is grounded.

[0006] The first level boost circuit includes a resistor R8, a resistor R2, a PNP transistor VT2, an NPN transistor VT4, a resistor R12, a resistor R3, a resistor R11, a resistor R1, an NPN transistor VT1, a PNP transistor VT5, a resistor R4, a resistor R9 and a resistor R10. The signal input port of the first level boost circuit is a TTL communication signal transmitting terminal TTL_TX, a power supply VCC and a negative voltage power supply output -VCC_OUT, and the signal output port is an RS-232 communication interface receiving terminal RS-232_RX. The TTL communication signal sending end TTL_TX is connected to one end of the resistor R9, the emitter of the transistor VT1 and the emitter of the transistor VT5, the other end of the resistor R9 is connected to the 3.3V power supply, the base of the transistor VT5 is connected to one end of the resistor R10, the other end of the resistor R10 is connected to the ground GND, the collector of the transistor VT5 is connected to one end of the resistor R11 and the resistor R13, the other end of the resistor R13 is connected to the negative voltage power supply -VCC_OUT, the other end of the resistor R11 is connected to the base of the transistor VT4, the emitter of the transistor VT4 is connected to one end of the resistor R12, and the other end of the resistor R12 is connected to the negative voltage power supply -VCC_OUT, the collector of transistor VT4 is connected to one end of resistor R8 and the collector of transistor VT2, the other end of resistor R8 is connected to the receiving end RS-232_RX of RS-232 communication interface, the base of transistor VT1 is connected to one end of resistor R4, the other end of resistor R4 is connected to 3.3V power supply, the collector of transistor VT1 is connected to one end of resistor R1 and one end of resistor R3, the other end of resistor R1 is connected to power supply VCC, the other end of resistor R3 is connected to the base of transistor VT2, the emitter of transistor VT2 is connected to one end of resistor R2, and the other end of resistor R2 is connected to power supply VCC.

[0007] The second level step-down circuit includes a resistor R6, a resistor R7, a resistor R5 and an NPN transistor VT3. The signal input port of the second level step-down circuit is the RS-232 communication interface transmitting end RS-232_TX, and the signal output port is the TTL communication interface receiving end TTL_RX. The RS-232 communication interface transmitting end RS-232_TX is connected to one end of the resistor R6, the other end of the resistor R6 is connected to the base of the transistor VT3 and one end of the resistor R7, the other end of the resistor R7 and the emitter of the transistor VT3 are simultaneously connected to the ground GND, the collector of the transistor VT3 is connected to one end of the resistor R5 and the TTL communication interface receiving end TTL_RX, and the other end of the resistor R5 is connected to a 3.3V power supply.

[0008] Preferably, diodes VD1 and VD2 are both Schottky diodes.

[0009] Preferably, the frequency of the PWM signal at the input port of the negative voltage power supply generating circuit is greater than 100 kHz.

[0010] Preferably, the capacitance of capacitor C1 is not less than 0.01uF, the capacitance of capacitor C2 is not less than 1uF, and the capacitance of capacitor C2 needs to be 10 times that of capacitor C1.

[0011] Preferably, the power supply VCC voltage value should be no less than 5V and no more than 15V.

[0012] Preferably, when the PWM signal is at a high level, the NPN transistor VT7 and the PNP transistor VT6 work in the saturation region, and the NPN transistor VT8 works in the cut-off region; when the PWM signal is at a low level, the transistor VT7 and the transistor VT6 work in the cut-off region, and the transistor VT8 works in the saturation region.

[0013] Preferably, when the signal is transmitted from the TTL communication signal interface TTL_TXD to the RS-232 communication signal interface RS-232_RX at logic 1, the NPN transistor VT1 and the PNP transistor VT2 operate in the cutoff region, and the PNP transistor VT5 and the NPN transistor VT4 operate in the saturation region.

[0014] Preferably, when the signal is transmitted from the TTL communication signal interface TTL_TX to the RS-232 communication signal interface RS-232_RX at logic 0, the PNP transistor VT5 and the NPN transistor VT4 operate in the cutoff region, and the NPN transistor VT1 and the PNP transistor VT2 operate in the saturation region.

[0015] Preferably, when the signal is transmitted from the RS-2323 communication signal interface RS-232_TX to the TTL communication signal interface TTL_RX at logic 0, the NPN transistor VT3 operates in the saturation region.

[0016] Preferably, when the signal is transmitted from the RS-2323 communication signal interface RS-232_TX to the TTL interface TTL_RX at logic 1, the NPN transistor VT3 operates in the cut-off region.

[0017] The significance of the present invention lies in that the circuit is built entirely with discrete devices, and the level conversion between the TTL communication signal interface and the RS-232 communication signal interface is realized with low cost, high reliability and high compatibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a level conversion circuit between a TTL communication interface and an RS-232 communication interface according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The present invention is further described below in conjunction with the accompanying drawings. The following content is only used to more clearly illustrate the technical solution of the present invention and cannot be used to limit the protection scope of the present invention.

[0020] This embodiment provides a TTL and RS-232 level conversion circuit for a collection terminal. Figure 1 , the TTL communication interface and RS-232 communication interface level conversion circuit has a negative voltage power supply generation circuit, a first level boost circuit and a second level buck circuit. The input port of the negative voltage power supply generation circuit is the single-chip microcomputer PWM pin and the power supply VCC, the output port of the negative voltage power supply generation circuit is the negative voltage power supply -VCC_OUT, the input port of the first level boost circuit is the TTL communication signal sending end TTL_TX, the power supply VCC and the output port of the negative voltage power supply generation circuit -VCC_OUT, the output port of the first level boost circuit is the RS-232 communication interface receiving end RS-232_RX, the input port of the second level buck circuit is the RS-232 communication interface sending end RS-232_TX, and the output port is the TTL communication signal interface receiving end TTL_RX.

[0021] The negative voltage power supply generating circuit described in this example is a PWM periodic charging circuit. When the first PWM signal is at a high level, the NPN transistor VT7 works in the saturation region and is turned on, the collector voltage of the transistor VT7 is at a low level, the NPN transistor VT8 works in the cut-off region and is not turned on, and the PNP transistor VT6 works in the saturation region and is turned on. The power supply VCC charges the capacitor C1 through the resistor R14, the transistor VT6, and the diode VD2, and the voltage across the capacitor C1 is positive on the left and negative on the right.

[0022] When the first PWM signal is at a low level, the NPN transistor VT7 works in the cut-off region and does not conduct. The collector voltage of the transistor VT7 is the power supply VCC, the PNP transistor VT6 works in the cut-off region and does not conduct, and the NPN transistor VT8 works in the saturation region and conducts. Since the voltage across the capacitor C1 cannot change suddenly, when the transistor VT8 is turned on, the ground GND passes through the capacitor C2, and the diode VD1 continues to charge C1. At this time, the capacitor C2 is negative at the top and positive at the bottom. After N cycles, the voltage at the lower end of the capacitor C2 is GND, and the voltage at the upper end is -VCC_OUT. At this time, the -VCC_OUT voltage is the opposite of the power supply VCC voltage (required to be not less than 5V and not more than 15V) minus the conduction voltage drop of the diodes VD1 and VD2 (the Schottky diode is calculated according to the conduction voltage drop of 0.7V), so the output end -VCC_OUT voltage of the negative voltage power supply generation circuit is in the range of -3V to -15V.

[0023] The level conversion circuit of the TTL communication interface and the RS-232 communication interface in this example is unidirectional transmission. When the signal is transmitted from the TTL communication signal interface TTL_TX to the RS-232 communication signal interface RS-232_RX, the logic is 1, and the TTL_TX level is required to be greater than 2.4V. The collector of the NPN transistor VT1 connected to TTL_TX is high level and the emitter is high level. The transistor VT1 works in the cut-off area and is not conducting. The base and emitter of the PNP transistor VT2 are pulled up to the power supply VCC. The PNP transistor VT2 works in the cut-off area and is not conducting. The emitter of NP transistor VT5 is high level and the base is low level. Transistor VT5 works in the saturation area and is turned on. The base of NPN transistor VT4 is high level and the emitter is negative level. Transistor VT4 works in the saturation area and is turned on. The RS-232 communication signal interface RS-232_RX is connected to the negative voltage power supply -VCC_OUT through transistor VT4 and resistor R12. The RS-232 communication signal interface RS-232_RX level is -VCC_OUT. The RS-232_RX level meets the level requirement of RS-232 communication logic 1 (-3V~-15V).

[0024] When the signal is transmitted from the TTL communication signal interface TTL_TX to the RS-232 communication signal interface RS-232_RX at logic 0, the TTL_TX level is required to be less than 0.7V, the collector of the NPN transistor VT1 connected to the TTL_TX is high level, the emitter is low level, and it works in the saturation area and is turned on, the base of the PNP transistor VT2 is low level, and the emitter is pulled up to the power supply VCC, the transistor VT2 works in the saturation area and is turned on, the emitter of the PNP transistor VT5 is low level, and the base It is a low level, transistor VT5 works in the cut-off area and is not conducting, the base and emitter of NPN transistor VT4 are pulled down to the negative level -VCC_OUT, transistor VT4 works in the cut-off area and is not conducting, the RS-232 communication signal interface RS-232_RX is connected to the power supply VCC through transistor VT2 and resistor R2, the RS-232 communication signal interface RS-232_RX level is VCC, and the RS-232_RX level meets the level requirement of RS-232 communication logic 0 (3V~15V).

[0025] When the signal is transmitted from the RS-2323 communication signal interface RS-232_TX to the TTL communication signal interface TTL_RX at logic 0, the RS-232_TX level is required to be between 3V and 15V, the base level of the NPN transistor VT3 connected to the RS-232_TX is high and the emitter level is low, the saturation region of the transistor VT3 is turned on, and the TTL communication signal interface TTL_RX is connected to the ground GND by the transistor VT3, and the TTL_RX level is less than 1.2V, which meets the TTL communication interface input low level standard.

[0026] When the signal is transmitted from the RS-2323 communication signal interface RS-232_TX to the TTL interface TTL_RX at logic 1, the RS-232_TX level is required to be between -3V and -15V, the base and emitter levels of the NPN transistor VT3 connected to the RS-232_TX are both low, the transistor VT3 works in the cut-off area and is not conducting, the TTL communication signal interface TTL_RX is pulled up to 3.3V by the resistor R5, and the TTL_RX level is greater than 2V, meeting the TTL communication interface input high level standard.

[0027] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A collection terminal using TTL and RS-232 level conversion circuit, It is characterized in that It includes a negative voltage power supply generating circuit, a first level voltage boosting circuit and a second level voltage step-down circuit; The input port of the negative voltage power supply generating circuit is the PWM pin of the single-chip microcomputer and the power supply VCC, and the output port is the negative voltage power supply -VCC_OUT. The PWM pin of the single-chip microcomputer is connected to one end of the resistor R17, the other end of the resistor R17 is connected to the base of the NPN transistor VT7, the emitter of the transistor VT7 is connected to the ground GND, the collector of the transistor VT7 is connected to one end of the resistor R15, one end of the resistor R16 is connected to the base of the NPN transistor VT8, the other end of the resistor R15 is connected to the power supply VCC, the other end of the resistor R16 is connected to the base of the PNP transistor VT6, the emitter of the transistor VT6 is connected to one end of the resistor R14, the other end of the resistor R14 is connected to the power supply VCC, the collector of the transistor VT6 is connected to one end of the capacitor C1 and the collector of transistor VT8, the emitter of transistor VT8 is connected to the ground GND, the other end of capacitor C1 is connected to the anode of diode VD2 and the cathode of diode VD1, the cathode of diode VD2 is connected to the ground GND, the anode of diode VD1 is connected to the negative voltage power supply -VCC_OUT and one end of capacitor C2, the other end of capacitor C2 is connected to the ground GND, when the PWM signal of the input port of the negative voltage power supply generating circuit is high level, NPN transistor VT7 and PNP transistor VT6 work in the saturation region, and NPN transistor VT8 works in the cut-off region, when the PWM signal of the input port of the negative voltage power supply generating circuit is low level, transistor VT7 and transistor VT6 work in the cut-off region, and transistor VT8 works in the saturation region; The signal input port of the first level boost circuit is a TTL signal interface sending end TTL_TX, a power supply VCC and the negative voltage power supply -VCC_OUT, and the signal output port is an RS-232 communication interface receiving end RS-232_RX, the TTL signal interface sending end TTL_TX is connected to one end of a resistor R9, an emitter of an NPN transistor VT1 and an emitter of a PNP transistor VT5, the other end of the resistor R9 is connected to a 3.3V power supply, the base of the transistor VT5 is connected to one end of a resistor R10, the other end of the resistor R10 is connected to the ground GND, the collector of the transistor VT5 is connected to one end of a resistor R11 and one end of a resistor R13, the other end of the resistor R13 is connected to the negative voltage power supply -VCC_OUT, the other end of the resistor R11 is connected to the NP The base of N transistor VT4 is connected, the emitter of transistor VT4 is connected to one end of resistor R12, the other end of resistor R12 is connected to negative voltage power supply -VCC_OUT, the collector of transistor VT4 is connected to one end of resistor R8 and the collector of PNP transistor VT2, the other end of resistor R8 is connected to the receiving end RS-232_RX of RS-232 communication interface, the base of transistor VT1 is connected to one end of resistor R4, the other end of resistor R4 is connected to 3.3V power supply, the collector of transistor VT1 is connected to one end of resistor R1 and one end of resistor R3, the other end of resistor R1 is connected to power supply VCC, the other end of resistor R3 is connected to the base of transistor VT2, the emitter of transistor VT2 is connected to one end of resistor R2, and the other end of resistor R2 is connected to power supply VCC; The signal input port of the second level step-down circuit is the RS-232 communication interface transmitting end RX-232_TX, and the signal output port is the TTL communication interface receiving end TTL_RX. The RS-232 communication interface transmitting end RX-232_TX is connected to one end of resistor R6, the other end of resistor R6 is connected to the base of NPN transistor VT3 and one end of resistor R7, the other end of resistor R7 and the emitter of transistor VT3 are connected to the ground GND at the same time, the collector of transistor VT3 is connected to one end of resistor R5 and the TTL communication interface receiving end TTL_RX, and the other end of resistor R5 is connected to a 3.3V power supply.

2. The acquisition terminal as claimed in claim 1 uses a TTL and RS-232 level conversion circuit, It is characterized in that Diodes VD1 and VD2 are both Schottky diodes.

3. The acquisition terminal as claimed in claim 1 uses TTL and RS-232 level conversion circuits, It is characterized in that The capacitance of capacitor C1 shall not be less than 0.01uF, the capacitance of capacitor C2 shall not be less than 1uF, and the capacitance of capacitor C2 shall be 10 times that of capacitor C1.

4. The acquisition terminal as claimed in claim 1 uses a TTL and RS-232 level conversion circuit, It is characterized in that The power supply VCC voltage value must be no less than 5V and no more than 15V.

5. The acquisition terminal as claimed in claim 1 uses a TTL and RS-232 level conversion circuit, It is characterized in that When the signal is transmitted from the TTL_TX to the RS-232_RX as logic 1, the NPN transistor VT1 and the PNP transistor VT2 operate in the cut-off region, and the PNP transistor VT5 and the NPN transistor VT4 operate in the saturation region.

6. The acquisition terminal as claimed in claim 1 uses a TTL and RS-232 level conversion circuit, It is characterized in that When the TTL_TX transmits logic 0 to the RS-232_RX, the PNP transistor VT5 and the NPN transistor VT4 operate in the cut-off region, and the NPN transistor VT1 and the PNP transistor VT2 operate in the saturation region.

7. The acquisition terminal as claimed in claim 1 uses a TTL and RS-232 level conversion circuit, It is characterized in that When the RS-232_TX transmits logic 0 to the TTL_RX, the NPN transistor VT3 operates in the saturation region.

8. The acquisition terminal as claimed in claim 1 uses TTL and RS-232 level conversion circuits, It is characterized in that When the RS-232_TX transmits logic 1 to the TTL_RX, the NPN transistor VT3 operates in the cut-off region.

Citation Information

Patent Citations

  • RS485 and RS232 switching circuit for intelligent fusion terminal in transformer area

    CN113360441A

  • Level converting circuit

    CN203537365U