A GPIO circuit with configurable level high and low validity and switchable input and output

By introducing mode switching logic module and status registers into the GPIO circuit, dynamic configuration and mode switching of GPIO pins are realized, which solves the problem of fixed GPIO interface levels and modes in the existing technology, and improves the flexibility and response speed of the system .

CN118760638BActive Publication Date: 2024-11-15TIANJIN SIASUN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411239747.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-11-15
Estimated Expiration
2044-09-05

AI Technical Summary

Technical Problem

The existing GPIO interface fixes its level validity and input/output mode, limiting the compatibility and flexibility of the system and cannot be flexibly configured according to actual application scenarios.

Method used

A GPIO circuit including a mode switching logic module and a status register is designed. The mode switching logic module determines the working mode of the GPIO based on the configuration information in the status register. The level-sensitive unit is responsible for detecting and converting the high and low level signals on the pins. , supports high and low effective configuration and input and output mode switching.

Benefits of technology

It realizes dynamic configuration of GPIO pins, supports modifying level validity and input and output modes during system operation, without restarting the system, significantly improving system response speed and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760638B_ABST
    Figure CN118760638B_ABST
Patent Text Reader

Abstract

The present invention is a GPIO circuit that can be configured with high and low level validity and can switch input and output, including a mode switching logic module, a status register, and a level sensitive unit; the mode switching logic module determines the working mode of the GPIO according to the configuration information in the status register; the status register stores the setting of the GPIO working mode; the level sensitive unit is responsible for detecting and converting the high and low level signals on the pin. The present invention can configure the GPIO pin to be high level valid or low level valid through internal register settings to meet the requirements of different protocols or hardware devices; through software instructions or hardware trigger mechanisms, it can switch between input mode and output mode in real time; it supports modifying the level validity and input and output mode at any time during system operation without restarting the system, which significantly improves the system response speed and resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of integrated circuit design and microelectronic technology, and in particular to a GPIO circuit which can be configured with high and low level validity and can switch input and output. Background Art

[0002] In modern digital systems, general purpose input / output (GPIO) interfaces are an indispensable part, and they are usually used for data transmission and control signal interaction between devices. However, existing GPIO interfaces often have fixed level validity and input / output modes, and cannot be flexibly configured according to actual application scenarios, which to some extent limits the compatibility and flexibility of the system. Summary of the invention

[0003] The present invention aims to solve the deficiencies of the prior art and provide a GPIO circuit which can be configured with high and low level validity and can switch input and output.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] A GPIO circuit with configurable high and low level validity and switchable input and output includes a mode switching logic module, a status register, and a level sensitive unit; the mode switching logic module determines the GPIO working mode according to the configuration information in the status register; the status register stores the setting of the GPIO working mode; the level sensitive unit is responsible for detecting and converting the high and low level signals on the pin.

[0006] The GPIO working mode settings include level validity and input / output mode.

[0007] A20 of U1 of the mode switching logic module and the status register is the input pin, and E14 of U1 is the output pin; the level sensitive unit includes an input circuit and an output circuit: the input circuit includes an external input signal detection part and a COM1 level configuration part; the output circuit includes an output port control part and a COM2 level configuration part.

[0008] The specific circuit of the external input signal detection part of the input circuit is as follows:

[0009] The A20 pin of U1 is connected to the 4th pin of the optocoupler U2, the 1st pin of U2 is connected to COM1, the 2nd pin of U2 is connected in series with the current limiting resistor R3 and is connected to the external port GPIO1, the current limiting resistor R2 is connected between the 1st and 2nd pins of U2, the 3rd pin of U2 is connected to GND, and the 4th pin of U2 is pulled up to the 3.3V level through the current limiting resistor R1.

[0010] The specific circuit of COM1 level configuration of the input circuit is as follows:

[0011] The B18 pin of U1 is connected to the 2nd pin of the optocoupler U5, the 1st pin of U5 is connected to DC3.3V through the current limiting resistor R12, the resistor R13 is connected between the 1st and 2nd pins of U5, the 4th pin of U5 is connected to the DC24V level, the 3rd pin of U5 is connected to the gate of Q3 through the current limiting resistor R11, the protection diode D9 and the shunt protection resistor R10 are connected between the gate and the source of Q3, the source of Q3 is connected to GND, the current limiting resistor R9 and the current limiting resistor R7 are connected in series between the drain of Q3 and the gate of Q1, the protection diode D1 and the current limiting resistor R8 are connected between the gate of Q1 and the source after the current limiting resistor R7 is connected in series, the source of Q1 is connected to the DC24V level, and the drain of Q1 is COM1;

