MCU GPIO port multiplexing circuit

By using the MCU GPIO port multiplexing circuit and the reasonable configuration of DIP switches and voltage divider circuits, the problem of insufficient MCU IO ports is solved, and the multiplexing of stable signal reading and indicator light control is realized, reducing hardware complexity and cost, and improving signal stability and reliability.

CN223870978UActive Publication Date: 2026-02-03SHENZHEN GURUIBAO NEW ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202520689118.3
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2026-02-03
Estimated Expiration
2035-04-14

AI Technical Summary

Technical Problem

The insufficient number of MCU I/O ports makes it impossible to meet the functional requirements of complex systems. Existing multiplexing solutions suffer from signal interference, unstable levels, and high design complexity.

Method used

The MCU GPIO port multiplexing circuit is adopted. Through the design of DIP switches, voltage divider circuits and filter capacitors, the multiplexing of signal stable reading and indicator light control is realized. Voltage divider resistors and current limiting resistors are used to ensure accurate level, and filter capacitors suppress noise interference.

Benefits of technology

Achieve multi-functional support with limited hardware resources, reduce system complexity and cost, ensure signal stability and reliability, and avoid malfunctions and unstable levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN223870978U_ABST
    Figure CN223870978U_ABST
Patent Text Reader

Abstract

The utility model discloses an MCU GPIO port multiplexing circuit, comprising an MCU used for providing at least one IO interface to realize signal input and output; and the pull-out switch is electrically connected with the IO interface of the MCU, is used for generating high-level or low-level signals, comprises a pull-up resistor and a pull-down resistor, is electrically connected with the pull-out switch, and is used for realizing signal level adjustment through voltage division. According to the improved MCU GPIO port multiplexing circuit provided by the utility model, through reasonable circuit design, the function conflict between signal reading of a dial switch and indication lamp control is solved, the stability and the cost of signals are optimized, address signals can be read through the dial switch when a system is powered on, and the reliability of the system is improved. And after the reading is completed, the IO port is multiplexed as a control signal output end of the indicator lamp, so that the efficient utilization of the IO port is realized under the condition that the hardware complexity is not increased.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The utility model relates to a kind of circuits, specifically to a kind of MCU GPIO port multiplexing circuit. BACKGROUND

[0002] With the wide application of microcontroller (MCU) in industrial control, consumer electronics and Internet of Things devices, its functional requirements and complexity are constantly improving. During the design and development process, it is often necessary to provide additional input-output (IO) ports for the MCU to meet the control and communication needs of complex systems. However, the number of physical IO ports of the MCU is usually limited, especially in low-cost products. This limitation may result in the inability to meet certain new functional requirements, thereby causing difficulties in system design.

[0003] To solve the problem of insufficient IO ports, the following methods are usually taken in the prior art:

[0004] Selecting a MCU with more IO ports to meet the requirements. However, this approach may result in the redesign of hardware and software systems, increasing costs and prolonging development cycles.

[0005] Increasing IO expansion chips or modules to expand the number of IOs. Although this method can alleviate the problem of IO shortage to some extent, it significantly increases the complexity, cost and power consumption of the circuit.

[0006] Using software or hardware means to use one IO port for multiple functions at the same time, thereby achieving more functions with limited port numbers. However, existing multiplexing schemes often have the following problems in specific applications:

[0007] 1. When multiple functions share the same IO port, signal interference or control timing problems may cause malfunctions;

[0008] 2. In some circuit designs, the parameters of the voltage divider circuit are not reasonable, resulting in unstable signal levels;

[0009] 3. Existing solutions require additional hardware components or complex circuit designs, increasing design and debugging difficulty. SUMMARY

[0010] To solve the above problems, the utility model provides a kind of MCU GPIO port multiplexing circuit, adopts a simple circuit design to concentrate pull code identification and indicator light control together, reduces the occupation of IO of MCU, reduces cost, also does not affect the use of normal function.

[0011] The utility model is implemented by the following technical solutions: a kind of MCU GPIO port multiplexing circuit, comprising:

[0012] MCU, configured to provide at least one IO interface to realize signal input and output;

[0013] Code pulling switch, electrically connected with the IO interface of the MCU, configured to generate high level or low level signal;

[0014] Voltage division circuit, comprising pull-up resistor and pull-down resistor, electrically connected with the code pulling switch, configured to realize signal level adjustment through voltage division;

[0015] Indicator light circuit, comprising at least one light emitting diode and current limiting resistor, electrically connected with the IO interface, configured to control the on-off of the indicator light through the output of the IO interface;

[0016] Filtering capacitor, connected in parallel between the IO interface and the ground, configured to suppress signal interference;

[0017] Wherein, the IO interface is used to read the state of the code pulling switch when the system is initialized, and is reused as the control signal output end of the indicator light circuit after completing the reading.

