All-in-one serial port chip

By designing an all-in-one serial port chip, combining RS232, RS485, and RS422 serial port chips with digital switches, the problem of frequent chip replacement was solved, achieving flexible function switching and efficient device adaptability.

CN223526707UActive Publication Date: 2025-11-07SHANGHAI DONGTU ZHIYUAN INTELLIGENT TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202423154190.0
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-11-07
Estimated Expiration
2034-12-19

AI Technical Summary

Technical Problem

Existing technologies require the preparation of multiple serial port chips, and the chips are frequently replaced to achieve different interface functions depending on the required functions.

Method used

Design an all-in-one serial port chip, including an RS232 serial port chip, an RS485 serial port chipset, and a digital switch. By controlling the digital switch, the functions of the RS232, RS485, and RS422 serial port chips can be switched, avoiding frequent chip replacements.

Benefits of technology

It enables flexible control of the chip, allowing for multiple functional requirements to be met without frequent chip replacements in different scenarios, thus improving the flexibility and efficiency of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN223526707U_ABST
    Figure CN223526707U_ABST
Patent Text Reader

Abstract

The utility model relates to an all-in-one serial port chip. The chip comprises an RS232 serial port chip, an RS485 serial port chip set and a digital switch, and the RS485 serial port chip set comprises two RS485 serial port chips. The digital switch is connected with the transmitting end and the receiving end of the processor, and the digital switch is selectively conducted with the RS232 serial port chip or the RS485 serial port chip set. The technical problems that multiple chips need to be prepared in special scenes, and the chips are frequently replaced according to different needed functions are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of chips, in particular to a multi-in-one serial port chip. BACKGROUND

[0002] At present, the serial port gateway is mostly used to gather the lowest layer sensor data in the industrial environment, and is divided into three different serial ports according to the characteristics of the sensor itself and the different use scenarios, that is, RS232, RS485 and RS422, which correspond to RS232 chip, RS485 chip and RS422 chip.

[0003] However, in the prior art, the hardware interface required for different scenarios is different, so that three kinds of chips mentioned above need to be prepared for some scenarios to realize the interface function of each chip respectively, and if the required functions are different, the chips need to be replaced. SUMMARY

[0004] The present application provides a multi-in-one serial port chip to solve the technical problem that multiple chips need to be prepared in special scenarios, and the chips need to be frequently replaced according to different required functions.

[0005] The present application provides a multi-in-one serial port chip, which comprises an RS232 serial port chip, an RS485 serial port chip group and a digital switch, wherein the RS485 serial port chip group comprises two RS485 serial port chips; the digital switch is connected with the sending end and the receiving end of a processor, and selectively conducts with the RS232 serial port chip or the RS485 serial port chip group.

[0006] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: the scheme provided by the embodiment of the present application comprises the RS232 serial port chip, the RS485 serial port chip group and the digital switch to form the multi-in-one serial port chip, wherein the RS485 serial port chip group comprises two RS485 serial port chips; when the digital switch is connected with the RS232 serial port chip, the multi-in-one serial port chip executes the function of the RS232 serial port chip; when the digital switch is connected with the RS485 serial port chip group, according to the receiving and sending states of the two RS485 serial port chips in the RS485 serial port chip group, it is determined that the multi-in-one serial port chip executes the function of the RS485 serial port chip or executes the function of the RS422 serial port chip, so that one multi-in-one serial port chip can be formed by combining the RS232 serial port chip and the two RS485 serial port chips, and the functions of the RS232 serial port chip, the RS485 serial port chip and the RS422 serial port chip can be realized by control, so that the required chips do not need to be frequently replaced in the demand scenario, and the flexible control effect of the chips is realized. BRIEF DESCRIPTION OF DRAWINGS

[0007] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.

[0008] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the accompanying drawings required to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, those skilled in the art can obtain other drawings according to these drawings without any creative effort.

[0009] One or more embodiments are illustrated by way of example in the drawings in which like reference numerals indicate similar elements, and as such, cross-referencing with the drawings should be undertaken to appreciate vari ous embodiments thereof in which:

[0010] Figure 1 A schematic diagram of a multi-in-one serial port chip is provided for the embodiments of the present application;

