WO2017173889A1 - Communication interface hardware self-adaptive multiplexing device and method - Google Patents

Communication interface hardware self-adaptive multiplexing device and method Download PDF

Info

Publication number
WO2017173889A1
WO2017173889A1 PCT/CN2017/074081 CN2017074081W WO2017173889A1 WO 2017173889 A1 WO2017173889 A1 WO 2017173889A1 CN 2017074081 W CN2017074081 W CN 2017074081W WO 2017173889 A1 WO2017173889 A1 WO 2017173889A1
Authority
WO
WIPO (PCT)
Prior art keywords
signal
communication
input
module
amplitude
Prior art date
Application number
PCT/CN2017/074081
Other languages
French (fr)
Chinese (zh)
Inventor
宋晶
马国华
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017173889A1 publication Critical patent/WO2017173889A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network

Definitions

  • the present invention relates to the field of communications, and in particular, to a communication interface hardware adaptive multiplexing device and method.
  • RS232, RS485 and other interface standards occupy a dominant position in the use of serial communication due to its own advantages.
  • RS485, CAN and other differential signals compared with RS232, have the advantages of long communication distance, fast speed, strong anti-interference ability and network connectivity. Therefore, in practical applications, generally only RS232 is used for deployment or debugging. Long-term idle is a waste of resources, and communication equipment is getting closer to miniaturization, and the number of interfaces equipped is limited. Therefore, it is necessary to implement multiplexing switching of the communication interface in a way to avoid the waste of resources and realize the convenience and flexibility of the application.
  • the main solutions currently used in the industry include: using a hybrid interface, and selecting a communication method by using a jumper or a dial switch.
  • This method requires manual opening of the device casing for manual operation, which is neither flexible nor error-prone.
  • the receiving end is wired at the hybrid interface through a device such as a diode.
  • the communication links affect each other, the signal quality is poor, and the data loss is severe under the condition of high baud rate.
  • It is implemented by a dedicated processing chip such as a universal asynchronous transceiver, which is costly and also involves the problem of requiring two sets of access protection circuits. It adopts software detection, control and special circuit implementation.
  • This method has poor portability and needs CPU resource and human development cost.
  • the circuit is judged by a circuit such as a comparator or a composite logic circuit, and switching is performed by a relay.
  • This method is complicated in circuit, and usually requires two sets of access circuits, which wastes cost.
  • the embodiment of the invention provides a communication interface hardware adaptive multiplexing device and method, which solves the problem that the existing communication interface adaptive multiplexing device requires software participation, poor portability, complicated structure and low reliability.
  • an embodiment of the present invention provides a communication interface hardware adaptive multiplexing device, the device comprising: an input interface module configured to receive a plurality of externally input signal types of communication signals through a plurality of pins thereof
  • the detecting and determining module is configured to detect the amplitude of the communication signal, and determine the first signal type corresponding to the communication signal currently received by the input interface module according to the detected amplitude, and generate a switch corresponding to the first signal type.
  • the input switching module is configured to receive the switching control signal, and input the communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit according to the switching control signal;
  • the signal conversion module includes multiple signals The conversion unit, each signal conversion unit corresponds to a signal type communication signal, each signal conversion unit is configured to perform signal conversion on the received communication signal, and output;
  • the serial input module is connected to each signal conversion unit. , configured to output a signal output from any one of the signal conversion units.
  • an embodiment of the present invention provides a communication interface hardware adaptive multiplexing method, the method comprising: receiving, from a plurality of pins of an input interface module, a communication signal of multiple signal types externally input a detecting a magnitude of the communication signal, and determining, according to the detected amplitude, a first signal type corresponding to the communication signal currently received by the input interface module, generating a switching control signal corresponding to the first signal type; and according to the switching control signal Transmitting the communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit; at the signal conversion module, performing signal conversion on the input signal, and outputting to a serial input module; receiving each through the serial input module The signal output from the signal conversion unit is output.
  • the communication signal by detecting the amplitude of the communication signal, and determining, according to the detected amplitude, the first signal type corresponding to the communication signal currently received by the input interface module, corresponding to a switching control signal of the first signal type; according to the switching control signal, the communication signal is input to a path corresponding to the first signal type in the multi-channel signal conversion unit.
  • the hardware self-adaptive completion of the communication signal is realized, no manual operation is required, software programming is not involved, the trouble of developing related software is saved, the portability is improved, the operation error is reduced, and the same input interface module and a set of input are adopted.
  • the protection module only occupies a pair of asynchronous serial interfaces of the CPU, completely realizes the compatibility of the two communication modes, improves the integration degree of the circuit, and saves resources.
  • FIG. 1 is a structural diagram of a hardware adaptive multiplexing apparatus for a communication interface according to a first embodiment of the present invention
  • FIG. 2 is a structural diagram of an input interface module in a hardware adaptive multiplexing apparatus for a communication interface according to a first embodiment of the present invention
  • FIG. 3 is a circuit diagram of an absolute value unit in a communication interface hardware adaptive multiplexing device according to a first embodiment of the present invention
  • FIG. 4 is a circuit diagram of a control unit in a communication interface hardware adaptive multiplexing device according to a first embodiment of the present invention
  • FIG. 5 is a structural diagram of an input switching module in a communication interface hardware adaptive multiplexing device according to a first embodiment of the present invention
  • FIG. 6 is a flowchart of a method for adaptive multiplexing of a communication interface hardware according to a second embodiment of the present invention.
  • an embodiment of the present invention provides a communication interface hardware adaptive multiplexing device, where the device includes:
  • the input interface module 101 is configured to receive one of a plurality of signal types of external input signals through a plurality of pins of the plurality of pins; in the embodiment, the communication signals of the plurality of signal types include the RS232 signal and the RS232.
  • the signal has other communication signals with a level difference, and the other communication signals include at least the RS485 signal.
  • the structure of the input interface module 101 is as shown in FIG. 2, including a first pin 1011, a second pin 1012, and a third pin 1013, wherein the RS232 signal read signal RS232-R and the RS485 signal A
  • the terminal signal RS485-A can multiplex the first pin 1011
  • terminal signal RS485-B can multiplex the second pin 1012
  • the third pin 1013 is used for grounding.
  • the device further includes an input protection module 106 configured to perform EMC protection processing on the communication signal received by the input interface module 101, and output the processed communication signals RXD and TXD.
  • the detection determining module 102 is configured to detect the amplitude of the communication signal processed by the input protection module 106, and determine, according to the detected amplitude, the first signal type corresponding to the communication signal currently received by the input interface module 101, corresponding to the first A signal type switching control signal.
  • the detection determining module 102 includes an absolute value unit 1021 and a control unit 1022, wherein the absolute value unit 1021 is configured to detect the amplitude of the communication signal and obtain an absolute value of the amplitude; the control unit 1022, The first signal type corresponding to the communication signal currently received by the input interface module 101 is determined according to the absolute value of the detected amplitude, and is generated corresponding to the first signal class. Type switching control signal.
  • the absolute value unit 1021 is mainly processed for the negative level of the communication signal, and the absolute value of the amplitude of the communication signal is obtained after the processing.
  • the circuit of the absolute value unit 1021 is as shown in FIG. 3, and includes: a fourth resistor R4, and a pin 1 is configured to receive the communication signal RXD, the 2 pin and the fifth resistor R5 processed by the input protection module 106.
  • Pin 1 of the 1st and 6th resistors R6 is connected to the 2nd pin of the negative input terminal of the operational amplifier U1.
  • the positive input terminal of U1 is grounded, the positive terminal of the power supply is connected with the +15V power supply signal, and the negative terminal of the power supply is connected with the -15V power supply signal.
  • the U1 output terminal 6 is connected to the negative terminal of the diode VD3 and the positive terminal of the VD4.
  • the 2 pin of the fifth resistor R5 is connected to the positive terminal of VD3, the 2 pin of the seventh resistor R7, and the 1 pin of the semi-fixed resistor RV1; the 2 pin of the sixth resistor R6 and the negative terminal of VD4, and the 1 pin of the eighth resistor R8 Connected to pin 1 of the tenth resistor R10.
  • Pin 1 of R7 is grounded to pin 2 of R8.
  • Pin 2 of RV1 is connected to pin 1 of ninth resistor R9.
  • Pin 2 of R9 is connected to pin 1 of C4, pin 1 of eleventh resistor R11, and pin 3 of positive input terminal of op amp U2.
  • Pin 2 of R10 and pin 1 of C5, pin 1 of 12th resistor R12 and U2 The negative input terminal 2 is connected.
  • the 7-pin and 4-pin of the positive and negative power terminals of U2 are connected to the +15V and -15V power signals respectively.
  • the 2 pin of C4 and the 2 pin of R11 are grounded; the 2 pin of R12 and the 2 pin of C5 are connected to the output pin 6 of U2, and the absolute value signal ROUT of the amplitude of the communication signal obtained after processing is output.
  • the circuit of the absolute value unit 1021 is composed of a positive and negative rectifier circuit with U1 as a core device and a differential proportional operational amplifier with U2 as a core device.
  • the resistance values of R4, R5 and R6 should be equal, and the resistance values of R9, R10, R11 and R12 should be equal.
  • the shunt resistors R7 and R8 are added to the design, and the semi-fixed resistor RV1 for balancing the waveform is added.
  • the diodes VD3 and VD4 need to use a Schottky-type diode with a small parasitic junction capacitance.
  • C4 and C5 are phase compensation capacitors.
  • the control unit 1022 can be composed of a device such as a triode or a MOS transistor.
  • the control unit 1022 in this embodiment is configured by a triode, as shown in FIG. 4, the circuit of the control unit 1022.
  • the thirteenth resistor R13 includes a pin connected to the circuit output signal ROUT of the absolute value unit 1021 and a pin connected to the negative terminal of the Zener diode VD5.
  • the anode of VD5 is connected to the base of transistor Q1 and the 2 pin of capacitor C6. Ground 1 of C6 is grounded.
  • the collector of Q1 is connected to a +15V power supply, and its emitter output switching control signal is grounded through the fourteenth resistor R14.
  • the voltage regulation value of VD5 is between 6V and 8V.
  • C6 is configured for filtering, and R14 is used as a feedback resistor. Its resistance is taken at around 10K.
  • ROUT is a level higher than 10V, Q1 is turned on, and outputs the first switching control signal;
  • ROUT is a level of about 0V ⁇ 6V, Q1 cannot Turning on, outputting a second switching control signal.
  • the input switching module 103 is configured to receive the switching control signal, and input the input signal to one of the multiple signal converting units corresponding to the first level type according to the switching control signal.
  • the input switching module 103 is composed of a high-speed switching device.
  • the power terminals VDD and VSS are respectively connected to the positive and negative power supplies +15V and -15V, and the output channels S1A and S2A are used for The input end of the RS232 signal conversion unit that converts the RS232 signal is connected; the S1B and S2B channels are connected to the input end of the RS485 signal conversion unit for converting the RS485 signal.
  • the control signals of the IN1 and IN2 channels are switching control signals received by the high speed switch from the control unit 1022.
  • the control signal is the second switching control signal
  • the high-speed switching switch is switched to the S1B and S2B channels, and the RXD and TXD signals input by the input protection module 106 input by D1 and D2 are sent to the input end of the RS485 signal conversion unit, wherein A The signal and the B signal are signals input to the RS485 signal conversion unit;
  • the control signal is the first switching control signal, the high-speed switching switch is switched to the S1A, S2A channel, and the RXD input by the input protection module 106, which is input by D1 and D2, and
  • the TXD signal is sent to the input of the RS232 signal conversion unit, wherein the R-232 signal and the T-232 signal are signals input to the RS232 signal conversion unit.
  • the signal conversion module 104 includes a multi-channel signal conversion unit, each of the signal conversion units corresponding to a signal type communication signal, and each of the signal conversion units is configured to perform signal conversion on the received input signal and output .
  • the signal conversion module 104 includes an RS485 signal conversion unit composed of an RS485 signal conversion chip, such as a MAX1487 chip, and an RS232 signal conversion unit composed of an RS232 signal conversion chip, such as the MAX202E.
  • the control of the conversion chip here adopts the automatic flipping control of common hardware inversion, thereby realizing the hardware adaptation of the whole process (for other serial differential signals, it needs to be replaced with the corresponding signal conversion chip here) .
  • a TTL level signal corresponding to the input signal is obtained.
  • the serial input module 105 is connected to each of the signal conversion units and configured to output a signal output from any one of the signal conversion units.
  • the conversion signal RXD-485 corresponding to the RS485 signal and the conversion signal RXD-232 corresponding to the RS232 signal may be cascaded, and the conversion signal TXD-485 corresponding to the RS485 signal and the conversion signal corresponding to the RS232 signal TXD- 232 cascade, and then directly into the asynchronous serial port corresponding to the CPU.
  • a high-speed optocoupler device can be connected, and the source side of the high-speed optocoupler device and the pair of asynchronous serial ports of the CPU can be connected. Dangling, the secondary side is connected to the serial input module 105, which can realize the conversion of the two-side level and the reference ground of the high-speed optocoupler device.
  • the processing module by detecting the amplitude of the communication signal, and determining the first signal type corresponding to the communication signal currently received by the input interface module according to the detected amplitude, generating a switching control signal corresponding to the first signal type; The control signal is switched, and the communication signal is input to one of the multiple signal conversion units corresponding to the first signal type.
  • the hardware self-adaptive completion of the communication signal is realized, no manual operation is required, software programming is not involved, the trouble of developing related software is saved, the portability is improved, the operation error is reduced, and the same input interface module and a set of input are adopted.
  • the processing module only occupies a pair of asynchronous serial interfaces of the CPU, and completely realizes two communication modes. The compatibility improves the integration of the circuit and saves resources.
  • FIG. 2 is a flowchart of a method for adaptive multiplexing of a communication interface hardware according to a second embodiment of the present invention, the method comprising:
  • Step 201 Receive one of a plurality of signal types of external input signals from a plurality of pins of an input interface module.
  • the communication signals of various signal types include an RS232 signal, other communication signals having a level difference with the RS232 signal, and other communication signals include at least an RS485 signal.
  • the communication signal received by the input interface module can also be subjected to EMC protection processing.
  • Step 202 Detect a magnitude of the communication signal, and determine, according to the detected amplitude, a first signal type corresponding to the communication signal currently received by the input interface module, and generate a switching control signal corresponding to the first signal type.
  • step 202 is to generate a switching control signal by using an absolute value of the amplitude of the communication signal, the process comprising: detecting the amplitude of the communication signal, and obtaining an absolute value of the amplitude; and determining the absolute value according to the amplitude And determining a first signal type corresponding to the communication signal currently received by the input interface module, and generating a switching control signal corresponding to the first signal type.
  • Step 203 Input a communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit according to the switching control signal.
  • each signal conversion unit corresponds to a signal type communication signal
  • step 203 is to input the communication signal to the corresponding signal conversion unit according to the switching control signal, thereby correctly converting the communication signal.
  • Step 204 At the signal conversion module, after the signal is converted, the signal is output to a serial input module.
  • step 204 is performed by a signal conversion unit corresponding to the communication signal.
  • the communication signal is converted into a corresponding TTL level signal.
  • Step 205 Receive a signal output by each signal conversion unit through a serial input module, and output the signal.
  • the processing module by detecting the amplitude of the communication signal, and determining the first signal type corresponding to the communication signal currently received by the input interface module according to the detected amplitude, generating a switching control signal corresponding to the first signal type; The control signal is switched, and the communication signal is input to one of the multiple signal conversion units corresponding to the first signal type.
  • the hardware self-adaptive completion of the communication signal is realized, no manual operation is required, software programming is not involved, the trouble of developing related software is saved, the portability is improved, the operation error is reduced, and the same input interface module and a set of input are adopted.
  • the processing module only occupies a pair of asynchronous serial interfaces of the CPU, completely realizes the compatibility of the two communication modes, improves the integration degree of the circuit, and saves resources.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the device of the embodiment of the invention includes: an input interface module configured to receive one of a plurality of signal types of external input signals; the detection and determination module configured to detect the amplitude of the communication signal, and according to the detected amplitude Determining a first signal type corresponding to the current communication signal, generating a switching control signal corresponding to the first signal type; and inputting a switching module configured to input the communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit;
  • the conversion module is configured to perform signal conversion on the received communication signal and output;
  • the serial input module is configured to output a signal output from any one of the signal conversion units; thus, the existing communication interface adaptive multiplexing device is solved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Telephonic Communication Services (AREA)
  • Communication Control (AREA)