[0018] As a preferred technical solution, the resistance values of the pull-up resistor and the pull-down resistor in the voltage division circuit are selected according to the voltage division principle, so that the IO interface outputs high level when the code pulling switch is open, and outputs low level when the code pulling switch is closed.

[0019] As a preferred technical solution, the resistance value of the current limiting resistor and the turn-on voltage of the light emitting diode are set to ensure that the light emitting diode remains in the off state when the code pulling switch is closed.

[0020] As a preferred technical solution, the capacity of the filtering capacitor is 0.1 μF, which is used to suppress high frequency interference in the circuit.

[0021] As a preferred technical solution, the working voltage of the MCU is consistent with the power supply voltage of the circuit, and the power supply voltage is 3.3 V.

[0022] As a preferred technical solution, the indicator light circuit comprises two light emitting diodes, which are connected to two IO interfaces of the MCU in series with corresponding current limiting resistors, to realize multi-state indication.

[0023] The beneficial effects of the present application are as follows: Firstly, the reasonable configuration of the code pulling switch and the voltage division circuit realizes stable reading of address information and accurate judgment of signal level, and avoids false operation caused by unstable level or improper parameter selection;

[0024] Secondly, the IO port can be reused as the control signal output end of the indicator light after completing the reading of the state of the code pulling switch, so that multiple functions can be supported under limited hardware resources, and the hardware complexity and cost of the system are significantly reduced.

[0025] III. The added filter capacitor in the circuit effectively suppresses high-frequency noise interference, improves the stability of signal reading and output, and further ensures the reliability of the circuit; in addition, the design of the utility model fully considers the consistency requirement of MCU and circuit power supply voltage, and through the optimization of the resistance value of the voltage dividing resistor and the configuration of the current limiting resistor, the normal on-off of the indicator light under different working conditions is ensured, and the problems of misoperation or function conflict are avoided. BRIEF DESCRIPTION OF DRAWINGS

[0026] In order to more clearly illustrate the technical scheme in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiment or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0027] Figure 1 The circuit schematic diagram of the utility model. DETAILED DESCRIPTION

[0028] All features disclosed in this specification, or the steps of any method or process disclosed, can be combined in any combination, except where it is explicitly stated that a combination is not possible.

[0029] Any feature disclosed in this specification, unless stated otherwise, can be replaced by any other feature serving the same, or a similar, purpose.

[0030] As Figure 1 As shown in the utility model discloses a kind of MCU GPIO port multiplexing circuit, its circuit design aims at solving the problem of insufficient number of MCU IO ports, and simultaneously realizes the multiplexing function of reading and indicating lamp control of code pulling switch state by reasonable hardware configuration.In the circuit, MCU is connected with code pulling switch, voltage dividing circuit and indicator light circuit by at least one IO interface thereof, and noise interference is suppressed by filter capacitor, so that the stable input and output of signal are realized.

[0031] Specifically, the IO interface provided by the MCU realizes two functions in the circuit at the same time: reading the state of the pull code switch to determine the module address when the system is powered on, and multiplexing as the control signal output end of the indicator light after reading is completed. The pull code switch is electrically connected with the IO interface of the MCU, and is used to generate a high level or low level signal in the on-off state, so as to realize the identification of address information. The pull code switch is connected with the IO interface through a voltage dividing circuit, and the voltage dividing circuit is composed of a pull-up resistor and a pull-down resistor. The resistance values are reasonably selected according to the voltage dividing principle, so that the IO interface can output a stable high level signal when the pull code switch is disconnected; and when the pull code switch is closed, the IO interface outputs a stable low level signal through the voltage dividing effect of the pull-up resistor and the pull-down resistor. Specifically, when the pull code switch is disconnected, the output of the IO interface is the supply voltage 3.3V; and when the pull code switch is closed, the voltage dividing ratio of the voltage dividing circuit makes the IO interface output a low level signal of about 0.1V.

[0032] In the case that the pull code switch is disconnected, the MCU can directly control the on-off state of the light-emitting diode in the indicator light circuit through the IO interface. The indicator light circuit includes at least one light-emitting diode and a current limiting resistor connected in series with the light-emitting diode, and these components are connected between the IO interface and the ground, for receiving the signal output by the MCU and driving the light-emitting diode to emit light or be extinguished through current. When the pull code switch is closed, the low level signal output by the IO interface will not trigger the light-emitting diode to light up, because the turn-on voltage of the light-emitting diode is greater than the voltage after voltage division, thereby ensuring that the indicator light remains extinguished in this state and avoiding the occurrence of false operation.

[0033] The filter capacitor is an important part of the circuit design, and is connected in parallel between each IO interface and the ground, and its function is to suppress high-frequency noise interference in the circuit, thereby ensuring the stability of the pull code switch state reading and the indicator light control signal output. The capacity of the capacitor is selected to be 0.1μF, which is a verified value that can effectively reduce the influence of high-frequency noise on the circuit signal, and at the same time will not affect the signal response speed due to the too large capacity of the capacitor.