[0011] Figure 2 A control logic diagram of a multi-in-one serial port chip is provided for the embodiments of the present application;

[0012] Figure 3 A pin diagram of a multi-in-one serial port chip is provided for the embodiments of the present application;

[0013] Figure 4 A schematic diagram of a RS485 serial port chip is provided for the embodiments of the present application;

[0014] Figure 5 A schematic diagram of a RS232 serial port chip is provided for the embodiments of the present application;

[0015] Figure 6 A schematic diagram of a digital switch chip is provided for the embodiments of the present application;

[0016] Figure 7 A control logic diagram of a digital switch is provided for the embodiments of the present application;

[0017] Figure 8 A circuit diagram of two RS485 serial port chips is provided for the embodiments of the present application;

[0018] Figure 9 A schematic diagram of a RS232 chip supporting shutdown is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0019] In order to make the purposes, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present application.

[0020] The following disclosure provides many different embodiments, or examples, for implementing different structures of the present application. For the purpose of simplicity, the elements and settings of particular examples in the following description are shown in great detail. Of course, they are merely examples and are presented to illustrate the application. There is no intent to limit the application to these examples. In addition, the application can be implemented in different examples with variations as to the elements and settings. Such variations are meant to be within the scope of the application.

[0021] In order to solve the technical problem that a plurality of chips need to be prepared in the prior art, and the chips are frequently replaced according to different required functions, the present application provides a multi-in-one serial port chip, which can achieve the effect of flexible control of the chip.

[0022] Figure 1 A component composition diagram of a multi-in-one serial port chip provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, it includes: Figure 1

[0023] an RS232 serial port chip 102, an RS485 serial port chip group 104, and a digital switch 106. The RS485 serial port chip group includes two RS485 serial port chips. In the embodiments, one way is that the digital switch is connected with the sending end and the receiving end of the processor, and the digital switch is selectively connected with the RS232 serial port chip or the RS485 serial port chip group.

[0024] Optionally, the embodiments combine a plurality of serial port chips into a multi-in-one serial port chip which can realize different chip functions through control. The RS232 serial port chip and the two RS485 serial port chips are combined to obtain the multi-in-one serial port chip. The multi-in-one serial port chip can be switched between the functions of the RS232 serial port chip, the RS485 serial port chip, and the RS422 serial port chip through control. Therefore, not only the effect of realizing the functions of three serial port chips by using two serial port chips of the RS232 serial port chip and the RS485 serial port chip is achieved, but also which function of the three serial port chips is specifically realized can be changed through control, which is very flexible, and the chip needs to be replaced in a specific scene to realize the operation of the function corresponding to the chip.

[0025] ​For the above-mentioned serial port chip, RS232 serial port chip, RS422 serial port chip, RS485 serial port chip and other interface standards are different in communication distance and speed. For example, the maximum transmission distance standard value of RS232 serial port chip is 15 meters, and it can only communicate point to point, and the maximum transmission rate is 20 kB / s. In contrast, RS485 serial port chip and RS422 serial port chip support longer transmission distance, and the maximum wireless transmission distance can reach 1200 meters, and the maximum transmission rate is 10 Mbps.

[0026] Although the function of the RS422 serial port chip is provided in this embodiment, it is not necessary to prepare the RS422 serial port chip, but to use two RS485 serial port chips to realize the function of the RS422 serial port chip or the function of the RS485 serial port chip through the control of the two.

[0027] In this embodiment, the digital switch can determine whether the multi-in-one serial port chip provides the function of the RS232 serial port chip through control. If the RS232 serial port chip function is provided, the functions of the RS485 serial port chip and the RS422 serial port chip are not provided. If the multi-in-one serial port chip does not provide the function of the RS232 serial port chip, the function can be provided through the RS485 serial port chip group, and the RS485 serial port chip group can determine to provide the function of the RS485 serial port chip or the function of the RS422 serial port chip according to the receiving and transmitting state of the chips in the group.