[0012] The A18 pin of U1 is connected to the 2nd pin of the optocoupler U6, the 1st pin of U6 is connected to DC3.3V through the current limiting resistor R14, a resistor R15 is connected between the 1st and 2nd pins of U6, the 4th pin of U6 is connected to the DC24V level, the 3rd pin of U6 is connected to the gate of Q2 through the current limiting resistor R16, the protection diode D2 and the shunt protection resistor R17 are connected between the gate and source of Q2, the source of Q2 is connected to GND, and the drain of Q2 is COM1.

[0013] The specific circuit of the output port control part of the output part circuit is as follows:

[0014] The E14 pin of U1 is connected in series with a current limiting resistor R4 and is connected to pin 2 of the optocoupler U3. Pin 1 of U3 is connected to DC3.3V, pin 3 of U3 is connected to GND, pin 4 of U3 is connected to pin 2 of the optocoupler U4, pin 1 of U4 is connected to DC24V through a current limiting resistor R5, a varistor R6 is connected between pins 3 and 4 of U4, pin 3 of U4 is GPIO1, and pin 4 of U4 is COM2.

[0015] The specific circuit of COM2 level configuration of the output circuit is as follows:

[0016] The D14 pin of U1 is connected to the 2nd pin of the optocoupler U7, the 1st pin of U7 is connected to DC3.3V through the current limiting resistor R22, the resistor R23 is connected between the 1st and 2nd pins of U7, the 4th pin of U7 is connected to the DC24V level, the 3rd pin of U7 is connected to the gate of Q5 through the current limiting resistor R21, the protection diode D4 and the shunt protection resistor R20 are connected between the gate and the source of Q5, the source of Q5 is connected to GND, the current limiting resistor R18 and the current limiting resistor R19 are connected in series between the drain of Q5 and the gate of Q4, the protection diode D3 and another current limiting resistor R18 are connected between the gate of Q4 and the source after the current limiting resistor R18 is connected in series, the source of Q4 is connected to the DC24V level, and the drain of Q4 is COM2;

[0017] The C14 pin of U1 is connected to the 2nd pin of the optocoupler U8, the 1st pin of U8 is connected to DC3.3V through the current limiting resistor R24, a resistor R25 is connected between the 1st and 2nd pins of U8, the 4th pin of U8 is connected to the DC24V level, the 3rd pin of U8 is connected to the gate of Q6 through the current limiting resistor R26, the protection diode D5 and the shunt protection resistor R27 are connected between the gate and source of Q6, the source of Q6 is connected to GND, and the drain of Q6 is COM2.

[0018] The beneficial effects of the present invention are as follows: the present invention can configure the GPIO pin to be high-level valid or low-level valid through internal register settings to meet the requirements of different protocols or hardware devices; through software instructions or hardware trigger mechanisms, it can switch between input mode and output mode in real time; it supports modifying the level validity and input and output modes at any time during system operation without restarting the system, which significantly improves the system response speed and resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a circuit diagram of the present invention;

[0020] Figure 2 It is a circuit diagram of the mode switching logic module and the status register;

[0021] Figure 3 A circuit diagram of an external input signal detection part and an output port control part of a level sensitive unit;

[0022] Figure 4 It is a circuit diagram of the COM1 level configuration part of the level sensitive unit;

[0023] Figure 5 It is a circuit diagram of the COM2 level configuration part of the level sensitive unit;

[0024] The following is a detailed description of the embodiments of the present invention with reference to the accompanying drawings. DETAILED DESCRIPTION

[0025] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The embodiments are only used to explain the present invention and are not used to limit the scope of the present invention. The present invention is described in more detail by way of example with reference to the accompanying drawings in the following paragraphs. The advantages and features of the present invention will become clearer according to the following description. It should be noted that the accompanying drawings are all in a very simplified form and are not in precise proportions, and are only used to facilitate and clearly assist in explaining the purpose of the embodiments of the present invention.

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0027] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0028] A GPIO circuit that can be configured with high and low levels and can switch input and output, such as Figure 1 As shown, it includes a mode switching logic module, a status register, and a level sensitive unit; the mode switching logic module determines the GPIO working mode according to the configuration information in the status register; the status register stores the setting of the GPIO working mode; the level sensitive unit is responsible for detecting and converting the high and low level signals on the pin.

