Serial port three-in-one interface circuit, control method thereof and serial port system chip

CN116303205BActive Publication Date: 2026-08-28深圳市三旺通信股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310279674.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2026-08-28
Estimated Expiration
2043-03-14

AI Technical Summary

Technical Problem

[0004]然而,上述做法会存在很多问题,例如,(1)接线端子的引脚数量会比较多(至少需要选择具备12个引脚的连接器端子),接线端子的体积会比较大,不利于设备的小型化和高密度化

Benefits of technology

[0022]本申请的串口三合一接口电路通过在RS422发送数据模块、RS485收发器模块、RS232收发器模块的基础上,增加电平型发送选择电路、第一接收选择电路、第二接收选择电路、复用接收信号电路几个电路,且设计共用的串口接线端,通过结合三个控制信号的组合使用来实现串口控制器与不同通讯模式的对端设备之间的串口通讯。针对该串口三合一接口电路,在满足三种通讯工作模式的条件下,相比现有的各种串口模式下所有信号全部单独引出的方案,可有效减少接线端的引脚数量,减小了接线端的体积,从而便于提高设备的小型化和高密度化程度;而且,使用相同线缆,现场信号接线简单,根据现场需要工作在哪种模式,只需要软件上切换模式即可。此外,通过上述的信号选择电路进行切换,可以很好地保证信号物理上的隔离,进而保证信号传输的稳定性等。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303205B_ABST
    Figure CN116303205B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of electronic circuits, and discloses a serial port three-in-one interface circuit, a control method thereof and a serial port system chip, the circuit comprising an RS422 data sending module, an RS485 transceiver module, an RS232 transceiver module, a level type sending selection circuit, a first receiving selection circuit, a second receiving selection circuit, a multiplexed receiving signal circuit and a serial port wiring terminal; the circuit is used for realizing serial port communication between a serial port controller and a peer device in different communication modes according to different combinations of three control signals configured at control ends of corresponding modules or circuits. The realization of the serial port three-in-one reduces the pin number and volume of the wiring terminal and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic circuit technology, and in particular to a serial port three-in-one interface circuit, its control method, and a serial port system chip. Background Technology

[0002] Serial bus communication protocols are widely used in many fields such as industrial control, instrumentation, multimedia networks, and mechatronics. Currently, the main interface standards used for serial communication include RS232, RS485, and RS422. RS232 is the earliest serial interface standard, generally using a 3-wire or 8-wire system and full-duplex communication mode, suitable for short-distance, low-baud-rate communication scenarios. Later, to overcome problems such as short transmission distances, the RS485 / RS422 interface standards were proposed based on the RS232 standard. The RS485 interface standard uses a half-duplex communication mode and a 2-wire differential transmission method; while RS422 uses a full-duplex communication mode and a 4-wire differential transmission method. In other words, these interface standards use different wire transmission methods.

[0003] In practical industrial applications, the form of external devices is not fixed; some require RS232 communication, while others require RS484 / RS422 communication. To enable communication in all modes, manufacturers typically provide separate signal lines for each communication mode to the same connector terminal, and then select different pins and cables based on the different communication modes of the peer device.

[0004] However, the above approach has many problems, such as: (1) the number of pins on the terminal block will be relatively large (at least 12 pins of connector terminal block should be selected), the size of the terminal block will be relatively large, which is not conducive to the miniaturization and high density of the equipment. (2) the transmitting and receiving signals are not physically isolated. When transmitting signals, RS232 and RS485 / RS422 level signals will send data to the other end at the same time. (3) different terminal blocks are selected according to different communication modes, and the wiring method is relatively complicated. (4) if communication cables with different numbers of wire cores are selected, it is not conducive to the standardization of cables. If cables with uniform wire cores are used, the cables will be relatively thick due to the large number of wire cores, which is not conducive to on-site wiring, etc. Summary of the Invention

[0005] In view of this, embodiments of this application provide a serial port three-in-one interface circuit and its control method, as well as a serial port system chip.

[0006] In a first aspect, embodiments of this application provide a serial port three-in-one interface circuit, including: an RS422 data transmission module, an RS485 transceiver module, an RS232 transceiver module, a level-type transmission selection circuit, a first reception selection circuit, a second reception selection circuit, a multiplexed reception signal circuit, and a serial port terminal.