[0028] In one embodiment, when the digital switch is connected with the RS232 serial port chip and disconnected with the RS485 serial port chip group, the serial port chip realizes the function of the RS232 serial port chip; when the digital chip is disconnected with the RS232 serial port chip and connected with the RS485 serial port chip group, the serial port chip realizes the function of the RS485 serial port chip or the RS422 serial port chip.

[0029] Figure 2 is a schematic diagram of this embodiment. As shown in Figure 2 The transistor-transistor logic (TTL) signal (TX) and (RX) of the central processing unit (CPU) or microcontroller unit (MCU) is decided by the digital switch to enter the RS232 serial port chip or the RS485 serial port chip. The RS485 serial port chip is a pair, one of which is in a fixed state, and the state of the other is adjusted to decide whether the two RS485 serial port chips execute the function of the RS485 serial port chip or the function of the RS422 serial port chip.

[0030] The scheme provided in the embodiment of the application is composed of an RS232 serial port chip, an RS485 serial port chip group and a digital switch, wherein the RS485 serial port chip group comprises two RS485 serial port chips; when the digital switch is connected with the RS232 serial port chip, the multi-in-one serial port chip executes the function of the RS232 serial port chip; when the digital switch is connected with the RS485 serial port chip group, according to the transmitting and receiving states of the two RS485 serial port chips in the RS485 serial port chip group, it is determined whether the multi-in-one serial port chip executes the function of the RS485 serial port chip or the function of the RS422 serial port chip, so that one multi-in-one serial port chip composed of the RS232 serial port chip and the two RS485 serial port chips can be realized, and the functions of the RS232 serial port chip, the RS485 serial port chip or the RS422 serial port chip can be realized through control, so that the required chip does not need to be frequently replaced in the required scene, and the effect of flexible control of the chip is realized.

[0031] As an optional example, the digital switch comprises four enable pins, each of which comprises an input channel and an output channel below the enable pin, and the enable pin is used to control whether the input channel and the output channel below the enable pin are turned on or not; the multi-in-one serial port chip composed of the RS232 serial port chip, the RS485 serial port chip group and the digital switch comprises that, among the four enable pins, two enable pins are connected with a first control signal input end, and the other two enable pins are connected with a second control signal input end; among the two enable pins connected with the first control signal input end, the input channel of the first enable pin is connected with the transmitting end of the CPU, the output channel of the first enable pin is connected with the receiving end of the RS232 serial port chip, the input channel of the second enable pin is connected with the transmitting end of the RS232 serial port chip, and the output channel of the second enable pin is connected with the receiving end of the CPU; among the two enable pins connected with the second control signal input end, the input channel of the third enable pin is connected with the transmitting end of the CPU, the output channel of the third enable pin is connected with the receiving end of the RS485 serial port chip group, the input channel of the fourth enable pin is connected with the transmitting end of the RS485 serial port chip group, and the output channel of the fourth enable pin is connected with the transmitting end of the CPU.

[0032] In the embodiment, the digital switch described above is a digital chip, and the digital chip comprises a plurality of pins, including at least four enable pins, and each of the four enable pins controls an input channel and an output channel. One enable pin and the input channel and the output channel below the enable pin can be regarded as a group.

[0033] The first control signal input end and the second control signal input end described above can be input ends of high voltage or low voltage, and are connected with the enable pins, so as to control the input channel and the output channel below the enable pin to be turned on or not by inputting high voltage or low voltage to the enable pins.

[0034] In one example, of the four enable pins mentioned above, two enable pins are connected to the first control signal input terminal, and the other two enable pins are connected to the second control signal input terminal. That is, the signal at the first control signal input terminal simultaneously controls two enable pins, allowing both enable pins to be either simultaneously on or simultaneously off. Similarly, the signal at the second control signal input terminal simultaneously controls the other two enable pins, allowing the other two enable pins to be either simultaneously on or simultaneously off. In this embodiment, there may also be four control signal input terminals, each connected to one enable pin. Thus, by inputting a high or low voltage to the enable pin, the four control signal input terminals control the input or output channel under the enable pin to be on or off.