[0029] The settings of GPIO working mode include but are not limited to level validity, input / output mode, etc.

[0030] A20 of U1 of the mode switching logic module and the status register is the input pin, and E14 of U1 is the output pin, such as Figure 2 As shown; the level sensitive unit includes an input circuit and an output circuit: the input circuit includes an external input signal detection part and a COM1 level configuration part, such as Figure 3 , Figure 4 As shown; the output circuit includes the output port control part and the COM2 level configuration part, as shown Figure 3 , Figure 5 shown.

[0031] (1) Input circuit

[0032] a. External input signal detection part of the input circuit: It is mainly implemented by the bidirectional optocoupler U2 to isolate the external input signal and convert the DC24V high level input from the external port into a DC3.3V level, thereby accessing the mode switching logic module and the U1 pin in the status register, and further realizing U1 monitoring of the external input level status.

[0033] The specific circuit of the external input signal detection part of the input circuit is as follows Figure 3 As shown,

[0034] The A20 pin of U1 is connected to the 4th pin of the optocoupler U2, the 1st pin of U2 is connected to COM1, the 2nd pin of U2 is connected in series with the current limiting resistor R3 and is connected to the external port GPIO1, the current limiting resistor R2 is connected between the 1st and 2nd pins of U2, the 3rd pin of U2 is connected to GND, and the 4th pin of U2 is pulled up to the 3.3V level through the current limiting resistor R1.

[0035] When U2 is not turned on, the level of pin 4 of U2 is high by default. When U2 is turned on, the level of pin 4 of U2 is pulled low.

[0036] The high / low validity of the input terminal depends on the level of COM1. When COM1 is DC24V, the low-level input is valid. When COM1 is GND, the high-level input is valid.

[0037] b. COM1 level configuration part of the input circuit: When COM1 needs to be configured as a high level, it is an input low-active mode. It is necessary to output a low level through the B18 pin of U1, and the A18 pin outputs a high level to turn on P-MOS Q1 and turn off N-MOS Q2; when COM1 needs to be configured as a low level, it is an input high-active mode. It is necessary to output a high level through the B18 pin of U1, and the A18 pin outputs a low level to turn on N-MOS Q2 and turn off P-MOS Q1.

[0038] The specific circuit of COM1 level configuration of the input circuit is as follows Figure 4 As shown,

[0039] The B18 pin of U1 is connected to the 2nd pin of the optocoupler U5, the 1st pin of U5 is connected to DC3.3V through the current limiting resistor R12, the resistor R13 is connected between the 1st and 2nd pins of U5, the 4th pin of U5 is connected to the DC24V level, the 3rd pin of U5 is connected to the gate of Q3 through the current limiting resistor R11, the protection diode D9 and the shunt protection resistor R10 are connected between the gate and the source of Q3, when the gate voltage is too high, D9 will be turned on to prevent the base voltage of Q3 from being too high and damaging the transistor, the source of Q3 is connected to GND, the current limiting resistor R9 and the current limiting resistor R7 are connected in series between the drain of Q3 and the gate of Q1, the protection diode D1 and the current limiting resistor R8 are connected between the gate of Q1 and the source after the current limiting resistor R7 is connected in series, when the gate voltage is too high, D1 will be turned on to prevent the base voltage of Q1 from being too high and damaging the transistor, the source of Q1 is connected to the DC24V level, and the drain of Q1 is COM1;

[0040] In the above part, when the level of pin 2 of U5 is low, pins 3 and 4 of U5 are turned on, the gate level of Q3 forms a potential difference with the source, the drain-source of Q3 is turned on, and then the gate and source of Q1 form a potential difference, the drain-source of Q1 is turned on, and the COM1 terminal is a DC24V high level; when the level of pin 2 of U5 is high, pins 3 and 4 of U5 are not turned on, the gate of Q3 is high, the drain-source of Q3 is not turned on, and Q1 is turned off.

