A single port bidirectional level shifting and state back read circuit

By employing a single-port bidirectional level conversion and status readback circuit in the traction control of rail transit locomotives, the problems of complex interface design, high cost, and lack of online fault detection have been solved, realizing bidirectional signal transmission and online fault detection, and improving the reliability and adaptability of the system.

CN123163608APending Publication Date: 2026-11-24CRRC DALIAN R & D CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611314280.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies in rail transit locomotive traction control suffer from complex interface design, high cost, lack of online fault detection functions, poor versatility, and difficulty in adapting to diverse industrial control needs.

Method used

A single-port bidirectional level conversion and status readback circuit is adopted, including a bidirectional port, a driver stage, an input shaping stage, a level conversion and voltage divider network, and a protection circuit. The bidirectional transmission, level conversion, and status readback of the signal are realized through components such as NPN transistors, Schmitt trigger inverters, and diodes.

Benefits of technology

It enables bidirectional signal transmission and online fault detection, improving the system's reliability and maintainability. It is suitable for complex environments with high vibration and strong interference, while reducing cost and complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123163608A_ABST
    Figure CN123163608A_ABST
Patent Text Reader

Abstract

This invention discloses a single-port bidirectional level conversion and status readback circuit. The circuit includes a bidirectional port, a driver stage, an input shaping stage, a level conversion and voltage divider network, and a protection circuit. The protection circuit protects the circuit components from damage under abnormal conditions. The bidirectional port connects to the output of a preset external device and enables bidirectional signal transmission. The driver stage and the level conversion and voltage divider network are connected to the output of the bidirectional port. The driver stage drives the signal output from the external device. The level conversion and voltage divider network performs level conversion and voltage division processing on the signal input from the external device. The input of the input shaping stage is connected to the output of the level conversion and voltage divider network. The input shaping stage shapes the output signal of the level conversion and voltage divider network, outputs a readback signal, and transmits it to the input of the external device. This invention solves the problems of existing solutions, such as inability to monitor interface faults online, poor versatility, and high cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of rail transit locomotive traction control technology, and in particular to a single-port bidirectional level conversion and status readback circuit. Background Technology

[0002] In traction control units (TCUs) of rail transit vehicles or other industrial control cabinets, the circuit system typically adopts a "motherboard (backplane) + plug-in (functional boards)" architecture. The control system needs to acquire a large number of digital signals (such as driver commands, contactor status, and sensor alarms) and output control signals (such as driving relays and indicator lights). Therefore, there is a need for inter-board communication; functional boards (such as DSP boards) need to interact with the motherboard or other boards via the backplane bus. There is also a need for external interfaces, where functional boards connect to external sensors or actuators. Existing interface designs typically separate the "backplane interface" from the "external interface," or use complex bus transceivers. This results in complex PCB layouts and a lack of unified monitoring methods for interface status.

[0003] One commonly used configurable I / O solution in industrial control is the dedicated I / O expansion chip, such as the PCA9555 and PCF8574. These chips communicate with the main controller via I²C or SPI buses and integrate multiple configurable input / output pins. Users can independently configure each pin as an input or output pin using bus commands. While these dedicated I / O expansion chips offer comprehensive functionality, they suffer from the following drawbacks: First, the cost per chip is high, making them uneconomical for cost-sensitive applications. Second, the chips rely on I²C or SPI buses for communication; a bus failure can paralyze the entire I / O subsystem, a single point of failure that is unacceptable in high-reliability applications such as locomotives. Furthermore, the chips typically have low voltage withstand capabilities (5V or 3.3V), requiring complex external isolation circuitry for direct connection to the 110V / 24V environment of locomotives, resulting in high costs. Third, the need to run corresponding bus protocol stacks increases firmware development complexity.

[0004] Another common configurable I / O solution is to use jumpers or DIP switches. This involves setting up several pin headers on the circuit board, and manually selecting the operating mode of the I / O port by inserting and removing jumpers or DIP switches. However, jumper caps or DIP switches have significant limitations: First, they require manual intervention and must be operated after the device is powered off, making online switching impossible; second, in vibrating environments such as those experienced by locomotives, jumpers are prone to loosening and poor contact; and third, they occupy a large PCB area, and configuration is cumbersome and error-prone when dealing with multiple channels.