[0035] In one example, of the two enable pins connected to the first control signal input terminal, the input channel of the first enable pin is connected to the CPU's transmitting end, and the output channel of the first enable pin is connected to the receiving end of the RS232 serial port chip. The input channel of the second enable pin is connected to the transmitting end of the RS232 serial port chip, and the output channel of the second enable pin is connected to the CPU's receiving end. Conversely, of the two enable pins connected to the second control signal input terminal, the input channel of the third enable pin is connected to the CPU's transmitting end, and the output channel of the third enable pin is connected to the receiving end of the RS485 serial port chip. The input channel of the fourth enable pin is connected to the transmitting end of the RS485 serial port chip, and the output channel of the fourth enable pin is connected to the CPU's transmitting end.

[0036] For example, such as Figure 3 As shown, Figure 3 This is a pin diagram of a chip, where pins 1, 4, 10, and 13 are four enable pins. Each enable pin corresponds to an A pin and a B pin. Pin A is the input channel, and pin B is the output channel. The enable pins control whether pins A and B are active. Figure 3 Pins 1 and 13, the two enable pins, are connected to the first control signal input terminal RS485_RS422_RS232_IO1. The input channel under pin 1 is connected to UR1TXD, the CPU's transmitting end, and the output channel under pin 1 is connected to UR1TXD_232_T, the RS232 serial port chip's receiving end. Similarly, the input channel under pin 13 is connected to UR1TXD_232_T, the RS232 serial port chip's transmitting end, and the output channel under pin 13 is connected to UR1TXD, the CPU's receiving end. In other words, if pins 1 and 13 are low, the CPU and the RS232 serial port chip are connected. Pins 4 and 10 are connected to the RS484 serial port chipset. If pins 4 and 10 are low, the CPU is connected to the RS484 serial port chipset to execute the functions of either the RS484 or RS422 serial port chip.

[0037] As an optional example, when the first control signal input end is low, the second control signal input end is high, the digital switch connects the RS232 serial port chip; when the first control signal input end is high, the second control signal input end is low, the digital switch connects the RS485 serial port chip set.

[0038] Continue to combine Figure 3 The example is explained. In Figure 3 The connection relationship, through the high voltage or low voltage input by the first control signal input end, whether the signal sent by the sending end of the CPU can be given to the receiving end of the RS232 serial port chip, and whether the signal of the sending end of the RS232 serial port chip can be given to the receiving end of the CPU can be controlled. By inputting high voltage or low voltage through the second control signal input end, whether the signal sent by the sending end of the CPU can be given to the receiving end of the RS485 serial port chip set, and whether the signal sent by the sending end of the RS485 serial port chip set can be given to the receiving end of the CPU can be controlled. If it is 4 control signal input ends, the on-off of one enable pin can be controlled by the high voltage or low voltage of each control signal input end. If the signal sent by the sending end of the CPU can be given to the receiving end of the RS485 serial port chip set, and the signal sent by the sending end of the RS485 serial port chip set can be given to the receiving end of the CPU, the enable pins corresponding to the input channels and output channels of the CPU and the RS485 serial port chip set need to be low voltage, and the remaining two enable pins need to be high voltage. If the signal sent by the sending end of the CPU can be given to the receiving end of the RS232 serial port chip, and the signal sent by the sending end of the RS232 serial port chip can be given to the receiving end of the CPU, the enable pins corresponding to the input channels and output channels of the CPU and the RS232 serial port chip need to be low voltage, and the remaining two enable pins need to be high voltage.

[0039] As an optional example, when the digital switch connects the RS485 serial port chip set, according to the receiving and transmitting state of the two RS485 serial port chips in the RS485 serial port chip set, it is determined that the multi-in-one serial port chip executes the function of the RS485 serial port chip or executes the function of the RS422 serial port chip. The receiving and transmitting state of one of the two RS485 serial port chips in the RS485 serial port chip set is set to a fixed state, wherein the fixed state is one of the receiving state or the transmitting state; when the receiving and transmitting state of the other RS485 serial port chip in the two RS485 serial port chips is the other state corresponding to the fixed state, it is determined that the multi-in-one serial port chip executes the function of the RS422 serial port chip.