Abstract

A communication interface hardware self-adaptive multiplexing device and method, the device comprising: an input interface module (101) configured to receive one type of communication signal of multiple signal types inputted externally; a detection and determination module (102) configured to detect an amplitude of the communication signal, and determine, according to the detected amplitude, a first signal type corresponding to a current communication signal, so as to generate a switch control signal corresponding to the first signal type; an input switching module (103) configured to input the communication signal to a path in a multipath signal converting unit corresponding to the first signal type; a signal converting module (104) configured to perform signal conversion on the received communication signal for outputting; and a serial input module (105) configured to output a signal outputted from any path of the signal converting unit.

Description

一种通讯接口硬件自适应复用装置及方法Communication interface hardware adaptive multiplexing device and method 技术领域Technical field
本发明涉及通信领域,尤其涉及一种通讯接口硬件自适应复用装置及方法。The present invention relates to the field of communications, and in particular, to a communication interface hardware adaptive multiplexing device and method.
背景技术Background technique
随着信息交互的不断扩展,串行通信技术已广泛应用于通讯、工控等各种领域。目前,RS232、RS485等几种接口标准由于其自身的优点,在串行通信的使用中占有主导地位。其中,RS485、CAN等采用差分信号,和RS232相比具有通讯距离长、速度快、抗扰能力强以及可实现设备联网等优点。因此,在实际应用中,一般只是采用RS232进行开局或调试,长期闲置较为浪费资源,而通讯设备越来越趋近于小型化,所配备的接口数量又受到限制。因此,有必要通过一种方式来实现通讯接口的复用切换;以便既不浪费资源,又能够实现应用的便利性和灵活性。With the continuous expansion of information interaction, serial communication technology has been widely used in various fields such as communication and industrial control. At present, RS232, RS485 and other interface standards occupy a dominant position in the use of serial communication due to its own advantages. Among them, RS485, CAN and other differential signals, compared with RS232, have the advantages of long communication distance, fast speed, strong anti-interference ability and network connectivity. Therefore, in practical applications, generally only RS232 is used for deployment or debugging. Long-term idle is a waste of resources, and communication equipment is getting closer to miniaturization, and the number of interfaces equipped is limited. Therefore, it is necessary to implement multiplexing switching of the communication interface in a way to avoid the waste of resources and realize the convenience and flexibility of the application.
针对该问题,目前行业中主要采用的解决方法有:采用混合接口,通过跳线或拨码开关来进行通讯方式的选择,该方式需要现场开启设备外壳进行人工操作,既不灵活,又容易出错。采用直接级联的方式,通过二极管等器件在混合接口处将接收端进行线与。该方式各通讯链路相互影响,信号质量差,在高波特率情况下数据丢失严重。采用如通用异步收发器等专用处理芯片实现,该方式成本过高,且同样涉及需要两套接入防护电路的问题。采用软件检测、控制配合专用电路实现,该方式可移植性差,需要占用CPU资源和人力开发成本。采用诸如比较器、复合逻辑电路等电路进行判断,用继电器实现切换。该方式电路复杂,通常仍需要两套接入电路,浪费成本。 In response to this problem, the main solutions currently used in the industry include: using a hybrid interface, and selecting a communication method by using a jumper or a dial switch. This method requires manual opening of the device casing for manual operation, which is neither flexible nor error-prone. . In the direct cascading mode, the receiving end is wired at the hybrid interface through a device such as a diode. In this way, the communication links affect each other, the signal quality is poor, and the data loss is severe under the condition of high baud rate. It is implemented by a dedicated processing chip such as a universal asynchronous transceiver, which is costly and also involves the problem of requiring two sets of access protection circuits. It adopts software detection, control and special circuit implementation. This method has poor portability and needs CPU resource and human development cost. The circuit is judged by a circuit such as a comparator or a composite logic circuit, and switching is performed by a relay. This method is complicated in circuit, and usually requires two sets of access circuits, which wastes cost.
发明内容Summary of the invention
本发明实施例提供一种通讯接口硬件自适应复用装置及方法,以解决现有通讯接口自适应复用装置,需软件参与,可移植性差,结构复杂以及可靠性低的问题。The embodiment of the invention provides a communication interface hardware adaptive multiplexing device and method, which solves the problem that the existing communication interface adaptive multiplexing device requires software participation, poor portability, complicated structure and low reliability.
一方面,本发明实施例提供了一种通讯接口硬件自适应复用装置,该装置包括:输入接口模块,配置为通过自身的多个管脚,接收外部输入的多种信号类型的通讯信号中的一种;检测判断模块,配置为检测通讯信号的幅值,并根据检测到的幅值,确定输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于第一信号类型的切换控制信号;输入切换模块,配置为接收切换控制信号,并根据切换控制信号,将通讯信号输入至多路信号转换单元中对应于第一信号类型的一路;信号转换模块,信号转换模块包括多路信号转换单元,每路信号转换单元对应于一种信号类型的通讯信号,每路信号转换单元,配置为对接收到的通讯信号进行信号转换后输出;串行输入模块,与各路信号转换单元连接,配置为将从任意一路信号转换单元输出的信号输出。In one aspect, an embodiment of the present invention provides a communication interface hardware adaptive multiplexing device, the device comprising: an input interface module configured to receive a plurality of externally input signal types of communication signals through a plurality of pins thereof The detecting and determining module is configured to detect the amplitude of the communication signal, and determine the first signal type corresponding to the communication signal currently received by the input interface module according to the detected amplitude, and generate a switch corresponding to the first signal type. a control signal; the input switching module is configured to receive the switching control signal, and input the communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit according to the switching control signal; the signal conversion module, the signal conversion module includes multiple signals The conversion unit, each signal conversion unit corresponds to a signal type communication signal, each signal conversion unit is configured to perform signal conversion on the received communication signal, and output; the serial input module is connected to each signal conversion unit. , configured to output a signal output from any one of the signal conversion units.
又一方面,本发明实施例提供了一种通讯接口硬件自适应复用方法,该方法包括:从一输入接口模块的多个管脚上,接收外部输入的多种信号类型的通讯信号中的一种;检测通讯信号的幅值,并根据检测到的幅值,确定输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于第一信号类型的切换控制信号;根据切换控制信号,将通讯信号输入至多路信号转换单元中对应于第一信号类型的一路;在信号转换模块处,对输入信号进行信号转换后,输出至一串行输入模块;通过串行输入模块,接收各路信号转换单元输出的信号,并输出。In another aspect, an embodiment of the present invention provides a communication interface hardware adaptive multiplexing method, the method comprising: receiving, from a plurality of pins of an input interface module, a communication signal of multiple signal types externally input a detecting a magnitude of the communication signal, and determining, according to the detected amplitude, a first signal type corresponding to the communication signal currently received by the input interface module, generating a switching control signal corresponding to the first signal type; and according to the switching control signal Transmitting the communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit; at the signal conversion module, performing signal conversion on the input signal, and outputting to a serial input module; receiving each through the serial input module The signal output from the signal conversion unit is output.
本发明实施例中,通过检测通讯信号的幅值,并根据检测到的幅值,确定输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于 第一信号类型的切换控制信号;根据切换控制信号,将通讯信号输入至多路信号转换单元中对应于第一信号类型的一路。实现了对通讯信号的硬件自适应自动完成,无需人工操作,不涉及软件编程,省去开发相关软件的麻烦,提高了可移植性,降低了操作失误;且采用同一输入接口模块、一套输入防护模块,仅占用CPU一对异步串行接口,彻底实现了两种通讯方式的兼容,提高了电路的集成度,节约了资源。In the embodiment of the present invention, by detecting the amplitude of the communication signal, and determining, according to the detected amplitude, the first signal type corresponding to the communication signal currently received by the input interface module, corresponding to a switching control signal of the first signal type; according to the switching control signal, the communication signal is input to a path corresponding to the first signal type in the multi-channel signal conversion unit. The hardware self-adaptive completion of the communication signal is realized, no manual operation is required, software programming is not involved, the trouble of developing related software is saved, the portability is improved, the operation error is reduced, and the same input interface module and a set of input are adopted. The protection module only occupies a pair of asynchronous serial interfaces of the CPU, completely realizes the compatibility of the two communication modes, improves the integration degree of the circuit, and saves resources.
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only some of the present invention. For the embodiments, other drawings may be obtained from those skilled in the art without any inventive labor.
图1为本发明的第一实施例的通讯接口硬件自适应复用装置的结构图;1 is a structural diagram of a hardware adaptive multiplexing apparatus for a communication interface according to a first embodiment of the present invention;
图2为本发明的第一实施例的通讯接口硬件自适应复用装置中的输入接口模块的结构图;2 is a structural diagram of an input interface module in a hardware adaptive multiplexing apparatus for a communication interface according to a first embodiment of the present invention;
图3为本发明的第一实施例的通讯接口硬件自适应复用装置中的取绝对值单元的电路图;3 is a circuit diagram of an absolute value unit in a communication interface hardware adaptive multiplexing device according to a first embodiment of the present invention;
图4为本发明的第一实施例的通讯接口硬件自适应复用装置中的控制单元的电路图;4 is a circuit diagram of a control unit in a communication interface hardware adaptive multiplexing device according to a first embodiment of the present invention;
图5为本发明的第一实施例的通讯接口硬件自适应复用装置中的输入切换模块的结构图;5 is a structural diagram of an input switching module in a communication interface hardware adaptive multiplexing device according to a first embodiment of the present invention;
图6为本发明的第二实施例的通讯接口硬件自适应复用方法的流程图。FIG. 6 is a flowchart of a method for adaptive multiplexing of a communication interface hardware according to a second embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention. Rather than all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
第一实施例First embodiment
请参阅图1、图2、图3、图4及图5,本发明实施例提供一种通讯接口硬件自适应复用装置,该装置包括:Referring to FIG. 1 , FIG. 2 , FIG. 3 , FIG. 4 and FIG. 5 , an embodiment of the present invention provides a communication interface hardware adaptive multiplexing device, where the device includes:
输入接口模块101,配置为通过自身的多个管脚,接收外部输入的多种信号类型的通讯信号中的一种;在本实施例中,多种信号类型的通讯信号包括RS232信号、与RS232信号存在电平差的其他通讯信号,其他通讯信号至少包括RS485信号。The input interface module 101 is configured to receive one of a plurality of signal types of external input signals through a plurality of pins of the plurality of pins; in the embodiment, the communication signals of the plurality of signal types include the RS232 signal and the RS232. The signal has other communication signals with a level difference, and the other communication signals include at least the RS485 signal.
本实施例中,输入接口模块101的结构如图2所示,包括第一管脚1011、第二管脚1012以及第三引脚1013,其中RS232信号的读信号RS232-R与RS485信号的A端信号RS485-A可以复用第一管脚1011,RS232信号的写信号RS232-T与RS485信号的B端信号RS485-B可以复用第二管脚1012,第三引脚1013用于接地。In this embodiment, the structure of the input interface module 101 is as shown in FIG. 2, including a first pin 1011, a second pin 1012, and a third pin 1013, wherein the RS232 signal read signal RS232-R and the RS485 signal A The terminal signal RS485-A can multiplex the first pin 1011, the RS232 signal write signal RS232-T and the RS485 signal B terminal signal RS485-B can multiplex the second pin 1012, and the third pin 1013 is used for grounding.
而且为了减少外界干扰对系统电路的影响,该装置还包括输入防护模块106,配置为对输入接口模块101接收到的通讯信号进行EMC保护处理,输出经过处理后的通讯信号RXD以及TXD。Moreover, in order to reduce the influence of external interference on the system circuit, the device further includes an input protection module 106 configured to perform EMC protection processing on the communication signal received by the input interface module 101, and output the processed communication signals RXD and TXD.
检测判断模块102,配置为检测经过输入防护模块106处理的通讯信号的幅值,并根据检测到的幅值,确定输入接口模块101当前接收的通讯信号对应的第一信号类型,产生对应于第一信号类型的切换控制信号。在本实施例中,检测判断模块102包括取绝对值单元1021和控制单元1022,其中取绝对值单元1021配置为检测通讯信号的幅值,并获得所述幅值的绝对值;控制单元1022,配置为根据检测到的幅值的绝对值,确定输入接口模块101当前接收的通讯信号对应的第一信号类型,产生对应于第一信号类 型的切换控制信号。The detection determining module 102 is configured to detect the amplitude of the communication signal processed by the input protection module 106, and determine, according to the detected amplitude, the first signal type corresponding to the communication signal currently received by the input interface module 101, corresponding to the first A signal type switching control signal. In this embodiment, the detection determining module 102 includes an absolute value unit 1021 and a control unit 1022, wherein the absolute value unit 1021 is configured to detect the amplitude of the communication signal and obtain an absolute value of the amplitude; the control unit 1022, The first signal type corresponding to the communication signal currently received by the input interface module 101 is determined according to the absolute value of the detected amplitude, and is generated corresponding to the first signal class. Type switching control signal.
取绝对值单元1021主要针对通讯信号的负电平进行处理,处理后获得通讯信号的幅度的绝对值。本实施例中,取绝对值单元1021的电路如图3所示,包括:第四电阻R4,其1脚用于接收经输入防护模块106处理的通讯信号RXD,2脚与第五电阻R5的1脚、第六电阻R6的1脚和运放U1的负输入端2脚相连。U1的正输入端3脚接地,电源正端7脚接+15V电源信号,电源负端4脚接-15V电源信号。U1输出端6脚接二极管VD3的负端、VD4的正端。第五电阻R5的2脚与VD3的正端、第七电阻R7的2脚以及半固定电阻RV1的1脚相连;第六电阻R6的2脚与VD4的负端、第八电阻R8的1脚和第十电阻R10的1脚相连。R7的1脚与R8的2脚接地。RV1的2脚与第九电阻R9的1脚相连。R9的2脚与C4的1脚、第十一电阻R11的1脚和运放U2的正输入端3脚相连,R10的2脚与C5的1脚、第十二电阻R12的1脚和U2的负输入端2脚相连。同样的,U2的正负电源端7脚和4脚分别接到+15V、-15V电源信号上。C4的2脚、R11的2脚接地;R12的2脚、C5的2脚与U2的输出端6脚相连,输出处理后得到的通讯信号的幅值的绝对值信号ROUT。The absolute value unit 1021 is mainly processed for the negative level of the communication signal, and the absolute value of the amplitude of the communication signal is obtained after the processing. In this embodiment, the circuit of the absolute value unit 1021 is as shown in FIG. 3, and includes: a fourth resistor R4, and a pin 1 is configured to receive the communication signal RXD, the 2 pin and the fifth resistor R5 processed by the input protection module 106. Pin 1 of the 1st and 6th resistors R6 is connected to the 2nd pin of the negative input terminal of the operational amplifier U1. The positive input terminal of U1 is grounded, the positive terminal of the power supply is connected with the +15V power supply signal, and the negative terminal of the power supply is connected with the -15V power supply signal. The U1 output terminal 6 is connected to the negative terminal of the diode VD3 and the positive terminal of the VD4. The 2 pin of the fifth resistor R5 is connected to the positive terminal of VD3, the 2 pin of the seventh resistor R7, and the 1 pin of the semi-fixed resistor RV1; the 2 pin of the sixth resistor R6 and the negative terminal of VD4, and the 1 pin of the eighth resistor R8 Connected to pin 1 of the tenth resistor R10. Pin 1 of R7 is grounded to pin 2 of R8. Pin 2 of RV1 is connected to pin 1 of ninth resistor R9. Pin 2 of R9 is connected to pin 1 of C4, pin 1 of eleventh resistor R11, and pin 3 of positive input terminal of op amp U2. Pin 2 of R10 and pin 1 of C5, pin 1 of 12th resistor R12 and U2 The negative input terminal 2 is connected. Similarly, the 7-pin and 4-pin of the positive and negative power terminals of U2 are connected to the +15V and -15V power signals respectively. The 2 pin of C4 and the 2 pin of R11 are grounded; the 2 pin of R12 and the 2 pin of C5 are connected to the output pin 6 of U2, and the absolute value signal ROUT of the amplitude of the communication signal obtained after processing is output.
该取绝对值单元1021的电路由以U1为核心器件的正负整流电路和以U2为核心器件的差动比例运算放大器组成。为保证输出与输入比例是1:1,R4、R5、R6阻值要相等,R9、R10、R11、R12阻值要相等。为解决差动比例运算放大器输入电阻有限导致的输出不平衡问题,设计中加入了分流电阻R7、R8,并追加用于平衡波形的半固定电阻RV1。为了保证输出信号的高速化,这里二极管VD3、VD4需采用肖特基型寄生结电容小的二极管。C4、C5为相位补偿电容。The circuit of the absolute value unit 1021 is composed of a positive and negative rectifier circuit with U1 as a core device and a differential proportional operational amplifier with U2 as a core device. In order to ensure that the output to input ratio is 1:1, the resistance values of R4, R5 and R6 should be equal, and the resistance values of R9, R10, R11 and R12 should be equal. In order to solve the output imbalance caused by the limited input resistance of the differential proportional op amp, the shunt resistors R7 and R8 are added to the design, and the semi-fixed resistor RV1 for balancing the waveform is added. In order to ensure the speed of the output signal, the diodes VD3 and VD4 need to use a Schottky-type diode with a small parasitic junction capacitance. C4 and C5 are phase compensation capacitors.
而控制单元1022可以由三极管、MOS管等类型的器件构成,本实施例中的控制单元1022以三极管构成,如图4所示,控制单元1022的电路 包括:第十三电阻R13,其1脚与取绝对值单元1021的电路输出信号ROUT连接,2脚与稳压二极管VD5的负极相连。VD5的正极与三极管Q1的基极、电容C6的2脚相连。C6的1脚接地。Q1的集电极连接+15V电源,其发射极输出切换控制(control)信号,并通过第十四电阻R14接地。The control unit 1022 can be composed of a device such as a triode or a MOS transistor. The control unit 1022 in this embodiment is configured by a triode, as shown in FIG. 4, the circuit of the control unit 1022. The thirteenth resistor R13 includes a pin connected to the circuit output signal ROUT of the absolute value unit 1021 and a pin connected to the negative terminal of the Zener diode VD5. The anode of VD5 is connected to the base of transistor Q1 and the 2 pin of capacitor C6. Ground 1 of C6 is grounded. The collector of Q1 is connected to a +15V power supply, and its emitter output switching control signal is grounded through the fourteenth resistor R14.
这里VD5的稳压值取在6V~8V之间。C6配置为滤波,R14作为反馈电阻,其阻值取在10K左右。当输入信号为RS232信号时,ROUT为一个高于10V的电平,Q1导通,输出第一切换控制信号;当输入信号为RS485信号时,ROUT为一个0V~6V左右的电平,Q1无法导通,输出第二切换控制信号。Here, the voltage regulation value of VD5 is between 6V and 8V. C6 is configured for filtering, and R14 is used as a feedback resistor. Its resistance is taken at around 10K. When the input signal is RS232 signal, ROUT is a level higher than 10V, Q1 is turned on, and outputs the first switching control signal; when the input signal is RS485 signal, ROUT is a level of about 0V~6V, Q1 cannot Turning on, outputting a second switching control signal.
输入切换模块103,配置为接收切换控制信号,并根据切换控制信号,将输入信号输入至多路信号转换单元中对应于第一电平类型的一路。本实施例中,输入切换模块103由高速切换开关器件组成,如图5所示,其电源端VDD、VSS分别连接到正负电源+15V和-15V上,其输出通道S1A、S2A与用于转换RS232信号的RS232信号转换单元的输入端相连;S1B、S2B通道与用于转换RS485信号的RS485信号转换单元的输入端相连。The input switching module 103 is configured to receive the switching control signal, and input the input signal to one of the multiple signal converting units corresponding to the first level type according to the switching control signal. In this embodiment, the input switching module 103 is composed of a high-speed switching device. As shown in FIG. 5, the power terminals VDD and VSS are respectively connected to the positive and negative power supplies +15V and -15V, and the output channels S1A and S2A are used for The input end of the RS232 signal conversion unit that converts the RS232 signal is connected; the S1B and S2B channels are connected to the input end of the RS485 signal conversion unit for converting the RS485 signal.
IN1和IN2通道的control信号为该高速切换开关从控制单元1022接收的切换控制信号。当control信号为上述第二切换控制信号时,高速切换开关切换至S1B、S2B通道,将由D1、D2输入的经过输入防护模块106处理的RXD以及TXD信号送入RS485信号转换单元输入端,其中A信号和B信号为输入RS485信号转换单元的信号;当control信号为上述第一切换控制信号时,高速切换开关切换至S1A、S2A通道,将由D1、D2输入的经过输入防护模块106处理的RXD以及TXD信号送入RS232信号转换单元输入端,其中R-232信号和T-232信号为输入RS232信号转换单元的信号。在选择高速切换开关时,需注意其需为正负电源供电,且电源范围需大于RS232信号的电平范围。本实施例选择的高速切换开关为ADG5436。 The control signals of the IN1 and IN2 channels are switching control signals received by the high speed switch from the control unit 1022. When the control signal is the second switching control signal, the high-speed switching switch is switched to the S1B and S2B channels, and the RXD and TXD signals input by the input protection module 106 input by D1 and D2 are sent to the input end of the RS485 signal conversion unit, wherein A The signal and the B signal are signals input to the RS485 signal conversion unit; when the control signal is the first switching control signal, the high-speed switching switch is switched to the S1A, S2A channel, and the RXD input by the input protection module 106, which is input by D1 and D2, and The TXD signal is sent to the input of the RS232 signal conversion unit, wherein the R-232 signal and the T-232 signal are signals input to the RS232 signal conversion unit. When selecting a high-speed switch, it should be noted that it needs to supply power to the positive and negative power supplies, and the power supply range needs to be larger than the level range of the RS232 signal. The high speed switch selected in this embodiment is the ADG5436.
信号转换模块104,信号转换模块104包括多路信号转换单元,每路信号转换单元对应于一种信号类型的通讯信号,每路信号转换单元,配置为对接收到的输入信号进行信号转换后输出。本实施例中,信号转换模块104包括由RS485信号转换芯片,如MAX1487芯片构成的RS485信号转换单元,以及由RS232信号转换芯片,如MAX202E构成的RS232信号转换单元。同时需要注意的是,这里转换芯片的控制采用常见的硬件取反的自动翻转控制,从而实现整个过程的硬件自适应(如为其他串行差分信号,此处需更换为对应的信号转换芯片)。经过信号转换模块104转换后,得到输入信号对应的TTL电平信号。The signal conversion module 104 includes a multi-channel signal conversion unit, each of the signal conversion units corresponding to a signal type communication signal, and each of the signal conversion units is configured to perform signal conversion on the received input signal and output . In this embodiment, the signal conversion module 104 includes an RS485 signal conversion unit composed of an RS485 signal conversion chip, such as a MAX1487 chip, and an RS232 signal conversion unit composed of an RS232 signal conversion chip, such as the MAX202E. At the same time, it should be noted that the control of the conversion chip here adopts the automatic flipping control of common hardware inversion, thereby realizing the hardware adaptation of the whole process (for other serial differential signals, it needs to be replaced with the corresponding signal conversion chip here) . After being converted by the signal conversion module 104, a TTL level signal corresponding to the input signal is obtained.
串行输入模块105,与各路信号转换单元连接,配置为将从任意一路信号转换单元输出的信号输出。在串行输入模块105中,可以将RS485信号对应的转换信号RXD-485与RS232信号对应的转换信号RXD-232级联,RS485信号对应的转换信号TXD-485与RS232信号对应的转换信号TXD-232级联,然后直接送入CPU对应的异步串行口。针对通讯领域中许多采用-48V作为参考地的情况,或者CPU与转换芯片供电不一致的情况,还可接入高速光耦器件,将高速光耦器件的源边与CPU的一对异步串行口相接,副边与串行输入模块105相接,可实现高速光耦器件两边电平和参考地的转换。The serial input module 105 is connected to each of the signal conversion units and configured to output a signal output from any one of the signal conversion units. In the serial input module 105, the conversion signal RXD-485 corresponding to the RS485 signal and the conversion signal RXD-232 corresponding to the RS232 signal may be cascaded, and the conversion signal TXD-485 corresponding to the RS485 signal and the conversion signal corresponding to the RS232 signal TXD- 232 cascade, and then directly into the asynchronous serial port corresponding to the CPU. For many cases in the communication field where -48V is used as a reference ground, or when the CPU and the conversion chip are not in power supply, a high-speed optocoupler device can be connected, and the source side of the high-speed optocoupler device and the pair of asynchronous serial ports of the CPU can be connected. Dangling, the secondary side is connected to the serial input module 105, which can realize the conversion of the two-side level and the reference ground of the high-speed optocoupler device.
本发明实施例,通过检测通讯信号的幅值,并根据检测到的幅值,确定输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于第一信号类型的切换控制信号;根据切换控制信号,将通讯信号输入至多路信号转换单元中对应于第一信号类型的一路。实现了对通讯信号的硬件自适应自动完成,无需人工操作,不涉及软件编程,省去开发相关软件的麻烦,提高了可移植性,降低了操作失误;且采用同一输入接口模块、一套输入处理模块,仅占用CPU一对异步串行接口,彻底实现了两种通讯方式 的兼容,提高了电路的集成度,节约了资源。In the embodiment of the present invention, by detecting the amplitude of the communication signal, and determining the first signal type corresponding to the communication signal currently received by the input interface module according to the detected amplitude, generating a switching control signal corresponding to the first signal type; The control signal is switched, and the communication signal is input to one of the multiple signal conversion units corresponding to the first signal type. The hardware self-adaptive completion of the communication signal is realized, no manual operation is required, software programming is not involved, the trouble of developing related software is saved, the portability is improved, the operation error is reduced, and the same input interface module and a set of input are adopted. The processing module only occupies a pair of asynchronous serial interfaces of the CPU, and completely realizes two communication modes. The compatibility improves the integration of the circuit and saves resources.
第二实施例Second embodiment
请参阅图2,图2示出了本发明的第二实施例的通讯接口硬件自适应复用方法的流程图,该方法包括:Referring to FIG. 2, FIG. 2 is a flowchart of a method for adaptive multiplexing of a communication interface hardware according to a second embodiment of the present invention, the method comprising:
步骤201,从一输入接口模块的多个管脚上,接收外部输入的多种信号类型的通讯信号中的一种。Step 201: Receive one of a plurality of signal types of external input signals from a plurality of pins of an input interface module.
需要说明的是,多种信号类型的通讯信号包括RS232信号、与RS232信号存在电平差的其他通讯信号,其他通讯信号至少包括RS485信号。而且为了减少外界干扰对系统电路的影响,还可以对输入接口模块接收到的通讯信号进行EMC保护处理。It should be noted that the communication signals of various signal types include an RS232 signal, other communication signals having a level difference with the RS232 signal, and other communication signals include at least an RS485 signal. Moreover, in order to reduce the influence of external interference on the system circuit, the communication signal received by the input interface module can also be subjected to EMC protection processing.
步骤202,检测通讯信号的幅值,并根据检测到的幅值,确定输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于第一信号类型的切换控制信号。Step 202: Detect a magnitude of the communication signal, and determine, according to the detected amplitude, a first signal type corresponding to the communication signal currently received by the input interface module, and generate a switching control signal corresponding to the first signal type.
需要说明的是,步骤202是通过通讯信号的幅值的绝对值来产生切换控制信号,该过程包括:检测通讯信号的幅值,并获得幅值的绝对值;根据检测到的幅值的绝对值,确定输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于第一信号类型的切换控制信号。It should be noted that step 202 is to generate a switching control signal by using an absolute value of the amplitude of the communication signal, the process comprising: detecting the amplitude of the communication signal, and obtaining an absolute value of the amplitude; and determining the absolute value according to the amplitude And determining a first signal type corresponding to the communication signal currently received by the input interface module, and generating a switching control signal corresponding to the first signal type.
步骤203,根据切换控制信号,将通讯信号输入至多路信号转换单元中对应于第一信号类型的一路。Step 203: Input a communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit according to the switching control signal.
需要说明的是,每路信号转换单元对应于一种信号类型的通讯信号,步骤203是根据切换控制信号将通讯信号输入到对应的信号转换单元,从而对通讯信号进行正确的转换。It should be noted that each signal conversion unit corresponds to a signal type communication signal, and step 203 is to input the communication signal to the corresponding signal conversion unit according to the switching control signal, thereby correctly converting the communication signal.
步骤204,在信号转换模块处,对通讯信号进行信号转换后,输出至一串行输入模块。Step 204: At the signal conversion module, after the signal is converted, the signal is output to a serial input module.
需要说明的是,步骤204是通过与通讯信号对应的信号转换单元,将 通讯信号转化成对应的TTL电平信号。It should be noted that step 204 is performed by a signal conversion unit corresponding to the communication signal. The communication signal is converted into a corresponding TTL level signal.
步骤205,通过串行输入模块,接收各路信号转换单元输出的信号,并输出。Step 205: Receive a signal output by each signal conversion unit through a serial input module, and output the signal.
本发明实施例,通过检测通讯信号的幅值,并根据检测到的幅值,确定输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于第一信号类型的切换控制信号;根据切换控制信号,将通讯信号输入至多路信号转换单元中对应于第一信号类型的一路。实现了对通讯信号的硬件自适应自动完成,无需人工操作,不涉及软件编程,省去开发相关软件的麻烦,提高了可移植性,降低了操作失误;且采用同一输入接口模块、一套输入处理模块,仅占用CPU一对异步串行接口,彻底实现了两种通讯方式的兼容,提高了电路的集成度,节约了资源。In the embodiment of the present invention, by detecting the amplitude of the communication signal, and determining the first signal type corresponding to the communication signal currently received by the input interface module according to the detected amplitude, generating a switching control signal corresponding to the first signal type; The control signal is switched, and the communication signal is input to one of the multiple signal conversion units corresponding to the first signal type. The hardware self-adaptive completion of the communication signal is realized, no manual operation is required, software programming is not involved, the trouble of developing related software is saved, the portability is improved, the operation error is reduced, and the same input interface module and a set of input are adopted. The processing module only occupies a pair of asynchronous serial interfaces of the CPU, completely realizes the compatibility of the two communication modes, improves the integration degree of the circuit, and saves resources.
本领域普通技术人员可以意识到,在本申请所提供的实施例中,所揭露的系统和方法,可以通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的,例如,模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those of ordinary skill in the art will appreciate that the disclosed systems and methods may be implemented in other manners. For example, the system embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。 In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
工业实用性Industrial applicability
本发明实施例的装置包括:输入接口模块,配置为接收外部输入的多种信号类型的通讯信号中的一种;检测判断模块,配置为检测通讯信号的幅值,并根据检测到的幅值,确定当前通讯信号对应的第一信号类型,产生对应于第一信号类型的切换控制信号;输入切换模块,配置为将通讯信号输入至多路信号转换单元中对应于第一信号类型的一路;信号转换模块,配置为对接收到的通讯信号进行信号转换后输出;串行输入模块,配置为将从任意一路信号转换单元输出的信号输出;如此,解决了现有通讯接口自适应复用装置,需软件参与,可移植性差,结构复杂以及可靠性低的问题。 The device of the embodiment of the invention includes: an input interface module configured to receive one of a plurality of signal types of external input signals; the detection and determination module configured to detect the amplitude of the communication signal, and according to the detected amplitude Determining a first signal type corresponding to the current communication signal, generating a switching control signal corresponding to the first signal type; and inputting a switching module configured to input the communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit; The conversion module is configured to perform signal conversion on the received communication signal and output; the serial input module is configured to output a signal output from any one of the signal conversion units; thus, the existing communication interface adaptive multiplexing device is solved. Software participation, poor portability, complex structure and low reliability.