[0005] Another approach is to use discrete MOSFETs to build the transmission gate structure, such as the CD4066 bidirectional analog switch. On / off switching is achieved by controlling the gate voltage, and pull-up / pull-down resistors are used to create configurable I / O. The disadvantages of the discrete MOSFET transmission gate approach are as follows: First, each channel requires 4 to 6 MOSFETs, resulting in a large number of components and a large PCB area footprint; second, the on-resistance varies with the input voltage, affecting signal consistency; third, the large parasitic capacitance limits the switching speed; and fourth, the cost remains relatively high.

[0006] In summary, existing technical solutions have significant shortcomings in terms of versatility, reliability, self-testing capabilities, and cost-effectiveness. First, whether it's dedicated I / O expansion chips, jumper caps, DIP switches, or discrete MOSFET transmission gate structures, they all lack online readback detection capabilities for faults such as open circuits, short circuits, or driver failures in the backplane signal interface lines. This lack of detection capability makes it difficult to monitor the interface status in real time during system operation, thus reducing overall reliability. Second, existing solutions have poor versatility, often only optimized for specific application scenarios, making it difficult to adapt to diverse industrial control needs. Furthermore, these solutions also face significant challenges in balancing cost and complexity; either the cost is too high or the design is too complex, making it difficult to achieve an ideal compromise between performance and cost. Summary of the Invention

[0007] This invention provides a single-port bidirectional level conversion and status readback circuit to overcome the above-mentioned technical problems.

[0008] To achieve the above objectives, the technical solution of the present invention is as follows: A single-port bidirectional level conversion and status readback circuit includes a bidirectional port, a driver stage, an input shaping stage, a level conversion and voltage divider network, and a protection circuit. The protection circuit is connected to the drive stage and the input shaping stage; The bidirectional port is used to connect to the output of a preset external device and realize bidirectional signal transmission, that is, to realize signal output driving and status readback; The driver stage and the level conversion and voltage divider network are respectively connected to the output of the bidirectional port; The driver stage is used to drive the signals output by external devices; The level conversion and voltage divider network is used to perform level conversion and voltage divider processing on signals input from external devices, and output signals that are adapted to the operating voltage range of the internal circuit. The input terminal of the input shaping stage and the level conversion are connected to the output terminal of the voltage divider network; The input shaping stage is used to shape the output signal of the level conversion and voltage divider network to output a readback signal, and transmits the output readback signal to the input terminal of an external device through a bidirectional port.

[0009] Furthermore, the driving stage includes an NPN transistor Q1; The collector of the NPN transistor Q1 is connected to the FIO_IN terminal of the bidirectional port FIO; the base of the NPN transistor Q1 is connected to one end of the fourth resistor R4 and one end of the fifth resistor R5; the emitter of the NPN transistor Q1 is grounded to the other end of the fourth resistor R4; and the other end of the fifth resistor R5 is connected to the FIO_OUT terminal of the bidirectional port FIO.

[0010] Furthermore, the level conversion and voltage divider network includes a first diode VD1, a first resistor R1, a second resistor R2, and a third resistor R3 connected together; One end of the first diode VD1 is connected to the +12V terminal of an external DC power supply; the other end of the first diode VD1 is connected to one end of the first resistor R1; the other end of the first resistor R1 is connected to connection node N2; connection node N2 is connected to the bidirectional port FIO; one end of the second resistor R2 is connected to connection node N2; the other end of the second resistor R2 is connected to a preset connection node N1; one end of the third resistor R3 is connected to connection node N1; the other end of the third resistor R3 is grounded.

[0011] Furthermore, the input shaping stage includes a Schmitt-triggered inverter U1B; One end of the Schmitt trigger inverter U1B is connected to one end of capacitor C1 and connection node N1; the other end of capacitor C1 is grounded; the other end of the Schmitt trigger inverter U1B is connected to the FIO_IN terminal of the bidirectional port FIO.

[0012] Furthermore, the protection circuit includes a second diode VD2 and a dual diode VT1; and the dual diode VT1 is composed of two pre-set diodes connected in series. The second diode VD2 is located on the connection line between the FIO_IN terminal of the bidirectional port FIO and the collector of the NPN transistor Q1; one end of the dual diode VT1 is connected to the 3V3 terminal of the external power supply; the other end of the dual diode VT1 is grounded; a connection point is provided between the two diodes in the dual diode VT1 connected in series, and the connection point is connected to one end of the capacitor C1.

[0013] Furthermore, the NPN transistor Q1 is a BC846; the first diode VD1 and the second diode VD2 are both 1N4148; the Schmitt trigger inverter U1B is a 74LVCI4AD; and the dual diode VT1 is a BAV199.