[0041] The A18 pin of U1 is connected to the 2nd pin of the optocoupler U6, the 1st pin of U6 is connected to DC3.3V through the current limiting resistor R14, the resistor R15 is connected between the 1st and 2nd pins of U6, the 4th pin of U6 is connected to the DC24V level, the 3rd pin of U6 is connected to the gate of Q2 through the current limiting resistor R16, the protection diode D2 and the shunt protection resistor R17 are connected between the gate and the source of Q2, when the gate voltage is too high, D2 will be turned on to prevent the base voltage of Q2 from being too high and damaging the transistor, the source of Q2 is connected to GND, and the drain of Q2 is COM1;

[0042] In the above part, when the level of pin 2 of U6 is low, pins 3 and 4 of U6 are turned on, the gate level of Q2 forms a potential difference with the source, the drain-source of Q2 is turned on, and the COM1 terminal is GND low level; when the level of pin 2 of U6 is low, pins 3 and 4 of U6 are not turned on, the gate of Q2 is low, the gate-source of Q2 is not turned on, and Q2 is turned off.

[0043] Input active high mode:

[0044] When the user sets the mode to the input high-valid mode through the mode switching logic module and the status register, the A18 (Ctl2) pin of U1 can be pulled low and the B18 (Ctl1) pin level of U1 can be pulled high so that the optocoupler U6 turns on Q2, U5 turns off Q1, and the COM1 level is low. Therefore, when the GPIO1 port inputs a high level, U2 is triggered to turn on, and the state of the A20 pin of U1 changes from a high-level input to a low level, thereby detecting the external high-level input and realizing the input high-valid mode.

[0045] Input active low mode:

[0046] When the user sets the mode to the input low-active mode through the mode switching logic module and the status register, the B18 (Ctl1) pin of U1 can be pulled low, and the A18 (Ctl2) pin of U1 can be pulled high to make the optocoupler U5 turn on Q1, and the optocoupler U6 turn off Q2. The COM1 level is high, so when the GPIO1 port inputs a low level, U2 is triggered to turn on, and the state of the A20 pin of U1 changes from a high-level input to a low level, thereby detecting the external low-level input and realizing the input low-active mode.

[0047] (2) Output circuit

[0048] a. Output port control part of the output circuit: mainly controlled by the E14 port of U1 to control the optocoupler U3 and the optical MOS U4 to realize the active or passive output of the GPIO1 port.

[0049] The specific circuit of the output port control part of the output part circuit is as follows Figure 3 As shown,

[0050] The E14 pin of U1 is connected in series with a current limiting resistor R4 and is connected to pin 2 of the optocoupler U3. Pin 1 of U3 is connected to DC3.3V, pin 3 of U3 is connected to GND, pin 4 of U3 is connected to pin 2 of the optocoupler U4, pin 1 of U4 is connected to DC24V through a current limiting resistor R5, a varistor R6 is connected between pins 3 and 4 of U4, pin 3 of U4 is GPIO1, and pin 4 of U4 is COM2.

[0051] The active or passive output of the output terminal depends on the electrical level of the COM2 terminal. When the COM2 terminal is DC24V, it is an active output; when the DC24V is GND, it is a passive output.

[0052] b. COM2 level configuration part of the output circuit: When COM2 needs to be configured as a high level, it is in active output mode, and needs to output a low level through the D14 pin of U1, and the C14 pin outputs a high level, turning on P-MOS Q4 and turning off N-MOS Q6. When COM2 needs to be configured as a low level, it needs to output a high level through the D14 pin of U1, and the C14 pin outputs a low level, turning on N-MOS Q6 and turning off P-MOS Q4.

[0053] The specific circuit of COM2 level configuration of the output circuit is as follows Figure 5 As shown,

[0054] The D14 pin of U1 is connected to the 2nd pin of the optocoupler U7, the 1st pin of U7 is connected to DC3.3V through the current limiting resistor R22, the resistor R23 is connected between the 1st and 2nd pins of U7, the 4th pin of U7 is connected to the DC24V level, the 3rd pin of U7 is connected to the gate of Q5 through the current limiting resistor R21, the protection diode D4 and the shunt protection resistor R20 are connected between the gate and the source of Q5, when the gate voltage is too high, D4 will be turned on to prevent the base voltage of Q5 from being too high and damaging the transistor, the source of Q5 is connected to GND, the current limiting resistor R18 and the current limiting resistor R19 are connected in series between the drain of Q5 and the gate of Q4, the gate of Q4 is connected in series with the current limiting resistor R18 and the protection diode D3 and another current limiting resistor R18 are connected between the source and the gate, when the gate voltage is too high, D3 will be turned on to prevent the base voltage of Q4 from being too high and damaging the transistor, the source of Q4 is connected to the DC24V level, and the drain of Q4 is COM2;