[0040] In the embodiment, one RS485 serial port chip set includes two RS485 serial port chips, one of which is set to a fixed state, which is one of a sending state or a receiving state. For the RS485 serial port chip, if it is to work normally, it must be set to a half-duplex communication state, which has both a sending state and a receiving state, so that it can send and receive data. If the RS485 serial port chip is set to one of the sending state or the receiving state, the state of the RS485 serial port chip cannot implement sending and receiving, but only sending or receiving data, which cannot work normally to implement data transmission and reception. Therefore, one RS485 serial port chip is set to a fixed state, and the other RS485 serial port chip is set to the other state corresponding to the fixed state, that is, one RS485 serial port chip is set to a sending state and the other is set to a receiving state, so that the two RS485 serial port chips form a combination of a sending state and a receiving state, form an RS422 serial port chip, and can implement the function of an RS422 serial port chip.

[0041] As an optional example, when the digital switch connects the RS485 serial port chip set, according to the transmission and reception states of the two RS485 serial port chips in the RS485 serial port chip set, it is determined that the multi-in-one serial port chip executes the function of the RS485 serial port chip or executes the function of the RS422 serial port chip. It can be that the transmission and reception state of one of the two RS485 serial port chips in the RS485 serial port chip set is set to a fixed state, wherein the fixed state is one of a receiving state or a sending state; when the transmission and reception state of the other RS485 serial port chip in the two RS485 serial port chips is a half-duplex communication state having both a sending state and a receiving state, it is determined that the multi-in-one serial port chip executes the function of the RS485 serial port chip.

[0042] In the embodiment, one RS485 serial port chip set includes two RS485 serial port chips, one of which is set to a fixed state, which is one of a sending state or a receiving state. For the RS485 serial port chip, if it is to work normally, it must be set to a half-duplex communication state, which has both a sending state and a receiving state, so that it can send and receive data. If the RS485 serial port chip is set to one of the sending state or the receiving state, the state of the RS485 serial port chip cannot implement sending and receiving, but only sending or receiving data, which cannot work normally to implement data transmission and reception. By setting the state of one RS485 serial port chip to a fixed state so that it cannot work alone, and setting the state of the other RS485 serial port chip to a half-duplex communication state, which has both a sending state and a receiving state, so that it can send and receive data, it can work alone. Therefore, one RS485 serial port chip cannot work normally, and one RS485 serial port chip works normally, so as to realize the function of the RS485 serial port chip.

[0043] As an optional example, the RS232 serial port chip is an RS232 serial port chip including a control pin, wherein when the multi-in-one serial port chip is connected to a DB9 interface and the multi-in-one serial port chip performs the function of the RS485 serial port chip or performs the function of the RS422 serial port chip, the RS232 serial port chip is closed through the control pin.

[0044] In the embodiment, if the physical interface connected by the multi-in-one serial port chip is a DB9 interface, since the DB9 interface is a standardized interface, there is a case where the RS232 serial port chip and the RS485 serial port chip share the same physical line, and mutual occupation may occur. Therefore, the RS232 serial port chip uses a serial port chip with a control pin, so that when the multi-in-one serial port chip performs the function of the RS485 serial port chip or performs the function of the RS422 serial port chip, the RS232 serial port chip is closed through the control pin, avoiding the occupation of the physical line by the RS232 serial port chip. If the physical interface connected by the multi-in-one serial port chip is not a DB9 interface, it is checked whether there is a case where the RS232 serial port chip and the RS485 serial port chip share the same physical line. If there is no such case, an RS232 serial port chip without a control pin can be used.

[0045] As an optional example, the RS232 serial port chip, the RS485 serial port chip group and the digital switch are all pluggable and replaceable on the multi-in-one serial port chip. The RS485 serial port chip group and the digital switch on the multi-in-one serial port chip can be replaced by resistors, wherein the multi-in-one serial port chip after the replacement performs the function of the RS232 serial port chip. The RS232 serial port chip and the digital switch on the multi-in-one serial port chip can be replaced by resistors, wherein the multi-in-one serial port chip after the replacement performs the function of the RS485 serial port chip or the function of the RS422 serial port chip.