[0014] Beneficial effects: This invention provides a single-port bidirectional level conversion and status readback circuit. This circuit uses a bidirectional port as a bridge between external devices and internal circuitry, handling signal input and output. The driver stage utilizes an NPN transistor to effectively drive the signal. The input shaping stage uses a Schmitt trigger inverter to shape the input signal. A level shifting and voltage divider network uses resistors and diodes for signal adaptation and detection. The protection circuit uses diodes and dual diodes to ensure circuit safety under abnormal conditions. This circuit achieves level shifting and driving functions through the level shifting and voltage divider network, protection circuit, and driver stage. It also utilizes the same signal line for output status readback detection, thereby improving system reliability and maintainability. Furthermore, this circuit has strong environmental adaptability and is suitable for complex working environments with high vibration and strong interference, such as those encountered in rail transportation. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a circuit diagram of a single-port bidirectional level conversion and status readback circuit according to the present invention. Figure 2 This is a schematic diagram of the single-port output and status readback process in this embodiment; Figure 3 This is a schematic diagram of the input reading process for a single port in this embodiment. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] This embodiment provides a single-port bidirectional level conversion and status readback circuit, such as... Figure 1 As shown, it includes a bidirectional port, a driver stage, an input shaping stage, a level conversion and voltage divider network, and a protection circuit. The bidirectional port is used to connect to the output of a preset external device and realize bidirectional signal transmission, that is, to realize signal output driving and status readback; In this embodiment, the bidirectional port (FIO) is used to connect external devices, such as sensors or actuators, and to enable bidirectional signal transmission. During circuit signal transmission, the FIO port needs to provide driving capability and also be able to receive input signals from external devices.

[0019] The driver stage and the level conversion and voltage divider network are respectively connected to the output of the bidirectional port; the driver stage is used to drive the signals output by external devices. Specifically, the driver stage includes an NPN transistor Q1; the collector of the NPN transistor Q1 is connected to the FIO_IN terminal of the bidirectional port FIO; the base of the NPN transistor Q1 is connected to one end of the fourth resistor R4 and one end of the fifth resistor R5; the emitter of the NPN transistor Q1 is grounded to the other end of the fourth resistor R4; and the other end of the fifth resistor R5 is connected to the FIO_OUT terminal of the bidirectional port FIO. In this embodiment, the driver stage is composed of an NPN transistor (Q1); the collector of Q1 is connected to the bidirectional port FIO, and thus connected to the bidirectional port (FIO); the emitter is grounded, and the base receives the control signal (FIO_OUT) from the controller. When the controller sets FIO_OUT high, Q1 is turned on, and the low impedance path between its collector and emitter pulls the FIO port low to ground (GND), thus presenting a low-level active state to the outside world. This design not only realizes the signal driving function, but also provides the necessary conditions for subsequent state readback detection.

[0020] The level conversion and voltage divider network is used to perform level conversion and voltage divider processing on signals input from external devices, and output signals that are adapted to the operating voltage range of the internal circuit. Specifically, the level conversion and voltage divider network includes a first diode VD1, a first resistor R1, a second resistor R2, and a third resistor R3 connected together; one end of the first diode VD1 is connected to the +12V terminal of an external DC power supply; the other end of the first diode VD1 is connected to one end of the first resistor R1; the other end of the first resistor R1 is connected to connection node N2; one end of the second resistor R2 is connected to connection node N2; connection node N2 is connected to the bidirectional port FIO; the other end of the second resistor R2 is connected to connection node N1; one end of the third resistor R3 is connected to a preset connection node N1; and the other end of the third resistor R3 is grounded.

[0021] In this embodiment, the level conversion and voltage divider network adapts the signal input from the external device to the operating voltage range of the internal circuit and provides the necessary conditions for signal detection. The first diode VD1 and the first resistor R1 form a pull-up branch, in which the +12V power supply is connected to node N2 through the first diode VD1 and the first resistor R1, providing the circuit with a high-level output capability. The voltage divider branch consists of the second resistor R2 and the third resistor R3, connected to nodes N2 and N1 respectively. When the external device inputs a high level, the node voltage of node N2 is close to +12V. After voltage division by the second resistor R2 and the third resistor R3, the node voltage of node N1 is adjusted to a logic level range suitable for U1B operation. This design not only achieves level conversion but also provides a reference voltage for signal detection through the voltage division ratio. Furthermore, the introduction of the first diode VD1 effectively isolates the internal power supply from external high-voltage interference, improving the circuit's anti-interference capability.