Claims (9)

  1. 一种通讯接口硬件自适应复用装置,包括:A communication interface hardware adaptive multiplexing device, comprising:
    输入接口模块,配置为通过自身的多个管脚,接收外部输入的多种信号类型的通讯信号中的一种;The input interface module is configured to receive one of a plurality of signal types of external input signals through a plurality of pins of the plurality;
    检测判断模块,配置为检测所述通讯信号的幅值,并根据检测到的幅值,确定所述输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于所述第一信号类型的切换控制信号;The detecting and determining module is configured to detect the amplitude of the communication signal, and determine, according to the detected amplitude, a first signal type corresponding to the communication signal currently received by the input interface module, to generate a signal type corresponding to the first signal Switching control signal;
    输入切换模块,配置为接收所述切换控制信号,并根据所述切换控制信号,将所述通讯信号输入至多路信号转换单元中对应于所述第一信号类型的一路;The input switching module is configured to receive the switching control signal, and input the communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit according to the switching control signal;
    信号转换模块,所述信号转换模块包括多路信号转换单元,每路信号转换单元对应于一种信号类型的通讯信号,每路信号转换单元,配置为对接收到的通讯信号进行信号转换后输出;a signal conversion module, the signal conversion module includes a multi-channel signal conversion unit, each of the signal conversion units corresponds to a signal type communication signal, and each of the signal conversion units is configured to perform signal conversion on the received communication signal and output ;
    串行输入模块,与各路信号转换单元连接,配置为将从任意一路信号转换单元输出的信号输出。The serial input module is connected to each of the signal conversion units and configured to output a signal output from any one of the signal conversion units.
  2. 如权利要求1所述的装置,其中,所述装置还包括输入防护模块,配置为对输入接口模块接收到的通讯信号进行EMC保护处理;The device of claim 1 , wherein the device further comprises an input protection module configured to perform EMC protection processing on the communication signal received by the input interface module;
    所述检测判断模块,配置为对经所述输入防护模块处理后的所述通讯信号的幅值进行检测,并根据检测结果产生所述切换控制信号;The detecting and determining module is configured to detect a magnitude of the communication signal processed by the input protection module, and generate the switching control signal according to the detection result;
    所述输入切换模块,配置为根据所述切换控制信号,将经所述输入防护模块处理后的所述通讯信号输入至多路信号转换单元中的一路。The input switching module is configured to input the communication signal processed by the input protection module to one of the multiple signal conversion units according to the switching control signal.
  3. 如权利要求1所述的装置,其中,所述检测判断模块包括:The apparatus of claim 1, wherein the detection determination module comprises:
    取绝对值单元,配置为检测所述通讯信号的幅值,并获取所述幅值的绝对值;Taking an absolute value unit, configured to detect a magnitude of the communication signal, and obtain an absolute value of the amplitude;
    控制单元,配置为根据所述幅值的绝对值,确定所述输入接口模块 当前接收的通讯信号对应的第一信号类型,产生对应于所述第一信号类型的切换控制信号。a control unit configured to determine the input interface module based on an absolute value of the amplitude A first signal type corresponding to the currently received communication signal generates a switching control signal corresponding to the first signal type.
  4. 如权利要求1所述的装置,其中,所述多种信号类型的通讯信号包括RS232信号、与RS232信号存在电平差的其他通讯信号,所述其他通讯信号至少包括RS485信号。The apparatus of claim 1, wherein the plurality of signal types of communication signals comprise RS232 signals, other communication signals having a level difference from the RS232 signals, and the other communication signals include at least RS485 signals.
  5. 如权利要求1所述的装置,其中,所述输入接口模块包括配置为接收外部输入的多种信号类型的通讯信号中的一种的第一管脚、第二管脚以及第三管脚。The apparatus of claim 1 wherein said input interface module comprises a first pin, a second pin, and a third pin configured to receive one of a plurality of signal types of externally input signals.
  6. 一种利用如权利要求1-5任一项所述的装置,实现通讯接口硬件自适应复用的方法,包括:A method for implementing adaptive multiplexing of a communication interface hardware by using the apparatus according to any one of claims 1-5, comprising:
    从一输入接口模块的多个管脚上,接收外部输入的多种信号类型的通讯信号中的一种;Receiving one of a plurality of signal types of external input signals from a plurality of pins of an input interface module;
    检测所述输入信号的幅值,并根据检测到的幅值,确定所述输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于所述第一信号类型的切换控制信号;Detecting an amplitude of the input signal, and determining, according to the detected amplitude, a first signal type corresponding to the communication signal currently received by the input interface module, generating a switching control signal corresponding to the first signal type;
    根据所述切换控制信号,将所述通讯信号输入至多路信号转换单元中对应于所述第一信号类型的一路;Transmitting, according to the switching control signal, the communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit;
    在信号转换模块处,对所述通讯信号进行信号转换后,输出至一串行输入模块;At the signal conversion module, after the signal is converted, the signal is output to a serial input module;
    通过所述串行输入模块,接收各路信号转换单元输出的信号,并输出。The signal output by each signal conversion unit is received by the serial input module and output.
  7. 如权利要求6所述的方法,其中,所述检测所述通讯信号的幅值的步骤之前,所述方法还包括:The method of claim 6 wherein said step of detecting said amplitude of said communication signal further comprises:
    对输入接口模块接收到的通讯信号进行EMC保护处理;Performing EMC protection processing on the communication signal received by the input interface module;
    所述检测所述通讯信号的幅值,进一步为,对经EMC保护处理后的 所述通讯信号的幅值进行检测;The detecting the amplitude of the communication signal, further, after being processed by the EMC protection The amplitude of the communication signal is detected;
    所述根据所述切换控制信号,将所述通讯信号输入至多路信号转换单元中对应于所述第一信号类型的一路,进一步为,根据所述切换控制信号,将经EMC保护处理后的所述通讯信号输入至多路信号转换单元中的一路。And inputting, according to the switching control signal, the communication signal to a path corresponding to the first signal type in the multi-channel signal conversion unit, and further, according to the switching control signal, the EMC-protected device The communication signal is input to one of the multiple signal conversion units.
  8. 如权利要求6所述的方法,其中,所述检测所述通讯信号的幅值,并根据检测到的幅值,确定所述输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于所述第一信号类型的切换控制信号,包括:The method of claim 6, wherein the detecting the amplitude of the communication signal, and determining the first signal type corresponding to the communication signal currently received by the input interface module according to the detected amplitude, generating a corresponding The switching control signal of the first signal type includes:
    检测所述通讯信号的幅值,并获得所述幅值的绝对值;Detecting a magnitude of the communication signal and obtaining an absolute value of the amplitude;
    根据所述幅值的绝对值,确定所述输入接口模块当前接收的通讯信号对应的第一信号类型,产生对应于所述第一信号类型的切换控制信号。Determining, according to the absolute value of the amplitude, a first signal type corresponding to the communication signal currently received by the input interface module, and generating a switching control signal corresponding to the first signal type.
  9. 如权利要求6所述的方法,其中,所述多种信号类型的通讯信号包括RS232信号、与RS232信号存在电平差的其他通讯信号,所述其他通讯信号至少包括RS485信号。 The method of claim 6 wherein said plurality of signal types of communication signals comprise RS232 signals, other communication signals having a level difference from said RS232 signals, said other communication signals comprising at least RS485 signals.