[0007] The level-type transmit selection circuit is connected to the RS422 transmit data module and the RS485 transceiver module respectively; the RS422 transmit data module is connected to the serial port terminal;

[0008] The RS485 transceiver module is connected to the first receive selection circuit, the second receive selection circuit, and the multiplexed receive signal circuit, respectively; the first receive selection circuit and the second receive selection circuit are also connected to the serial port terminal, respectively.

[0009] The RS232 transceiver module is connected to the first receive selection circuit, the second receive selection circuit, the multiplexed receive signal circuit, and the serial port terminal, respectively.

[0010] The level-type transmit selection circuit, the multiplexed receive signal circuit, and the RS232 transceiver module are respectively used to connect to the same serial port controller, and the serial port terminal is used to connect to the other end device;

[0011] The RS422 data transmission module, the RS232 transceiver module, the first receive selection circuit, and the second receive selection circuit are all configured to input a first control signal; the level-type transmit selection circuit is configured to input a second control signal; and the RS485 transceiver module is configured to input a third control signal.

[0012] The serial port three-in-one interface circuit is used to realize serial communication between the serial port controller and the peer device with different communication modes according to different combinations of the first control signal, the second control signal and the third control signal.

[0013] Secondly, embodiments of this application provide a control method for a serial port three-in-one interface circuit, applied to the aforementioned serial port three-in-one interface circuit, the method comprising:

[0014] When the serial port three-in-one interface circuit needs to be configured to work in RS232 communication mode, the first control signal, the second control signal and the third control signal are controlled to be high level, low level and low level respectively;

[0015] When the serial port three-in-one interface circuit needs to be configured to work in RS422 communication mode, the first control signal, the second control signal and the third control signal are controlled to be low level, low level and low level respectively;

[0016] When the serial port three-in-one interface circuit needs to be configured to work in RS485 communication mode, the first control signal and the second control signal are controlled to be low level and high level respectively, and when data needs to be sent, the third control signal is controlled to be high level, and when data needs to be received, the third control signal is controlled to switch to low level.

[0017] Thirdly, embodiments of this application provide a serial port system chip, including: a processor, a serial port controller, and the aforementioned serial port three-in-one interface circuit;

[0018] The processor and the serial port controller are both connected to the serial port three-in-one interface circuit;

[0019] The processor is used to generate first to third control signals so that the serial port three-in-one interface circuit can realize serial communication between the serial port controller and the peer device with different communication modes according to different combinations of the first to third control signals.

[0020] Fourthly, embodiments of this application provide a terminal device, which includes the aforementioned serial port system chip.

[0021] The embodiments of this application have the following beneficial effects:

[0022] This application's three-in-one serial port interface circuit, based on an RS422 data transmission module, an RS485 transceiver module, and an RS232 transceiver module, adds several circuits: a level-type transmit selection circuit, a first receive selection circuit, a second receive selection circuit, and a multiplexed receive signal circuit. It also uses a shared serial port terminal. By combining three control signals, it achieves serial communication between the serial port controller and peer devices in different communication modes. Compared to existing solutions where all signals are individually brought out for various serial port modes, this three-in-one serial port interface circuit effectively reduces the number of pins on the terminal and decreases the terminal's size, thus facilitating miniaturization and high-density design of the device. Furthermore, using the same cable simplifies field signal wiring; the required operating mode can be switched via software. In addition, the signal selection circuit ensures good physical isolation of signals, thereby guaranteeing signal transmission stability. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This paper shows a schematic diagram of the structure of the serial port three-in-one interface circuit according to an embodiment of this application;

[0025] Figure 2 This paper shows a circuit design diagram of a serial port three-in-one interface circuit according to an embodiment of this application;

[0026] Figure 3 A flowchart illustrating the control method of the serial port three-in-one interface circuit according to an embodiment of this application is shown;

[0027] Figure 4 A schematic diagram of the serial port system chip according to an embodiment of this application is shown.

[0028] Explanation of key component symbols:

[0029] 100 - Serial port three-in-one interface circuit; 110 - RS422 data transmission module; 120 - RS485 transceiver module; 130 - RS232 transceiver module; 140 - Level-type transmit selection circuit; 150 - First receive selection circuit; 160 - Second receive selection circuit; 170 - Multiplexed receive signal circuit; 180 - Serial port terminal; 200 - Serial port controller; 300 - Processor; 10 - Serial port system chip. Detailed Implementation