[0022] The input terminal of the input shaping stage is connected to the output terminal of the level conversion and voltage divider network; the input shaping stage is used to shape the output signal of the level conversion and voltage divider network to output a readback signal, and transmit the output readback signal to the input terminal of an external device through a bidirectional port; Specifically, the input shaping stage includes a Schmitt trigger inverter U1B; one end of the Schmitt trigger inverter U1B is connected to one end of capacitor C1 and connection node N1; the other end of capacitor C1 is grounded; and the other end of the Schmitt trigger inverter U1B is connected to the FIO_IN terminal of the bidirectional port FIO. In this embodiment, the input shaping stage is composed of a Schmitt trigger inverter U1B, which shapes the input signal and converts it into a readback signal. Specifically, the input terminal of the Schmitt trigger inverter U1B is connected to connection node N1, and the output terminal is connected to the input terminal of the controller. When an external device inputs a signal through the bidirectional port FIO, the signal is transmitted to connection node N1 after passing through a level conversion and voltage divider network. Due to the characteristics of the Schmitt trigger, the Schmitt trigger inverter U1B can accurately shape the input signal, thereby eliminating noise and jitter in the signal. In this embodiment, the shaped signal is output to the FIO_IN terminal in digital logic form to form the FIO_IN readback channel, providing reliable readback input information for the controller MCU. For example, when the MCU controls the NPN transistor Q1 to be turned on, if the FIO_IN terminal is detected to be low (corresponding to the FIO port not being pulled low), it is determined that the driver stage has failed or that there is a short circuit to the power supply; conversely, when the MCU controls the NPN transistor Q1 to be turned off, if the FIO_IN terminal is detected to be high, it is determined that there is a short circuit to ground in the external line.

[0023] The protection circuit is connected to the drive stage and the input shaping stage, and is used to protect the components of the circuit from damage under abnormal conditions. Specifically, the protection circuit includes a second diode VD2 and a dual diode VT1; the dual diode VT1 is composed of two pre-set diodes connected in series; the second diode VD2 is located on the connection line between the FIO_IN terminal of the bidirectional port FIO and the collector of the NPN transistor Q1; one end of the dual diode VT1 is connected to the 3V3 terminal of the external power supply; the other end of the dual diode VT1 is grounded; a connection point is provided between the two diodes connected in series in the dual diode VT1, and the connection point is connected to one end of the capacitor C1. In this embodiment, the protection circuit, composed of the second diode VD2 and the dual diode VT1, mainly functions to protect the critical components of the circuit from damage under abnormal conditions. Specifically, the second diode VD2 is connected across the bidirectional port FIO and the NPN transistor Q1 to prevent reverse current from damaging the circuit. When an external device inputs a negative voltage, the second diode VD2 conducts, guiding the reverse current to ground, thereby protecting the NPN transistor Q1 and other components. The dual diodes VT1 clamp the connection nodes N1 and N2 to the 3.3V power supply domain, preventing damage to the Schmitt trigger inverter U1B due to excessive voltage. This design not only improves the reliability of the circuit but also enhances its adaptability to complex operating environments.

[0024] In a specific embodiment, the NPN transistor Q1 is a BC846; the first diode VD1 and the second diode VD2 are both 1N4148; the Schmitt trigger inverter U1B is a 74LVCI4AD; and the dual diode VT1 is a BAV199. This embodiment also includes the following replacement schemes: (1) Device replacement: The NPN transistor Q1 can be replaced with an N-MOSFET (such as a 2N7002) to reduce the drive current requirement and improve the switching speed; (2) Logic replacement: The Schmitt trigger inverter U1B can be replaced with a non-inverting buffer, and the corresponding software logic can be inverted; (3) Power supply replacement: The +12V pull-up power supply can be adjusted to +24V or +110V according to the locomotive system voltage (the resistance values ​​of R1 / R2 need to be adjusted synchronously to match the voltage division ratio).