[0046] In the embodiment, the RS232 serial port chip, the RS485 serial port chip group and the digital switch are connected in a pluggable manner. If the three-in-one serial port chip is needed, the RS232 serial port chip, the RS485 serial port chip group and the digital switch are connected. If only the function of the RS232 serial port chip is needed, the RS485 serial port chip can be replaced by a resistor. If only the function of the RS485 serial port chip or the function of the RS422 serial port chip is needed, the RS232 serial port chip can be replaced by a resistor.

[0047] Figure 4 is a schematic diagram of an RS485 serial port chip in the embodiment. The RS485 chip has the following pins: RO (pin 1, receiving pin, connected to CPU RXD), #RE (pin 2, receiving enable pin, low level effective, enabling the chip to enter the receiving state), DE (pin 3, sending enable pin, high level effective, enabling the chip to enter the sending state), DI (pin 4, sending pin, connected to CPU TXD), GND (pin 5), A (+) (pin 6), B (-) (pin 7), VCC (pin 8). The RS422 chip in the embodiment is a combination of two RS485 chips, one of which is always in a receiving state (#RE is pulled low, DE is pulled low), and the other chip is always in a sending state (#RE is pulled high, DE is pulled high). A switch chip is needed for the TTL end (serial port chip to CPU end) to control the data flow.