[0030] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0031] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0032] In the following text, the terms "comprising," "having," and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more combinations thereof. Furthermore, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.

[0033] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.

[0034] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0035] Considering that actual field devices may support different serial communication modes, and existing solutions mainly extract all signals under various possible serial modes separately, not only does this result in a large wiring terminal, but the inability to physically isolate the transmitting and receiving signals can also affect the reliability of signal transmission. Therefore, this application proposes a circuit design that integrates three serial ports into one, which enables serial communication with peer devices supporting different communication modes through the same serial port controller 200, effectively solving some of the problems existing in the current solution.

[0036] The serial port three-in-one interface circuit 100 and its control method of this application will be described in detail below.

[0037] Figure 1 A schematic diagram of a serial port three-in-one interface circuit 100 according to an embodiment of this application is shown. Exemplarily, the serial port three-in-one interface circuit 100 includes an RS422 data transmission module 110, an RS485 transceiver module 120, an RS232 transceiver module 130, a level-type transmit selection circuit 140, a first receive selection circuit 150, a second receive selection circuit 160, a multiplexed receive signal circuit 170, and a serial port terminal 180.

[0038] Specifically, the level-type transmit selection circuit 140 is connected to the RS422 transmit data module 110 and the RS485 transceiver module 120 respectively; the RS422 transmit data module 110 is connected to the serial port terminal 180; the RS485 transceiver module 120 is connected to the first receive selection circuit 150, the second receive selection circuit 160 and the multiplexed receive signal circuit 170 respectively; the first receive selection circuit 150 and the second receive selection circuit 160 are also connected to the serial port terminal 180 respectively; the RS232 transceiver module 130 is connected to the first receive selection circuit 150, the second receive selection circuit 160, the multiplexed receive signal circuit 170 and the serial port terminal 180 respectively; the level-type transmit selection circuit 140, the multiplexed receive signal circuit 170 and the RS232 transceiver module 130 are used to connect to the same serial port controller 200, and the serial port terminal 180 is used to connect to the other end device.

[0039] It can be understood that the serial port three-in-one interface circuit 100, composed of the above modules or circuits, is mainly used to realize serial communication between the serial port controller 200 and the connected peer device. The peer device can be a device that supports any one or more serial communication methods such as RS422, RS232, and RS485.

[0040] In this embodiment, based on the RS422 data transmission module 110, RS485 transceiver module 120, and RS232 transceiver module 130, by adding corresponding transmit and receive signal selection circuits and combining them with software signal control, switching between different serial communication modes can be achieved, while sharing the same terminal block and a cable with uniform wire cores. It can be understood that the serial communication modes achievable here include RS232, RS422, and RS485 communication modes.

[0041] Exemplary, such as Figure 1 As shown, the RS422 data transmission module 110, RS232 transceiver module 130, first receive selection circuit 150, and second receive selection circuit 160 are all configured to input the first control signal CN0. The level-type transmit selection circuit 140 is configured to input the second control signal CN1, and the RS485 transceiver module 120 is configured to input the third control signal CN2. The serial port three-in-one interface circuit 100 is used to realize serial communication between the serial port controller 200 and different peer devices according to different combinations of the first control signal CN0, the second control signal CN1, and the third control signal CN2. All three control signals are level-type signals, meaning they exist in both high-level and low-level states. By combining these three control signals, the serial port three-in-one interface circuit 100 can operate in different communication modes.

[0042] It is understandable that the RS422 data transmission module 110, RS485 transceiver module 120, and RS232 transceiver module 130 can all be implemented using commercially available chip modules, which will not be discussed in detail here. Optionally, since the RS422 interface standard adopts a full-duplex communication mode and uses a 4-wire differential transmission method, specifically including 2 differential lines, 1 transmit line, and 1 receive line; while the RS485 interface standard adopts a 2-wire differential transmission method, the RS422 data transmission module 110 and the RS485 transceiver module 120 can also be implemented using the same chip modules, such as SP485 series chips, etc.