[0025] The circuit described in this embodiment consists of multiple functional modules, including a bidirectional port (FIO), a driver stage, an input shaping stage, a level conversion and voltage divider network, and a protection circuit. These modules work together to achieve functions such as level conversion, signal transmission, and status readback detection. Specifically, the bidirectional port acts as a bridge between external devices and internal circuits, responsible for signal input and output; the driver stage uses an NPN transistor Q1 to effectively drive the signal; the input shaping stage uses a Schmitt trigger inverter U1B to shape the input signal; the level conversion and voltage divider network uses resistors and diodes to adapt and detect the signal; and the protection circuit uses components such as a second diode VD2 and dual diodes VT1 to ensure the circuit's safety under abnormal conditions. Compared with existing technologies, the circuit described in this embodiment aims to provide an interface circuit that combines bidirectional level conversion, online status readback diagnostics, and configurable input / output functions to solve the problems of existing solutions being unable to monitor interface faults online, having poor versatility, and high cost. Specifically, this circuit needs to implement level conversion and driving functions, while using the same signal line to complete the output status readback detection, thereby improving the system's reliability and maintainability. Furthermore, the circuit should possess strong environmental adaptability, enabling it to operate in complex environments with high vibration and strong interference, such as those encountered in rail transportation. By achieving these design goals, an efficient, economical, and easy-to-maintain hardware solution is provided for industrial control systems, overcoming the shortcomings of existing technologies in terms of versatility, reliability, and self-testing capabilities.

[0026] This embodiment also includes the following application examples: Example 1: Output mode (with readback detection) like Figure 2 As shown, this embodiment utilizes the FIO_IN readback channel to achieve online diagnostics of the output stage FIO and external circuits. Specifically, when the MCU controls Q1 to be turned on, if FIO_IN is detected to be low (corresponding to the FIO port not being pulled low), it is determined that the driver stage has failed or there is a short circuit to the power supply; conversely, when the MCU controls Q1 to be turned off, if FIO_IN is detected to be high, it is determined that the external circuit is short-circuited to ground. This closed-loop detection mechanism, which requires no additional hardware cost, significantly improves the fault coverage of the TCU system. The specific process includes the following steps: S1: After the system is powered on, the MCU performs power-on initialization or receives a diagnostic command; S2: Perform a low-level test on the FIO output. The MCU controls FIO_OUT to output a high level, driving Q1 to turn on. At this time, theoretically, the FIO port should be pulled low to 0V (logic 0). S3: Read feedback status; the MCU reads the level status of FIO_IN. If FIO_IN is high (logic 1), it means the voltage at point N1 is pulled low and the circuit is working normally; if FIO_IN is low (logic 0), it means point N1 is high, Q1 is not conducting, or FIO is forcibly pulled high by an external high voltage. This is determined as "Q1 open circuit fault" or "external short circuit to power supply". S4: Perform a high-level test on the FIO output. The MCU controls FIO_OUT to output a high level, causing Q1 to be cut off. At this time, theoretically, the FIO port should be pulled up to 12V (logic 1) by R1. S5: Read feedback status; the MCU reads the level status of FIO_IN. If FIO_IN is low (logic 0), it means that the voltage at point N1 is pulled up and the circuit is working normally; if FIO_IN is high (logic 1), it means that point N1 is low, which is determined as "external short circuit to ground" or "backplane line open circuit". S6: Select fault reporting based on whether a fault exists; S7: Start normal output control.

[0027] Example 2: Input Mode (High Impedance State) like Figure 3 As shown, in input mode, the controller sets FIO_OUT low, turning off Q1. At this time, the circuit pulls the FIO port up to +12V through R1, placing it in a high-impedance state. When the external device outputs a low level, the FIO port voltage is pulled low to ground, and the N1 node voltage decreases accordingly, resulting in a low-level input to U1B, which in turn causes FIO_IN to output a high level. Conversely, when the external device outputs a high level, after passing through a voltage divider network, the N1 node voltage is adjusted to a logic high-level range suitable for U1B operation, thus causing FIO_IN to output a low level. If the external device is floating, the FIO port remains in a high-impedance state, and the N1 node voltage is determined by the voltage divider network, which also ensures a stable logic level for FIO_IN output. This design allows the circuit to flexibly acquire signals from external devices in input mode while avoiding bus contention issues caused by signal conflicts.

[0028] The circuit described in this embodiment utilizes the collector of transistor (Q1) as a bidirectional port and employs the same resistor divider network (R2, R3) for both output state feedback sampling and input signal level conversion. Simultaneously with output drive (Q1 on), an internal feedback node (N1) is connected to the logic input (U1B), and the effectiveness of the output drive is determined by detecting the logic input's level. A hybrid pull-up structure is used: a pull-up branch composed of a diode (VD1) and a resistor (R1) connected in series provides both high-level output capability and isolation between the internal power supply and external high-voltage interference. The beneficial effects of the circuit described in this embodiment are as follows: (1) Strong inter-board / external versatility: This circuit can be used as a communication interface between the board and the backplane, as well as an external sensor interface. The unified hardware design reduces the types of boards and the cost of spare parts.