[0048] Figure 5 is a schematic diagram of an RS232 serial port chip in the embodiment. The RS232 chip with an enable control pin is selected because the RXD pin in the standard DB9 serial port sequence RS232 is connected to the D- pin in the RS485, which can easily cause mutual interference during communication and affect the communication quality. Therefore, the selected RS232 chip needs to have a control pin (such as Figure 5Pin 16 in the UM3221E can control the chip to shut down. For example, the #SHDN (Shut off Pump Power and Transmitters Activelow) and #EN pins of the UM3221E can be turned off when RS232 is not in use. This operation will turn off the voltage pump inside the RS232 chip, so that the RS232 chip will not have voltage affecting the communication on the line.

[0049] A digital switch can be a digital switch chip used to switch signals on the TTL side. Figure 6 This is a schematic diagram of a digital switch chip, where the Y pin is connected to... Figure 3 The B pin in the diagram corresponds to the output channel. Figure 6 The digital switch includes four enable pins: pin 1, pin 4, pin 10, and pin 13. The control logic of the digital switch is as follows: Figure 7 As shown. When connected to an RS232 serial port chip, it executes the functions of the RS232 serial port chip; when connected to an RS485 serial port chip, it executes the functions of either the RS485 or RS422 serial port chip. The specific control logic allows the enable pin (#OE) to control whether the TTL signal enters the RS232 or RS485 chip, as shown. Figure 3 and Figure 6 As shown, when the RS485_RS422_RS232_IO1 signal is low, the transistor is not conducting, and RS485_Ctr1 is high. These two signals correspond to the control pins of the RS4G125 chip. At this time, the CPU-side TTL signal UR1TXD enters Y1 through channel A1. Because RS485_Ctr1 is high, pin A2 cannot connect to pin Y2. Therefore, the TX signal enters the RS232 chip instead of the RS485 chip. If the RS485_RS422_RS232_IO1 signal is high and RS485_Ctr1 is low, then the CPU-side TTL signal UR1TXD enters the RS485 serial port chipset. This step achieves the first stage of signal selection, determining whether the TTL signal enters the RS232 chip or the RS485 chip.

[0050] For the switching of RS485 and RS422 signals, according to the electrical characteristics of RS422 (RS422 is two pairs of differential lines, full duplex, can be regarded as two RS485, a chip is always in the receiving state, a chip is always in the sending state), when the mode is switched to RS422, one of the two RS485 chips in the RS485 group is controlled to send mode (i.e. TX+, TX- in RS422), and the other RS485 is controlled to receive mode (i.e. RX+, RX- in RS422). This design can combine two normal RS485 into one RS422, that is, two RS485 can work independently, and also can be combined into one RS422 interface. In this example, for the special form of DB9 interface (RS485 will only have one normal work), the design makes one of the RS485 group enter a fixed mode (for example, to enter the sending mode), and the RS485 chip in the fixed mode cannot work independently. Figure 8 The circuit diagram of two RS485 serial port chips, including U24 and U25 two chips, when using the function of RS485 serial port chip, control the TTL data into chip U24, control U24 into receiving mode, then the chip will ignore TX data, only receive data.

[0051] Due to the problem of RS232 and RS485 common line in the line sequence of DB9 interface (i.e. the serial port uses the same physical line in different modes, for the regular DB9 pin definition, the RXD pin of RS232 and the D- pin of RS485 are the same pin), although the two serial port modes are not used at the same time, due to the difference between the two levels, the common line pin will have serious interference when communicating, and even cannot communicate (design test, mainly the RX pin of RS232 in RS485 mode will affect the D- of 485 data, and the D- pin of RS485 in RS232 mode has almost no effect on the RX pin of 232), therefore, if you want to use DB9 interface, you can design to process the RS232 chip when using RS485 mode, so that it enters a "shutdown" state, by using the RS232 chip that supports shutdown, that is, to solve the above common line problem. Figure 9 It is a schematic diagram of an RS232 chip that supports shutdown.

[0052] Those skilled in the art can clearly understand the implementation of the embodiments by the description of the above embodiments. The embodiments can be implemented by means of software plus a general hardware platform, and of course, can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in terms of related art, can be embodied in the form of a software product, and the computer software product can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0053] It is to be understood that the terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises", "comprising", "includes", "including" and "has" are inclusive and therefore specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring their performance in the particular order in which they are described unless specifically indicated as such. It is also to be understood that additional or alternative steps can be employed.

[0054] The above description is merely that of specific embodiments of the present application, making it possible for those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the application. Accordingly, the present application is not to be limited to the embodiments illustrated herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A multi-in-one serial port chip, characterized in that, The application relates to a multi-in-one serial port chip. The multi-in-one serial port chip comprises an RS232 serial port chip, an RS485 serial port chip group and a digital switch. The digital switch is connected with a sending end and a receiving end of a processor, and selectively conducts with the RS232 serial port chip or the RS485 serial port chip group.

2. The multi-serial port chip of claim 1, wherein, The digital switch comprises four enable pins, and each enable pin comprises an input channel and an output channel.

3. The multi-purpose serial port chip of claim 2, wherein, In the four enable pins, two enable pins are connected with a first control signal input end, and the other two enable pins are connected with a second control signal input end.

4. The multi-purpose serial port chip of claim 3, wherein, In the two enable pins connected with the first control signal input end, an input channel of a first enable pin is connected with a sending end of a CPU, and an output channel of the first enable pin is connected with a receiving end of the RS232 serial port chip.

5. The all-in-one serial port chip of claim 1, wherein, In the two enable pins connected with the second control signal input end, an input channel of a third enable pin is connected with a sending end of a CPU, and an output channel of the third enable pin is connected with a receiving end of the RS485 serial port chip group.

6. The multi-serial port chip of claim 1, wherein, When the first control signal input end is at a low level and the second control signal input end is at a high level, the digital switch is connected with the RS232 serial port chip.

7. The all-in-one serial port chip of claim 1, wherein, When the first control signal input end is at a high level and the second control signal input end is at a low level, the digital switch is connected with the RS485 serial port chip group.

8. The multi-serial port chip of claim 1, wherein, In the two RS485 serial port chips in the RS485 serial port chip group, a receiving state or a sending state of one RS485 serial port chip is a fixed state, and a state of the other RS485 serial port chip is the other state corresponding to the fixed state.

9. The multi-purpose serial port chip of claim 8, wherein, In the two RS485 serial port chips in the RS485 serial port chip group, a receiving state or a sending state of one RS485 serial port chip is a fixed state, and a state of the other RS485 serial port chip is a half-duplex communication state having both the sending state and the receiving state.

10. The multi-purpose serial port chip of claim 8, wherein, The RS232 serial port chip is an RS232 serial port chip comprising a control pin. The RS232 serial port chip, the RS485 serial port chip group and the digital switch on the multi-in-one serial port chip are replaceable. The RS485 serial port chip group and the digital switch on the multi-in-one serial port chip are replaced by resistors. The RS232 serial port chip and the digital switch on the multi-in-one serial port chip are replaced by resistors.