[0043] In this embodiment, the level-type transmit selection circuit 140, the first receive selection circuit 150, and the second receive selection circuit 160 are mainly used as switching circuits, and therefore can be implemented using digital switches or analog switches. For example, digital switches can be devices with switching characteristics such as diodes, transistors, and MOSFETs, while analog switches can be devices such as single-pole double-throw switches. It is understood that the level-type transmit selection circuit 140, the first receive selection circuit 150, and the second receive selection circuit 160 can be implemented using different switching circuits, for example, some using digital switches and some using analog switches, etc., which is not limited here.

[0044] In one implementation, such as Figure 2 As shown, the level-type transmit selection circuit 140, the first receive selection circuit 150, and the second receive selection circuit 160 can all be implemented using a single-pole double-throw switch integrated chip. The main difference between the first receive selection circuit 150 and the second receive selection circuit 160 lies in the different functional configurations of their respective pins.

[0045] In this circuit, the level in the level-type transmit selection circuit 140 refers to the TTL level. The level-type transmit selection circuit 140 is mainly used to switch between RS485 mode transmit signals and RS422 mode transmit signals based on the state of the first control signal. It can be understood that by time-division multiplexing the RS422 transmit data module 110 and the RS485 transceiver module 120, physical isolation of the signals can be guaranteed, ensuring that RS485 and RS422 level signals do not exist simultaneously on the cable.

[0046] The multiplexed receiving signal circuit 170 is mainly used to input data received from the serial port receiver to the serial port controller 200 in any of the RS232 / RS485 / RS422 modes. In one embodiment, such as... Figure 2As shown, the multiplexed receiving signal circuit 170 includes two diodes. The anodes of the two diodes are connected together to connect to the serial port controller 200, and the cathodes of the two diodes are respectively connected to the data receiving terminals of the RS485 transceiver module 120 and the RS232 transceiver module 130. It can be understood that by utilizing the unidirectional conduction characteristic of the diodes, isolation between the RS232 mode received signal and the RS484 / 422 mode received signal is achieved.

[0047] The serial port terminal 180 is a common terminal for the three communication modes mentioned above. In this embodiment, the number of pins is designed to be 8 PIN, which is significantly smaller than the 12 PIN of the existing solution. This makes it easier to improve the miniaturization and high density of the device. Correspondingly, it also reduces the weight of the cable, lowers the cost of the cable, facilitates the wiring and installation of the cable, and promotes the standardization and unification of the cable.

[0048] In one implementation, the serial port terminal 180 includes eight pins: first to fourth multiplexed pins, fifth to seventh pins, and a power / ground pin. The first and second multiplexed pins can be used in combination under a differential transmission mechanism, as can the third and fourth multiplexed pins. Of course, these multiplexed pins can also be used individually under other transmission mechanisms. Because these four pins have multiplexed functions, they are referred to here as multiplexed pins.

[0049] like Figure 2 As shown, the RS422 data transmission module 110 is connected to the first multiplexed pin (T+ / RTS) and the second multiplexed pin (T- / 232TX) of the serial port terminal 180 via differential signals. The first multiplexed pin (T+ / RTS) and the second multiplexed pin (T- / 232TX) are also respectively connected to the transmit data (TXD) pin and request to transmit (RTS) pin of the RS232 transceiver module 130. The 485 transceiver module is connected to the first receive selection circuit 150 and the second receive selection circuit 160 via differential signals. The first receive selection circuit 150 and the second receive selection circuit 160 are respectively connected to the third multiplexed pin (Data+ / R+ / 232RX) and the fourth multiplexed pin (Data- / R- / DCD) of the serial port terminal 180. The third multiplexed pin (Data+ / R+ / 232RX) and the fourth multiplexed pin (Data- / R- / DCD) are also respectively connected to the receive data (RXD) pin and the carrier detection (DCD) pin of the RS232 transceiver module 130. The fifth to seventh pins of the serial port terminal 180 (corresponding to...) Figure 2The DSR, CTS, DTR, and GND pins in the RS232 transceiver module 130 are respectively connected to the Data Ready (DSR) pin, Clear Transmit (CTS) pin, and Data Terminal Ready (DTR) pin, while the power ground (GND) pin is grounded.

[0050] It is understood that the serial port controller 200 includes multiple pins, which will be connected to corresponding circuits or modules in the serial port three-in-one interface circuit to realize communication between the serial port controller 200 and the end device. In one embodiment, such as Figure 2 As shown, the level-type transmit selection circuit 140, the multiplexed receive signal circuit 170, and the RS232 transceiver module 130 are respectively used to connect to the same serial port controller 200, including:

[0051] The data input terminal of the level-type transmit selection circuit 140 is used to connect to the data transmit (TX) pin of the serial port controller 200; the data output terminal of the multiplexed receive signal circuit 170 is used to connect to the data receive (RX) pin of the serial port controller 200; the DCD pin, RTS pin, DSR pin, CTS pin and DTR pin of the RS232 transceiver module 130 are used to connect to the corresponding function pins of the serial port controller 200 in sequence.

[0052] Based on the above structure, the following section details how the serial port three-in-one interface circuit 100 implements three communication modes. It can be understood that the first to third control signals can be output through the processor 300 connected to the circuit. By using different combinations of level signals, the circuit can switch to different operating modes.

[0053] In this embodiment, the correspondence between the combined states of the first control signal, the second control signal, and the third control signal and the three communication modes is as follows:

[0054] (1) When the first control signal, the second control signal and the third control signal are high level, low level and low level respectively, the serial port three-in-one interface circuit 100 is configured to RS232 communication mode.

[0055] (2) When the first control signal, the second control signal and the third control signal are low level, low level and low level respectively, the serial port three-in-one interface circuit 100 is configured to RS422 communication mode.

[0056] (3) When the first control signal and the second control signal are low level and high level respectively, the serial port three-in-one interface circuit 100 is configured to RS485 communication mode. On this basis, when the third control signal is high level, the serial port three-in-one interface circuit 100 is used to send data, and when the third control signal is low level, the serial port three-in-one interface circuit 100 is used to receive data.

[0057] Specifically, when operating in RS232 mode, this mode is full-duplex, meaning data is sent and received simultaneously. In this mode, the first control signal CON0 is high, while the second control signal CON1 and the third control signal CON2 are low by default. Therefore, the RS422 data transmission module 110 is disabled, the first receive selection circuit 150 switches to RS232 mode to receive RS232 signals from the peer device, and the second receive selection circuit 160 switches to RS232 mode to receive DCD signals from the peer device. The RS232 transceiver module 130 is enabled to send and receive data; subsequently, the multiplexed receive signal circuit 170 receives the serial port TTL level signal and transmits it to the serial port controller 200, thus realizing serial communication in RS232 signal mode.

[0058] When operating in RS422 mode, this mode is full-duplex, meaning data is sent and received simultaneously. In this mode, the first control signal CON0 and the second control signal CON1 are low, and the third control signal CON2 is low by default. Therefore, the RS232 transceiver module 130 is disabled, the level-type transmit selection circuit 140 (TTL level) switches to RS422 mode, and the RS422 data transmission module 110 is enabled and begins transmitting data. Simultaneously, the first receive selection circuit 150 and the second receive selection circuit 160 both switch to RS422 receive mode and begin receiving data. The data passes through the RS485 transceiver (when CON2 is low, the default state is receive mode), and then the multiplexed receive signal circuit 170 receives the serial port TTL level signal and transmits it to the serial port controller 200, thus realizing serial communication in RS422 signal mode.

[0059] When operating in RS485 mode, this is a half-duplex mode, meaning data cannot be transmitted and received simultaneously on the bus; switching between transmission and reception is required. At this time, the first control signal CON0 is low and the second control signal CON1 is high. The RS232 transceiver module 130 is disabled, and the level-type transmit selection circuit 140 (TTL level) switches its transmit signal to RS485 mode. Simultaneously, the first receive selection circuit 150 and the second receive selection circuit 160 both switch to RS485 transmit / receive data mode, preparing to transmit and receive data. Furthermore, when the third control signal CON2 is high, the transmit end of the RS485 transceiver module 120 is enabled, and data transmission begins; when CON2 is low, the receive end of the RS485 transceiver module 120 is enabled, and data reception begins. The multiplexed receive signal circuit 170 receives the serial port TTL level signal to the serial port controller 200. This achieves serial communication in RS485 signal mode.