[0029] (2) High reliability and fault tolerance: Open collector output avoids the risk of "bus contention" (i.e., when multiple boards output simultaneously on the backplane, it will not cause short circuit and burnout like push-pull output, but will only form "wired-AND" logic). R1 ​​acts as a pull-up resistor and has a current limiting function in output mode. Even if the FIO is accidentally short-circuited during backplane insertion and removal, the current is limited to a safe range by R1, which greatly improves the safety of hot-swapping and will not damage any components.

[0030] (3) Status self-test (readback): The MCU can monitor whether the backplane lines are open or short-circuited in real time through FIO_IN. For example, if FIO_IN still reads a low level when the output is high (Q1 is off), it indicates that there may be a short circuit to ground fault in the backplane lines.

[0031] (4) Extremely high cost performance: It uses only one transistor, one inverter and a few resistors and capacitors to achieve complex level conversion and bidirectional function.

[0032] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A single port bidirectional level shifting and state readback circuit, characterized by, Includes bidirectional ports, driver stage, input shaping stage, level conversion and voltage divider network, and protection circuitry; The protection circuit is connected to the drive stage and the input shaping stage; The bidirectional port is used to connect to the output of a preset external device and realize bidirectional signal transmission, that is, to realize signal output driving and status readback; The driver stage and the level conversion and voltage divider network are respectively connected to the output of the bidirectional port; The driver stage is used to drive the signals output by external devices; The level conversion and voltage divider network is used to perform level conversion and voltage divider processing on signals input from external devices, and output signals that are adapted to the operating voltage range of the internal circuit. The input terminal of the input shaping stage and the level conversion are connected to the output terminal of the voltage divider network; The input shaping stage is used to shape the output signal of the level conversion and voltage divider network to output a readback signal, and transmits the output readback signal to the input terminal of an external device through a bidirectional port.

2. A single port bi-directional level shifting and state readback circuit according to claim 1, wherein, The driving stage includes an NPN transistor Q1; The collector of the NPN transistor Q1 is connected to the FIO_IN terminal of the bidirectional port FIO; the base of the NPN transistor Q1 is connected to one end of the fourth resistor R4 and one end of the fifth resistor R5; the emitter of the NPN transistor Q1 is grounded to the other end of the fourth resistor R4; and the other end of the fifth resistor R5 is connected to the FIO_OUT terminal of the bidirectional port FIO.

3. A single port bi-directional level shifting and state readback circuit as claimed in claim 2, wherein, The level conversion and voltage divider network includes a first diode VD1, a first resistor R1, a second resistor R2, and a third resistor R3 connected together; One end of the first diode VD1 is connected to the +12V terminal of an external DC power supply; the other end of the first diode VD1 is connected to one end of the first resistor R1; the other end of the first resistor R1 is connected to connection node N2; connection node N2 is connected to the bidirectional port FIO; one end of the second resistor R2 is connected to connection node N2; the other end of the second resistor R2 is connected to connection node N1; one end of the third resistor R3 is connected to connection node N1; the other end of the third resistor R3 is grounded.

4. A single port bi-directional level shifting and state readback circuit as claimed in claim 3, wherein, The input shaping stage includes a Schmitt trigger inverter U1B; One end of the Schmitt trigger inverter U1B is connected to one end of capacitor C1 and connection node N1; the other end of capacitor C1 is grounded; the other end of the Schmitt trigger inverter U1B is connected to the FIO_IN terminal of the bidirectional port FIO.

5. A single port bi-directional level shifting and state readback circuit as claimed in claim 4, wherein, The protection circuit includes a second diode VD2 and a dual diode VT1; and the dual diode VT1 is composed of two pre-set diodes connected in series. The second diode VD2 is located on the connection line between the FIO_IN terminal of the bidirectional port FIO and the collector of the NPN transistor Q1; one end of the dual diode VT1 is connected to the 3V3 terminal of the external power supply; the other end of the dual diode VT1 is grounded; a connection point is provided between the two diodes in the dual diode VT1 connected in series, and the connection point is connected to one end of the capacitor C1.

6. A single port bi-directional level shifting and state readback circuit as claimed in claim 5, wherein, The NPN transistor Q1 is a BC846; the first diode VD1 and the second diode VD2 are both 1N4148; the Schmitt trigger inverter U1B is a 74LVCI4AD; and the dual diode VT1 is a BAV199.