[0055] In the above part, when the level of pin 2 of U7 is low, pins 3 and 4 of U7 are turned on, the gate level of Q5 forms a potential difference with the source, the drain-source of Q5 is turned on, and then the gate and source of Q4 form a potential difference, the drain-source of Q4 is turned on, and the COM2 terminal is a DC24V high level; when the level of pin 2 of U7 is high, pins 3 and 4 of U7 are not turned on, the gate of Q5 is high, the drain-source of Q5 is not turned on, and Q4 is turned off.

[0056] The C14 pin of U1 is connected to the 2nd pin of the optocoupler U8, the 1st pin of U8 is connected to DC3.3V through the current limiting resistor R24, a resistor R25 is connected between the 1st and 2nd pins of U8, the 4th pin of U8 is connected to the DC24V level, the 3rd pin of U8 is connected to the gate of Q6 through the current limiting resistor R26, the protection diode D5 and the shunt protection resistor R27 are connected between the gate and source of Q6, when the gate voltage is too high, D5 will be turned on to prevent the base voltage of Q6 from being too high and damaging the transistor, the source of Q6 is connected to GND, and the drain of Q6 is COM2.

[0057] In the above part, when the level of pin 2 of U8 is low, pins 3 and 4 of U8 are turned on, the gate level and source of Q6 form a potential difference, the drain-source of Q6 is turned on, and the COM2 terminal is GND low level; when the level of pin 2 of U8 is low, pins 3 and 4 of U8 are not turned on, the gate of Q6 is low, the gate-source of Q6 is not turned on, and Q6 is turned off.

[0058] Passive output mode:

[0059] When the user sets the mode to passive output mode through the mode switching logic module and the status register, the C14 (Ctl4) pin of U1 can be pulled low and the D14 (Ctl3) level of U1 can be pulled high so that the optocoupler U8 turns on Q6, U7 turns off Q4, and the COM2 level is low. Therefore, when the GPIO1 port outputs a valid level of low, the passive output mode is realized.

[0060] Active output mode:

[0061] When the user sets the mode to active output mode through the mode switching logic module and the status register, the D14 (Ctl3) pin of U1 can be pulled low and the C14 (Ctl4) pin level of U1 can be pulled high so that the optocoupler U7 turns on Q4, the optocoupler U8 turns off Q6, the COM2 level is high, and the slave output valid level is high, thereby realizing the active output mode.

[0062] The present invention can achieve the following functions:

[0063] Level high and low effective configuration: Through the mode switching logic module and status register setting, the GPIO pin can be configured as high level effective or low level effective to meet the needs of different protocols or hardware devices.

[0064] Input and output mode switching: Through the mode switching logic module and status register settings, it can switch between input mode and output mode in real time; in input mode, the GPIO pin can read external signals; in output mode, it can send control signals to external devices.

[0065] Dynamic configuration capability: The GPIO circuit supports modifying the level validity and input / output mode at any time during system operation without restarting the system, which significantly improves system response speed and resource utilization.

[0066] The present invention is described above by way of example in conjunction with the accompanying drawings. It is obvious that the specific implementation of the present invention is not limited to the above-mentioned method. As long as various improvements are made using the method concept and technical solution of the present invention, or are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.

Claims