[0060] The serial port three-in-one interface circuit 100 of this application achieves collinear transmission of serial port signals in three different modes through the switching of the control circuit, and ensures physical isolation of the transmitted signal and the received signal through the setting selection circuit. It can be understood that when the working mode is fixed, the transmitted signal will only be sent out from the fixed signal line, and the received signal will only be received from the fixed signal line, achieving true separation of transmitted and received signals, ensuring that they do not interfere with each other and guaranteeing the stability of signal transmission. Moreover, in practical applications, based on this serial port three-in-one interface circuit 100, the on-site signal wiring of the device is simple; a unified cable can be used, and mode switching can be performed in the software according to on-site requirements. Compared with existing solutions where all signals are brought out separately in various serial port modes, this effectively reduces the number of pins on the terminal block, reduces the size of the terminal block, and thus facilitates the miniaturization and high-density of the device.

[0061] Figure 3 A flowchart illustrating a control method for a serial port three-in-one interface circuit 100 according to an embodiment of this application is shown. Exemplarily, this control method is applied to the serial port three-in-one interface circuit 100 of the above embodiment, specifically including the following steps:

[0062] S110, when the serial port three-in-one interface circuit 100 needs to be configured to work in RS232 communication mode, the first control signal, the second control signal and the third control signal are respectively high level, low level and low level.

[0063] S120, when the serial port three-in-one interface circuit 100 needs to be configured to work in RS422 communication mode, the first control signal, the second control signal and the third control signal are controlled to be low level, low level and low level respectively.

[0064] S130, when the serial port three-in-one interface circuit 100 needs to be configured to work in RS485 communication mode, the first control signal and the second control signal are controlled to be low level and high level respectively, and when data needs to be sent, the third control signal is controlled to be high level, and when data needs to be received, the third control signal is controlled to switch to low level.

[0065] It is understood that the above steps can be executed in parallel without any specific order. According to the actual configuration instructions, the first to third control signals of the serial port three-in-one interface circuit 100 can be controlled to switch to any one of the RS232, RS422 and RS485 communication modes.

[0066] Figure 4A schematic diagram of a serial port system chip 10 provided in an embodiment of this application is shown. Exemplarily, the serial port system chip 10 includes: a processor 300, a serial port controller 200, and a serial port three-in-one interface circuit 100 as described in the above embodiment. Specifically, the processor 300 and the serial port controller 200 are both connected to the serial port three-in-one interface circuit 100. The processor 300 is used to generate first to third control signals, so that the serial port three-in-one interface circuit 100, according to different combinations of the configured first to third control signals, enables serial communication between the serial port controller 200 in the serial port system chip 10 and peer devices with different communication modes.

[0067] It is understood that the correspondence between the combined states of the first to third control signals and the several communication modes supported by the serial port three-in-one interface circuit 100 can be found in the above description, so it will not be repeated here.

[0068] Furthermore, this application also provides a terminal device, which can be, for example, but not limited to, various devices that support serial communication such as routers, gateways, and communication detection devices. Exemplarily, this terminal device includes the serial port system chip 10 described in the above embodiments.

[0069] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A serial port three-in-one interface circuit, characterized in that, include: RS422 data transmission module, RS485 transceiver module, RS232 transceiver module, level-type transmit selection circuit, first receive selection circuit, second receive selection circuit, multiplexed receive signal circuit, and serial port terminals; The level-type transmit selection circuit is connected to the RS422 transmit data module and the RS485 transceiver module respectively; the RS422 transmit data module is connected to the serial port terminal. The RS485 transceiver module is connected to the first receive selection circuit, the second receive selection circuit, and the multiplexed receive signal circuit, respectively; the first receive selection circuit and the second receive selection circuit are also connected to the serial port terminal, respectively. The RS232 transceiver module is connected to the first receive selection circuit, the second receive selection circuit, the multiplexed receive signal circuit, and the serial port terminal, respectively. The level-type transmit selection circuit, the multiplexed receive signal circuit, and the RS232 transceiver module are respectively used to connect to the same serial port controller, and the serial port terminal is used to connect to the other end device; The RS422 data transmission module, the RS232 transceiver module, the first receive selection circuit, and the second receive selection circuit are all configured to input a first control signal; the level-type transmit selection circuit is configured to input a second control signal; and the RS485 transceiver module is configured to input a third control signal. The serial port three-in-one interface circuit is used to realize serial communication between the serial port controller and the peer device with different communication modes according to different combinations of the first control signal, the second control signal and the third control signal.