PCT/CN2017/074081 2016-04-08 2017-02-20 Communication interface hardware self-adaptive multiplexing device and method WO2017173889A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610216239.1 2016-04-08
CN201610216239.1A CN107273320A (en) 2016-04-08 2016-04-08 A kind of adaptive multiplexer of communication interface hardware and method

Publications (1)

Publication Number Publication Date
WO2017173889A1 true WO2017173889A1 (en) 2017-10-12

Family

ID=60000232

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/074081 WO2017173889A1 (en) 2016-04-08 2017-02-20 Communication interface hardware self-adaptive multiplexing device and method

Country Status (2)

Country Link
CN (1) CN107273320A (en)
WO (1) WO2017173889A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107896152A (en) * 2017-12-28 2018-04-10 黑龙江龙电电气有限公司 Multi-channel communication sharing device and method

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117400B (en) * 2018-08-09 2021-01-05 深圳市宏电技术股份有限公司 Automatic interface switching device and method
CN109462395B (en) * 2018-12-28 2023-08-15 常州朗奇威电器有限公司 Interface multiplexing conversion circuit and multiplexing conversion method
CN111835378B (en) * 2020-06-08 2024-03-08 珠海格力电器股份有限公司 Communication type switching circuit and method and air conditioning equipment
CN114564426B (en) * 2020-11-27 2024-05-14 中国科学院声学研究所 Embedded multi-interface data conversion device
CN116074155B (en) * 2023-02-17 2024-02-13 广东保伦电子股份有限公司 Transmission control method, device and system based on composite bus communication equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140557A (en) * 2007-10-23 2008-03-12 中兴通讯股份有限公司 System and method of RS232/RS48 compatibility interface
US20100217900A1 (en) * 1999-03-26 2010-08-26 Dearborn Group, Inc. Protocol adapter for passing diagnostic messages between vehicle networks and a host computer
CN201638145U (en) * 2010-01-12 2010-11-17 北京四方继保自动化股份有限公司 RS232/RS485 (Recommend Standard 232/Recommend Standard 485) integrated interface circuit
CN201927859U (en) * 2011-01-10 2011-08-10 华为终端有限公司 Reusable interface
CN102722465A (en) * 2012-05-28 2012-10-10 华为技术有限公司 Interface multiplexing device and electronic equipment
CN103116567A (en) * 2013-01-24 2013-05-22 富通集团有限公司 Multi-serial-port selection circuit

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6601124B1 (en) * 2000-02-14 2003-07-29 International Business Machines Corporation Universal interface for selectively coupling to a computer port type and method therefor
CN202600690U (en) * 2012-05-09 2012-12-12 北京立华莱康平台科技有限公司 Circuit for RS232 and RS485 communication modes

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100217900A1 (en) * 1999-03-26 2010-08-26 Dearborn Group, Inc. Protocol adapter for passing diagnostic messages between vehicle networks and a host computer
CN101140557A (en) * 2007-10-23 2008-03-12 中兴通讯股份有限公司 System and method of RS232/RS48 compatibility interface
CN201638145U (en) * 2010-01-12 2010-11-17 北京四方继保自动化股份有限公司 RS232/RS485 (Recommend Standard 232/Recommend Standard 485) integrated interface circuit
CN201927859U (en) * 2011-01-10 2011-08-10 华为终端有限公司 Reusable interface
CN102722465A (en) * 2012-05-28 2012-10-10 华为技术有限公司 Interface multiplexing device and electronic equipment
CN103116567A (en) * 2013-01-24 2013-05-22 富通集团有限公司 Multi-serial-port selection circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107896152A (en) * 2017-12-28 2018-04-10 黑龙江龙电电气有限公司 Multi-channel communication sharing device and method

