Circuit for converting USB (Universal Serial Bus) interface into various serial communication interfaces
By designing a circuit to convert USB interface into multiple serial communication interfaces, the problem of inconvenience in debugging of multiple serial ports is solved, and the conversion and stable communication of multiple serial ports is realized, which improves the anti-interference ability of the device.
Patent Information
- Application Number
- CN202421863673.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2034-08-02
AI Technical Summary
When debugging a serial port, a variety of different standard serial ports (such as RS232, RS485 or ordinary TTL serial ports) may cause inconvenience in debugging, and in a strong electromagnetic interference environment, the serial port is easily disturbed and affects stability.
Design a circuit for converting a USB interface into multiple serial communication interfaces, including USB to TTL circuit, TTL to 232 circuit and TTL to 485 circuit. Through these circuits, the USB interface is converted into TTL, RS232 and RS485 signals, thereby realizing the conversion of multiple serial interfaces.
This circuit enables multiple serial port interfaces to be connected to the computer for debugging, solving the problem of inconvenience in serial debugging in various forms, improving communication stability and anti-interference between devices, and facilitating program debugging and operation.
Smart Images

Figure CN222867086U_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of interface conversion, and in particular to a circuit for converting a USB interface into a plurality of serial communication interfaces. Background Art
[0002] A circuit board, also known as a printed circuit board (PCB), is a substrate used in electronic devices to fix electronic devices and provide connections between electronic devices. As people's requirements for cost become higher and higher, the integration of circuit boards is becoming higher and higher, resulting in more and more electronic devices on circuit boards. Since the voltages between various devices are different, and many devices work in an environment with strong electromagnetic interference, the communication between devices may have various problems due to strong electromagnetic interference. Therefore, isolation issues need to be considered when designing circuits.
[0003] At present, when debugging the isolation circuit, the ordinary serial port is susceptible to interference. Therefore, RS232 usually needs to take enhanced levels or other remedial measures to deal with interference. RS485 has better anti-interference ability due to its differential signal design, which is particularly suitable for long-distance or complex electromagnetic environment communication needs. TTL communication can be combined with shielding and filtering technology to improve its stability and anti-interference ability in a strong electromagnetic interference environment.
[0004] As you can see, when debugging serial ports, you may encounter serial ports of different standards, such as RS232, RS485, or ordinary TTL serial ports. Without a suitable conversion device, you may not be able to connect these serial ports to the computer for debugging. Therefore, it is very important to ensure that there is a proper conversion device, which not only facilitates program debugging, but also ensures the stability of the program during operation. Utility Model Content
[0005] To this end, the present application provides a circuit for converting a USB interface into multiple serial communication interfaces to solve the problem in the prior art that when debugging a serial port, there are too many serial ports, which causes inconvenience in debugging.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] A circuit for converting a USB interface into multiple serial communication interfaces comprises a USB to TTL circuit, a TTL to 232 circuit and a TTL to 485 circuit, wherein one end of the USB to TTL circuit is electrically connected to the USB interface, the other end of the USB to TTL circuit is used for outputting or inputting TTL signals and is electrically connected to one end of the TTL to 232 circuit and the TTL to 485 circuit, the other end of the TTL to 232 circuit is used for outputting or inputting RS232 signals, and the other end of the TTL to 485 circuit is used for outputting or inputting RS485 signals.
[0008] Preferably, the USB to TTL circuit is a USB to TTL chip.
[0009] Preferably, the model of the USB to TTL chip is CH340E, the first pin of the USB to TTL chip is electrically connected to the positive data line of the USB interface, the second pin of the USB to TTL chip is electrically connected to the negative data line of the USB interface, the eighth pin and the ninth pin of the USB to TTL chip are electrically connected to one end of the TTL to 232 circuit and the TTL to 485 circuit, wherein the eighth pin of the USB to TTL chip is used to output RS232 signals, and the ninth pin of the USB to TTL chip is used to input RS232 signals.
[0010] Preferably, the USB to TTL circuit further comprises a display circuit, one end of the display circuit is electrically connected to the power supply, and the other end is electrically connected to one end of the USB to TTL circuit for outputting or inputting TTL signals.
[0011] Preferably, the display circuit includes a first light-emitting diode and a second light-emitting diode, one end of the first light-emitting diode is electrically connected to the power supply, and the other end is electrically connected to one end of the USB to TTL circuit for outputting TTL signals; one end of the second light-emitting diode is electrically connected to the power supply, and the other end is electrically connected to one end of the USB to TTL circuit for inputting TTL signals.
[0012] Preferably, the TTL to 232 circuit is a TTL to 232 chip.
[0013] Preferably, the model of the TTL to 232 chip is MAX3232ID, the 11th pin of the TTL to 232 chip is electrically connected to one end of the USB to TTL circuit for outputting TTL signals, the 12th pin of the TTL to 232 chip is electrically connected to one end of the USB to TTL circuit for inputting TTL signals, the 13th pin of the TTL to 232 chip is used to input RS232 signals, and the 14th pin of the TTL to 232 chip is used to output RS232 signals.
[0014] Preferably, a capacitor is provided between the 15th pin and the 16th pin of the TTL-to-232 chip.
[0015] Preferably, the TTL to 485 circuit is a TTL to 485 chip.
[0016] Preferably, the model of the TTL-to-485 chip is SP3485EEN, the pin 1 of the TTL-to-485 chip is electrically connected to one end of the USB-to-TTL circuit for inputting TTL signals, the pin 4 of the TTL-to-485 chip is electrically connected to one end of the USB-to-TTL circuit for outputting TTL signals, and the pins 6 and 7 of the TTL-to-485 chip are used to output or input RS485 signals.
[0017] Compared with the prior art, this application has at least the following beneficial effects:
[0018] The present application provides a circuit for converting a USB interface into a variety of serial communication interfaces, including a USB to TTL circuit, a TTL to 232 circuit, and a TTL to 485 circuit, one end of the USB to TTL circuit is electrically connected to the USB interface, the other end of the USB to TTL circuit is used to output or input a TTL signal, and is electrically connected to one end of the TTL to 232 circuit and the TTL to 485 circuit, the other end of the TTL to 232 circuit is used to output or input an RS232 signal, and the other end of the TTL to 485 circuit is used to output or input an RS485 signal. The circuit for converting a USB interface into a variety of serial communication interfaces provided by the present application can connect a variety of serial ports to a computer for debugging, solves the debugging problem of various forms of serial ports in the circuit, improves communication between devices, and makes debugging more convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more intuitively illustrate the prior art and the present application, exemplary drawings are given below. It should be understood that the specific shapes and structures shown in the drawings should not generally be regarded as limiting conditions for implementing the present application; for example, those skilled in the art are capable of easily making conventional adjustments or further optimizations to the addition / reduction / attribution division, specific shapes, positional relationships, connection methods, dimensional ratios, etc. of certain units (components) based on the technical concepts and exemplary drawings disclosed in the present application.
[0020] Figure 1 A block diagram of a circuit for converting a USB interface into multiple serial communication interfaces provided by the present application;
[0021] Figure 2 The USB to TTL circuit schematic provided for this application;
[0022] Figure 3 The TTL to 232 circuit schematic provided for this application;
[0023] Figure 4 The TTL to 485 circuit schematic provided for this application.
[0024] Description of reference numerals:
[0025] 1. USB interface; 2. USB to TTL circuit; 3. TTL to 232 circuit; 4. TTL to 485 circuit. DETAILED DESCRIPTION
[0026] The present application is further described below in detail through specific embodiments in conjunction with the accompanying drawings.
[0027] In the description of this application: unless otherwise specified, the meaning of "plurality" is two or more. The terms "first", "second", "third", etc. in this application are intended to distinguish the objects referred to, and do not have special meanings in terms of technical connotations (for example, they should not be understood as emphasizing the importance or order, etc.). Expressions such as "including", "comprising", "having", etc. also mean "not limited to" (certain units, components, materials, steps, etc.).
[0028] The terms such as "upper", "lower", "left", "right", "middle", etc. cited in this application are usually used to indicate the general relative position relationship for the purpose of intuitive understanding by referring to the drawings, and are not absolute limitations on the position relationship in the actual product.
[0029] See also Figure 1 The present application provides a circuit for converting a USB interface into multiple serial communication interfaces, including a USB to TTL circuit 2, a TTL to 232 circuit 3 and a TTL to 485 circuit 4. One end of the USB to TTL circuit 2 is electrically connected to the USB interface 1, and the other end of the USB to TTL circuit 2 is used to output or input TTL signals, and is electrically connected to one end of the TTL to 232 circuit 3 and the TTL to 485 circuit 4. The other end of the TTL to 232 circuit 3 is used to output or input RS232 signals, and the other end of the TTL to 485 circuit 4 is used to output or input RS485 signals.
[0030] See also Figure 2 The USB to TTL circuit 2 is a USB to TTL chip, the model of the USB to TTL chip (U8) is CH340E, the first pin (UD+) of the USB to TTL chip is electrically connected to the positive data line (USB DP) of the USB interface 1, the second pin (UD-) of the USB to TTL chip is electrically connected to the negative data line (USB DM) of the USB interface, the eighth pin (TXD) and the ninth pin (RXD) of the USB to TTL chip are electrically connected to one end of the TTL to 232 circuit 3 and the TTL to 485 circuit 4, wherein the eighth pin (TXD) of the USB to TTL chip is used to output (send) RS232 signals, and the ninth pin (RXD) of the USB to TTL chip is used to input (receive) RS232 signals.
[0031] Specifically, the USB to TTL chip CH340E first connects the conventional V3 (pin 10) to 3.3V voltage to provide the reference voltage of TTL, and connects GND (pin 3) to ground. VCC (pin 7) is used to supply 3.3V power to the USB to TTL chip, and C16 filtering is used to reduce voltage fluctuations to keep the chip stable. It should be noted that the TNOW (pin 6) of the USB to TTL chip is a pin specially reserved for the TTL to 485 circuit 4, and this pin will be used as the transceiver control pin of the TTL to 485 circuit 4.
[0032] More specifically, the USB to TTL circuit 2 also includes a display circuit, which is used to conveniently observe whether there is data communication. One end of the display circuit is electrically connected to the power supply, and the other end is electrically connected to one end of the USB to TTL circuit 2 for outputting or inputting TTL signals.
[0033] The display circuit includes a first light-emitting diode LED2 and a second light-emitting diode LED3. One end of the first light-emitting diode LED2 is electrically connected to a 3.3V power supply, and the other end is electrically connected to one end of a USB to TTL circuit 2 for outputting a TTL signal; one end of the second light-emitting diode LED3 is electrically connected to a 3.3V power supply, and the other end is electrically connected to one end of a USB to TTL circuit 2 for inputting a TTL signal.
[0034] The display circuit also includes a twelfth resistor R12 and a thirteenth resistor R13, wherein the twelfth resistor R12 is connected in series with the first light-emitting diode LED2, and the thirteenth resistor R13 is connected in series with the second light-emitting diode LED3. Therefore, whether the sending pin or the receiving pin is normally at a high level, when a signal is received, the level will be lowered, and the light of the light-emitting diode will light up, making it convenient for observation.
[0035] In the present application, the USB to TTL circuit 2 uses the CH340E chip to convert the USB signal into an ordinary serial port TTL signal or convert the serial port TTL signal into a USB signal, and adds light-emitting diodes at both ends of the transmitting and receiving ends, so that it is more convenient to observe whether there is data communication.
[0036] See also Figure 3The TTL to 232 circuit 3 is a TTL to 232 chip, the model of the TTL to 232 chip (U9) is MAX3232ID, the 11th pin (DIN1) of the TTL to 232 chip is electrically connected to one end of the USB to TTL circuit 2 for outputting TTL signals, the 12th pin (ROUT1) of the TTL to 232 chip is electrically connected to one end of the USB to TTL circuit 2 for inputting TTL signals, the 13th pin (RINI) of the TTL to 232 chip is used to input RS232 signals, and the 14th pin (DOUT1) of the TTL to 232 chip is used to output RS232 signals.
[0037] Specifically, the VCC (pin 16) and GND (pin 15) of the TTL to 232 chip are connected to 3.3V and GND respectively. In order to ensure the power supply of the chip, a 100nf C1 capacitor is connected between the two pins to filter the 3.3V; V+ (pin 2) and V- (pin 6) are both connected to GND, and a 330nf C3 and C5 capacitor are connected in series for filtering; a 47nf C2 is connected between C1+ (pin 1) and C1- (pin 3); a 330nf C4 is connected between C2+ (pin 4) and C2- (pin 5).
[0038] In the present application, the TTL to 232 circuit 3 can convert a TTL signal into an RS232 signal or convert an RS232 signal into a TTL signal by using a MAX232 chip.
[0039] See also Figure 4 , TTL to 485 circuit 4 is a TTL to 485 chip, the model of the TTL to 485 chip (U10) is SP3485EEN, the first pin (RO) of the TTL to 485 chip is electrically connected to one end of the USB to TTL circuit 2 for inputting TTL signals, the fourth pin (DI) of the TTL to 485 chip is electrically connected to one end of the USB to TTL circuit 2 for outputting TTL signals, and the sixth pin (A) and the seventh pin (B) of the TTL to 485 chip are used to output or input RS485 signals.
[0040] More specifically, a resistor R3 is connected in series between the first pin (RO) of the TTL-to-485 chip and one end of the USB-to-TTL circuit 2 for inputting TTL signals, a resistor R2 is connected in series between the fourth pin (DI) of the TTL-to-485 chip and one end of the USB-to-TTL circuit 2 for outputting TTL signals, the second pin (RE) and the third pin (DE) of the TTL-to-485 chip are connected to the TNOW pin of the USB-to-TTL chip, VCC (pin 8) and GND (pin 5) are connected to 3.3V and ground respectively, wherein the 3.3V connected to VCC is connected to ground through C16 for filtering; the A pin and the B pin are the differential signal pins of 485, wherein 3.3V and R8, R4, R9 and GND give their differential signals an initial state.
[0041] In the present application, the TTL to 485 circuit 4 can convert a TTL signal into an RS485 signal or convert an RS485 signal into a TTL signal using a universal TTL to 485 chip.
[0042] Serial ports are usually used on embedded circuit boards to meet communication needs in many situations. Although the principles of serial ports are the same, they can be divided into TTL, 485, 232, and 422 according to different peripheral design circuits. When debugging, you need to use a computer serial port assistant to monitor data, and then change the program according to the actual situation to meet work needs and ensure program stability.
[0043] The circuit provided in the present application for converting a USB interface into multiple serial communication interfaces can connect multiple serial ports to a computer for debugging, thereby solving the debugging problem of multiple forms of serial ports in the circuit, improving communication between devices, and making debugging more convenient.
[0044] The technical features of the above embodiments may be arbitrarily combined (as long as there is no contradiction in the combination of these technical features). To make the description concise, not all possible combinations of the technical features in the above embodiments are described; these embodiments that are not explicitly written should also be considered to be within the scope of this specification.
Claims
1. A circuit for converting a USB interface into multiple serial communication interfaces, characterized in that: It includes a USB to TTL circuit, a TTL to 232 circuit and a TTL to 485 circuit. One end of the USB to TTL circuit is electrically connected to the USB interface, and the other end of the USB to TTL circuit is used to output or input a TTL signal and is electrically connected to one end of the TTL to 232 circuit and the TTL to 485 circuit. The other end of the TTL to 232 circuit is used to output or input an RS232 signal, and the other end of the TTL to 485 circuit is used to output or input an RS485 signal.
2. The circuit for converting a USB interface into multiple serial communication interfaces according to claim 1, characterized in that: The USB to TTL circuit is a USB to TTL chip.
3. The circuit for converting a USB interface into multiple serial communication interfaces according to claim 2, characterized in that: The model of the USB to TTL chip is CH340E, the first pin of the USB to TTL chip is electrically connected to the positive data line of the USB interface, the second pin of the USB to TTL chip is electrically connected to the negative data line of the USB interface, the eighth pin and the ninth pin of the USB to TTL chip are electrically connected to one end of the TTL to 232 circuit and the TTL to 485 circuit, wherein the eighth pin of the USB to TTL chip is used to output RS232 signals, and the ninth pin of the USB to TTL chip is used to input RS232 signals.
4. The circuit for converting a USB interface into multiple serial communication interfaces according to claim 1, characterized in that: The USB to TTL circuit also includes a display circuit, one end of which is electrically connected to a power supply, and the other end of which is electrically connected to one end of the USB to TTL circuit for outputting or inputting a TTL signal.
5. The circuit for converting a USB interface into multiple serial communication interfaces according to claim 4, characterized in that: The display circuit comprises a first light emitting diode and a second light emitting diode, one end of the first light emitting diode is electrically connected to the power supply, and the other end is electrically connected to one end of the USB to TTL circuit for outputting a TTL signal; One end of the second light emitting diode is electrically connected to the power supply, and the other end is electrically connected to one end of the USB to TTL circuit for inputting a TTL signal.
6. The circuit for converting a USB interface into multiple serial communication interfaces according to claim 1, characterized in that: The TTL to 232 circuit is a TTL to 232 chip.
7. The circuit for converting a USB interface into multiple serial communication interfaces according to claim 6, characterized in that: The model of the TTL to 232 chip is MAX3232ID, the 11th pin of the TTL to 232 chip is electrically connected to one end of the USB to TTL circuit for outputting TTL signals, the 12th pin of the TTL to 232 chip is electrically connected to one end of the USB to TTL circuit for inputting TTL signals, the 13th pin of the TTL to 232 chip is used to input RS232 signals, and the 14th pin of the TTL to 232 chip is used to output RS232 signals.
8. The circuit for converting a USB interface into multiple serial communication interfaces according to claim 7, characterized in that: A capacitor is arranged between the 15th pin and the 16th pin of the TTL to 232 chip.
9. The circuit for converting a USB interface into multiple serial communication interfaces according to claim 1, characterized in that: The TTL to 485 circuit is a TTL to 485 chip.
10. The circuit for converting a USB interface into multiple serial communication interfaces according to claim 9, characterized in that: The model of the TTL-to-485 chip is SP3485EEN, the first pin of the TTL-to-485 chip is electrically connected to one end of the USB-to-TTL circuit for inputting TTL signals, the fourth pin of the TTL-to-485 chip is electrically connected to one end of the USB-to-TTL circuit for outputting TTL signals, and the sixth and seventh pins of the TTL-to-485 chip are used to output or input RS485 signals.