1. A GPIO circuit with configurable level high and low validity and switchable input and output, It is characterized in that It includes a mode switching logic module, a status register, and a level-sensitive unit; The mode switching logic module and the status register are composed of a programmable logic chip U1, the A20 pin of U1 is the input pin, the E14 pin of U1 is the output pin, the B18 pin and the A18 pin of U1 are the input common level switching control pins Ctl1 and Ctl2, and the D14 pin and the C14 pin of U1 are the output common level switching control pins Ctl3 and Ctl4; The level sensitive unit includes input circuit and output circuit: The input circuit includes an external input signal detection part and a COM1 level configuration part; the external input signal detection part includes an optocoupler U2 and resistors R1-R3; the COM1 level configuration part includes an optocoupler U5, an optocoupler U6, MOS tubes Q1-Q3, and resistors R7-R17; The output circuit includes an output port control part and a COM2 level configuration part; the output port control part includes an optocoupler U3, an optocoupler U4, resistors R4-R5, and a varistor R6; the COM2 level configuration part includes an optocoupler U7, an optocoupler U8, MOS tubes Q4-Q6, and resistors R17-R27; The specific circuit connection is as follows: The A20 pin of U1 is connected to the 4th pin of the optocoupler U2, the 1st pin of U2 is connected to COM1, the 2nd pin of U2 is connected to the external port GPIO1 through a current limiting resistor R3 in series, the 1st and 2nd pins of U2 are connected with a current limiting resistor R2, the 3rd pin of U2 is connected to GND, and the 4th pin of U2 is pulled up to 3.3V level through the current limiting resistor R1; The B18 pin of U1 is connected to the 2nd pin of the optocoupler U5, the 1st pin of U5 is connected to DC3.3V through the current limiting resistor R12, the resistor R13 is connected between the 1st and 2nd pins of U5, the 4th pin of U5 is connected to the DC24V level, the 3rd pin of U5 is connected to the gate of Q3 through the current limiting resistor R11, the protection diode D9 and the shunt protection resistor R10 are connected between the gate and the source of Q3, the source of Q3 is connected to GND, the current limiting resistor R9 and the current limiting resistor R7 are connected in series between the drain of Q3 and the gate of Q1, the protection diode D1 and the current limiting resistor R8 are connected between the gate of Q1 and the source after the current limiting resistor R7 is connected in series, the source of Q1 is connected to the DC24V level, and the drain of Q1 is COM1; The A18 pin of U1 is connected to the 2nd pin of the optocoupler U6, the 1st pin of U6 is connected to DC3.3V through the current limiting resistor R14, the resistor R15 is connected between the 1st and 2nd pins of U6, the 4th pin of U6 is connected to the DC24V level, the 3rd pin of U6 is connected to the gate of Q2 through the current limiting resistor R16, the protection diode D2 and the shunt protection resistor R17 are connected between the gate and source of Q2, the source of Q2 is connected to GND, and the drain of Q2 is COM1; The E14 pin of U1 is connected in series with a current limiting resistor R4 and connected to the 2nd pin of the optocoupler U3. The 1st pin of U3 is connected to DC3.3V, the 3rd pin of U3 is connected to GND, the 4th pin of U3 is connected to the 2nd pin of the optocoupler U4, the 1st pin of U4 is connected to DC24V through the current limiting resistor R5, a varistor R6 is connected between the 3rd and 4th pins of U4, the 3rd pin of U4 is GPIO1, and the 4th pin of U4 is COM2; The D14 pin of U1 is connected to the 2nd pin of the optocoupler U7, the 1st pin of U7 is connected to DC3.3V through the current limiting resistor R22, the resistor R23 is connected between the 1st and 2nd pins of U7, the 4th pin of U7 is connected to the DC24V level, the 3rd pin of U7 is connected to the gate of Q5 through the current limiting resistor R21, the protection diode D4 and the shunt protection resistor R20 are connected between the gate and the source of Q5, the source of Q5 is connected to GND, the current limiting resistor R18 and the current limiting resistor R19 are connected in series between the drain of Q5 and the gate of Q4, the protection diode D3 and another current limiting resistor R18 are connected between the gate of Q4 and the source after the current limiting resistor R18 is connected in series, the source of Q4 is connected to the DC24V level, and the drain of Q4 is COM2; The C14 pin of U1 is connected to the 2nd pin of the optocoupler U8, the 1st pin of U8 is connected to DC3.3V through the current limiting resistor R24, a resistor R25 is connected between the 1st and 2nd pins of U8, the 4th pin of U8 is connected to the DC24V level, the 3rd pin of U8 is connected to the gate of Q6 through the current limiting resistor R26, the protection diode D5 and the shunt protection resistor R27 are connected between the gate and source of Q6, the source of Q6 is connected to GND, and the drain of Q6 is COM2.