Also Published As

Publication number Publication date
CN107273320A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
WO2017173889A1 (en) Communication interface hardware self-adaptive multiplexing device and method
US9009379B1 (en) Communicating with MIPI-compliant devices using non-MIPI interfaces
US5347538A (en) Transceiver for bidirectional link, integrated circuit including the transceiver, and application to communication between units of a system
CN103916116A (en) Interface level switch device
KR101768250B1 (en) Apparatus for Switching RS-485 Terminal Polarity
CN103684407A (en) Otg device
CN109831349B (en) SpaceWire bus free topology bit error rate test system and method
CN106291321B (en) L abWindows/CVI-based plasma power supply circuit automatic test platform and method
CN105472782A (en) Wireless communication terminal
US20220329449A1 (en) Filtering-Based Power Supply Apparatus, Power Sourcing Equipment, and Power Supply System
CN204145494U (en) A kind of data sending device and a kind of receiving system
CN104125173B (en) data communication path switching circuit, vehicle-mounted router and automobile
CN203722640U (en) Electric loopback light module
CN210804037U (en) Intermediate device integrated electronic single machine for carrier rocket remote measuring system
CN211906270U (en) 485 device and RS485 interface of self-adaptation serial bus polarity
AU2008200997A1 (en) A conversion circuit
CN211089663U (en) Vehicle-mounted Ethernet data intercepting device
CN204256735U (en) The nonpolarity RS-485 interface chip of the inner upper pull down resistor of band
CN103118143A (en) Multiplex circuit of serial interface and Ethernet interface
CN106374905B (en) signal transmission circuit and communication device
CN116561035B (en) Method and device for two-way communication between FPGA and MIPI and electronic equipment
CN105067944A (en) Detection circuit and detection method for audio interfaces
CN215072731U (en) Signal measurement circuit, acquisition card and test equipment
CN106324331B (en) A kind of isolated power supply front voltage method of sampling and device
CN216873286U (en) First image capturing device and second image capturing device

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17778554

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17778554

Country of ref document: EP

Kind code of ref document: A1