2. The serial port three-in-one interface circuit according to claim 1, characterized in that, The serial port three-in-one interface circuit supports three communication modes. The correspondence between the combined states of the first control signal, the second control signal, and the third control signal and the three communication modes is as follows: When the first control signal, the second control signal, and the third control signal are high level, low level, and low level respectively, the serial port three-in-one interface circuit is configured to RS232 communication mode. When the first control signal, the second control signal, and the third control signal are low level, low level, and low level respectively, the serial port three-in-one interface circuit is configured to RS422 communication mode. When the first control signal and the second control signal are respectively low and high, the serial port three-in-one interface circuit is configured to RS485 communication mode. When the third control signal is high, the serial port three-in-one interface circuit is used to send data. When the third control signal is low, the serial port three-in-one interface circuit is used to receive data.

3. The serial port three-in-one interface circuit according to claim 1, characterized in that, The serial port terminal includes eight pins: the first to fourth multiplexed pins, the fifth to seventh pins, and the power ground pin; The RS422 data transmission module is connected to the first multiplexed pin and the second multiplexed pin via differential signals. The first multiplexed pin and the second multiplexed pin are also respectively connected to the TXD pin and the RTS pin of the RS232 transceiver module. The 485 transceiver module is connected to the first receive selection circuit and the second receive selection circuit via differential signals. The first receive selection circuit and the second receive selection circuit are respectively connected to the third multiplexed pin and the fourth multiplexed pin. The third multiplexed pin and the fourth multiplexed pin are also respectively connected to the RXD pin and the DCD pin of the RS232 transceiver module. Pins 5 to 7 are respectively connected to the DSR pin, CTS pin, and DTR pin of the RS232 transceiver module, and the power ground pin is grounded.

4. The serial port three-in-one interface circuit according to claim 3, characterized in that, The serial port controller includes multiple pins. The level-type transmit selection circuit, the multiplexed receive signal circuit, and the RS232 transceiver module are each used to connect to the same serial port controller, including: The data input terminal of the level-type transmit selection circuit is used to connect to the data transmit pin of the serial port controller; The data output terminal of the multiplexed receiving signal circuit is used to connect to the data receiving pin of the serial port controller; The DCD pin, RTS pin, DSR pin, CTS pin, and DTR pin of the RS232 transceiver module are used to connect to the corresponding functional pins of the serial port controller in sequence.

5. The serial port three-in-one interface circuit according to any one of claims 1 to 4, characterized in that, The level-type transmit selection circuit, the first receive selection circuit, and the second receive selection circuit are all implemented using digital switches or analog switches.

6. The serial port three-in-one interface circuit according to claim 5, characterized in that, The digital switch can be any one of a transistor or a MOSFET.

7. The serial port three-in-one interface circuit according to any one of claims 1 to 4, characterized in that, The multiplexed receiving signal circuit includes two diodes. The anodes of the two diodes are connected together to connect to the serial port controller, and the cathodes of the two diodes are respectively connected to the RS485 transceiver module and the RS232 transceiver module.

8. A control method for a serial port three-in-one interface circuit, characterized in that, The method, applied to the serial port three-in-one interface circuit as described in any one of claims 1-7, comprises: When the serial port three-in-one interface circuit needs to be configured to work in RS232 communication mode, the first control signal, the second control signal and the third control signal are controlled to be high level, low level and low level respectively; When the serial port three-in-one interface circuit needs to be configured to work in RS422 communication mode, the first control signal, the second control signal and the third control signal are controlled to be low level, low level and low level respectively; When the serial port three-in-one interface circuit needs to be configured to work in RS485 communication mode, the first control signal and the second control signal are controlled to be low level and high level respectively, and when data needs to be sent, the third control signal is controlled to be high level, and when data needs to be received, the third control signal is controlled to switch to low level.

9. A serial port system chip, characterized in that, include: Processor, serial port controller, and serial port three-in-one interface circuit as described in any one of claims 1-7; The processor and the serial port controller are both connected to the serial port three-in-one interface circuit; The processor is used to generate first to third control signals so that the serial port three-in-one interface circuit can realize serial communication between the serial port controller and the peer device with different communication modes according to different combinations of the first to third control signals.

10. A terminal device, characterized in that, The terminal device includes the serial port system chip as described in claim 9.

Citation Information

Patent Citations

  • Serial communication interface function switching circuit and method

    CN107070445A

  • Server serial port switching apparatus and method, and server

    WO2016101408A1