[0034] In addition, in order to ensure the reliability and consistency of the circuit, the working voltage of the MCU is required to be consistent with the power supply voltage of the overall circuit in the circuit design. In the present application, the power supply voltage is 3.3V, which matches the working voltage of the MCU, thereby avoiding signal distortion or circuit abnormalities caused by voltage mismatch.

[0035] In a further optimized design, the indicator light circuit comprises two light emitting diodes, each of which is connected to two IO interfaces of the MCU in series with a current limiting resistor, so as to realize the multi-state indication function. When the pull code switch is open, the two IO interfaces can independently control the on-off of the two light emitting diodes; when the pull code switch is closed, the output voltages of the two IO interfaces are affected by the voltage dividing resistor, but since the voltage after voltage division is lower than the turn-on voltage of the light emitting diode, the two light emitting diodes remain off, thereby ensuring the accuracy of the pull code switch state reading function.

[0036] As shown in Figure 1 , the MCU is powered by 3.3V, the IO port output signal is 0 or 3.3V high and low level, J7 is the pull code switch, R1 and R2 are the current limiting resistors of the LED lamp, R3 and R4 are the pull-up resistors, R5 and R6 are the pull-down resistors. Addr0 and Addr1 are the IO interfaces of the MCU. C1 and C2 are filter capacitors.

[0037] The utility model discloses a power module, when the application multiple modules in system need to use the pull code switch to identify the module, and the system mainboard will read address information once when power on, and will not read again later, until power off and power on again. Therefore, after reading the signal, the IO port can be used for signal output.

[0038] When the J7 pull code switch is open, Addr0 and Addr1 are both 3.3V high level, and when the J7 pull code switch is closed, Addr0 and Addr1 are both 3.3V*R5 / (R5+R4) = 0.1V (or 3.3V*R6 / (R6+R3) = 0.1V) low level.

[0039] When Addr0 and Addr1 are signal output ports, when the pull code switch is open, Addr0 and Addr1 can independently control the on-off of D1 and D2. When the pull code switch is closed, R5 or R6 only slightly affects the output high level amplitude of Addr0 or Addr1, at this time, the output of Addr0 or Addr1 is not 3.3V, but about 3.1V, since the turn-on voltage of D1 or D2 must be above 2V, now there is only 0.2V voltage difference between D1 and R1 or D2 and R2, therefore, it does not affect D1 or D2 to remain off.

[0040] Through the above circuit design, under the condition of limited hardware resources, the IO interface of the MCU is used to realize the multiplexing function of the pull code switch state reading and the indicator light control, which significantly reduces the hardware cost and circuit complexity, while maintaining the stability and reliability of the signal. The whole circuit structure is simple and reasonable in design, and can be widely applied in embedded systems with high requirements for hardware resources.

[0041] The above merely describes a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any change or replacement not through creative labor should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be limited by the protection scope defined in the claims.

Claims

1. A multiplexing circuit for MCU GPIO ports, characterized in that, include: MCU is used to provide at least one I / O interface to implement signal input and output; A DIP switch, electrically connected to the IO interface of the MCU, is used to generate a high-level or low-level signal; The voltage divider circuit, including pull-up resistors and pull-down resistors, is electrically connected to the DIP switch and is used to adjust the signal level through voltage division. An indicator light circuit, including at least one light-emitting diode and a current-limiting resistor, is electrically connected to the IO interface and is used to control the on / off state of the indicator light through the output of the IO interface; A filter capacitor is connected in parallel between the IO interface and ground to suppress signal interference; The IO interface is used to read the state of the DIP switch during system initialization, and after reading is completed, it is reused as the control signal output terminal of the indicator light circuit.

2. The MCU GPIO port multiplexing circuit according to claim 1, characterized in that: The values ​​of the pull-up and pull-down resistors in the voltage divider circuit are selected according to the voltage divider principle, so that the IO interface outputs a high level when the DIP switch is open and a low level when the DIP switch is closed.

3. The MCU GPIO port multiplexing circuit according to claim 1, characterized in that: The resistance value of the current-limiting resistor and the turn-on voltage setting of the LED are configured to ensure that the LED remains off when the DIP switch is closed.

4. The MCU GPIO port multiplexing circuit according to claim 1, characterized in that: The filter capacitor has a capacitance of 0.1μF and is used to suppress high-frequency interference in the circuit.

5. The MCU GPIO port multiplexing circuit according to claim 1, characterized in that: The operating voltage of the MCU is the same as the power supply voltage of the circuit, which is 3.3V.

6. The MCU GPIO port multiplexing circuit according to claim 1, characterized in that: The indicator circuit includes two light-emitting diodes, which are connected in series with corresponding current-limiting resistors and then connected to two I / O interfaces of the MCU to realize multi-state indication.