Pin multiplexing circuit and electronic equipment
By designing a pin multiplexing circuit for MCU, using peripheral interfaces, conversion modules, isolation modules and control modules, the multi-functional compatibility of MCU pins is achieved, which solves the problem of insufficient MCU pins and reduces the cost of circuit design. cost.
Patent Information
- Application Number
- CN202323605543.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2033-12-27
AI Technical Summary
In electronic products, when MCU pins are not enough, more MCUs need to be used to distribute various peripheral signals, resulting in increased project costs.
Design a pin multiplexing circuit, including peripheral interface, conversion module, processor, isolation module and control module. By converting the signal of the external device into a serial port signal, and controlling the usage status of the pin according to the device type, different functions can be realized. Functional peripheral compatibility.
It realizes the multiplexing of processor pins, avoids the need to use more MCUs, and reduces circuit design costs.
Smart Images

Figure CN221884303U_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power electronics technology, and in particular to pin multiplexing circuits and electronic devices. Background Art
[0002] With the development of power electronics technology, there are more and more types of electronic products, and more and more functions can be realized. However, the more functions an electronic product integrates, the more peripheral interfaces the MCU (Micro controller Unit) needs to have.
[0003] Normally, if the signals of two different peripherals are to be distributed to the MCU, they need to be distributed to different pins. When the MCU pins are not enough, it is often necessary to select an MCU with more pins, but this will increase the project cost. Utility Model Content
[0004] The main purpose of the present application is to provide a pin multiplexing circuit and an electronic device, aiming to realize the multiplexing of processor pins.
[0005] To achieve the above object, the present application provides a pin multiplexing circuit, the pin multiplexing circuit comprising:
[0006] A peripheral interface, a first end of which is grounded, and the peripheral interface is used to access an external device;
[0007] A conversion module, one end of which is connected to the second end of the peripheral interface, and the conversion module is used to convert a signal output by the external device into a serial port signal;
[0008] A processor, wherein a first pin of the processor is connected to the other end of the conversion module, and the processor is used to execute an action according to the serial port signal;
[0009] An isolation module, one end of which is connected to the other end of the conversion module and the first pin of the processor, and the other end of the isolation module is connected to the second pin of the processor, and the isolation module is used to open and close the connection between the first pin and the second pin;
[0010] A control module, one end of the control module is connected to the third end of the peripheral interface, and the other end of the control module is connected to the processor and the controlled end of the isolation module. The control module is used to output a level signal according to the type of the external device, control the second pin to output a signal or receive a signal, and the control module is also used to control the isolation module to be turned on or off.
[0011] Optionally, the control module includes:
[0012] a first resistor, one end of which is connected to a first voltage, and the other end of which serves as the other end of the control module, connected to the processor and the controlled end of the isolation module;
[0013] a first diode, wherein an anode of the first diode is connected to the other end of the first resistor, and a cathode of the first diode serves as one end of the control module and is connected to a third end of the peripheral interface;
[0014] When the peripheral interface is connected to a first external device, the other end of the first resistor outputs a high level signal obtained by dividing the first voltage by the first resistor;
[0015] When the peripheral interface is connected to a second external device, the first end and the second end of the peripheral interface are short-circuited, and the other end of the first resistor outputs a low-level signal obtained by dividing the first voltage by the first resistor.
[0016] Optionally, when the level signal is the high level signal, the processor is set to the first state according to the high level signal, and the second pin is used to output a signal;
[0017] In the case that the level signal is the low level signal, the processor is set to the second state according to the low level signal, and the second pin is used to receive a signal.
[0018] Optionally, when the level signal is the high level signal, the isolation module is turned off, and the first pin and the second pin are disconnected;
[0019] When the level signal is the low level signal, the isolation module is turned on, and the first pin is connected to the second pin.
[0020] Optionally, the isolation module includes:
[0021] a second resistor, one end of which serves as a controlled end of the conversion module and is connected to the controlled end of the processor and the other end of the first resistor;
[0022] A transistor, wherein the base of the transistor is connected to the other end of the second resistor, and the emitter of the transistor is connected to the second voltage;
[0023] A grounding resistor, one end of which is connected to the collector of the transistor, and the other end of which is grounded;
[0024] A digital isolator, wherein an enable end of the digital isolator is connected to one end of the grounding resistor, a first end of the digital isolator is connected to the other end of the conversion module and a first pin of the processor as one end of the isolation module, and a second end of the digital isolator is connected to the second pin of the processor as the other end of the isolation module.
[0025] When the level signal is the high level signal, the transistor is turned off, the enable terminal of the digital isolator is grounded through the grounding resistor, the digital isolator is turned off, and the first pin and the second pin are disconnected;
[0026] When the level signal is the low level signal, the transistor is turned on, the enable terminal of the digital isolator is connected to the voltage obtained by dividing the second voltage through the grounding resistor, the digital isolator is turned on, and the first pin and the second pin are connected.
[0027] Optionally, the pin multiplexing circuit further includes:
[0028] a second diode, wherein an anode of the second diode is connected to a third voltage, and a cathode of the second diode is connected to a power supply end of the conversion module;
[0029] A third diode, wherein the anode of the third diode is connected to the third end of the peripheral interface, and the cathode of the third diode is connected to the cathode of the second diode and the power supply end of the conversion module.
[0030] Optionally, the pin multiplexing circuit further includes a plurality of bidirectional thyristor diodes, one end of the bidirectional thyristor diodes is grounded, the other end of the bidirectional thyristor diodes is connected between the peripheral interface and the conversion module, and the bidirectional thyristor diodes are used to prevent static electricity.
[0031] Optionally, the peripheral interface includes a USB interface.
[0032] Optionally, the processor includes an MCU.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides an electronic device, which includes the pin multiplexing circuit as described above.
[0034] The present application proposes a pin multiplexing circuit and an electronic device, the pin multiplexing circuit comprising: a peripheral interface, a first end of the peripheral interface is grounded, and the peripheral interface is used to connect an external device; a conversion module, one end of the conversion module is connected to the second end of the peripheral interface, and the conversion module is used to convert the signal output by the external device into a serial port signal; a processor, a first pin of the processor is connected to the other end of the conversion module, and the processor is used to perform an action according to the serial port signal; an isolation module, one end of the isolation module is connected to the other end of the conversion module and the first pin of the processor, the other end of the isolation module is connected to the second pin of the processor, and the isolation module is used to turn on and off the connection between the first pin and the second pin; a control module, one end of the control module is connected to the third end of the peripheral interface, the other end of the control module is connected to the processor and the controlled end of the isolation module, the control module is used to output a level signal according to the type of the external device, control the second pin to output a signal or receive a signal, and the control module is also used to control the isolation module to be turned on or off. The pin multiplexing circuit provided in the present application realizes the compatibility of the processor pins as two peripherals with different functions, solves the problem of insufficient processor pins in some cases, eliminates the need to use a processor with more pins, and reduces circuit design costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0036] Figure 1 A schematic diagram of the structure of a pin multiplexing circuit provided in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of the structure of a control module in a pin multiplexing circuit provided in an embodiment of the present application;
[0038] Figure 3 A schematic diagram of the structure of an isolation module in a pin multiplexing circuit provided in an embodiment of the present application;
[0039] Figure 4 A detailed structural diagram of a pin multiplexing circuit provided in an embodiment of the present application;
[0040] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0041] Description of Figure Numbers:
[0042] Label name Label name 10 Peripheral Interface 20 Conversion Module 30 processor 40 Isolation module 50 Control Module U1 First voltage U2 Second voltage U3 The third voltage R1 First resistor R2 Second resistor Rd Ground resistance DR1 The first diode DR2 The second diode DR3 The third diode VT triode 31 First Pin 32 Second pin 41 Digital Isolators 01 Electronic devices 02 Pin multiplexing circuit
[0043] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0046] In addition, the descriptions of "first", "second", etc. in this application are only for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the meaning of "and / or" appearing in the full text is to include three parallel schemes. Taking "A and / or B" as an example, it includes scheme A, or scheme B, or a scheme that satisfies both A and B.
[0047] In this application, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0048] It should also be understood that the references to "one embodiment" or "some embodiments" described in the specification of the embodiments of the present application mean that one or more embodiments of the embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0049] With the development of power electronics technology, there are more and more types of electronic products, and more and more functions can be realized. However, the more functions an electronic product integrates, the more peripheral interfaces the MCU (Micro controller Unit) needs to have.
[0050] Normally, if the signals of two different peripherals are to be distributed to the MCU, they need to be distributed to different pins. When the MCU pins are not enough, it is often necessary to select an MCU with more pins, but this will increase the project cost.
[0051] Based on this, the present application proposes a pin multiplexing circuit and an electronic device, the pin multiplexing circuit comprising: a peripheral interface, a first end of the peripheral interface is grounded, and the peripheral interface is used to connect an external device; a conversion module, one end of the conversion module is connected to the second end of the peripheral interface, and the conversion module is used to convert the signal output by the external device into a serial port signal; a processor, a first pin of the processor is connected to the other end of the conversion module, and the processor is used to perform an action according to the serial port signal; an isolation module, one end of the isolation module is connected to the other end of the conversion module and the first pin of the processor, and the other end of the isolation module is connected to the second pin of the processor, and the isolation module is used to turn on and off the connection between the first pin and the second pin; a control module, one end of the control module is connected to the third end of the peripheral interface, and the other end of the control module is connected to the processor and the controlled end of the isolation module, the control module is used to output a level signal according to the type of the external device, control the second pin to output a signal or receive a signal, and the control module is also used to control the isolation module to be turned on or off. The pin multiplexing circuit provided in the present application realizes the compatibility of the processor pins as two peripherals with different functions, solves the problem of insufficient processor pins in some cases, eliminates the need to use a processor with more pins, and reduces circuit design costs.
[0052] The present application embodiment provides a pin multiplexing circuit, referring to Figure 1 , Figure 1 A schematic diagram of a pin multiplexing circuit provided in an embodiment of the present application, wherein the pin multiplexing circuit comprises:
[0053] A peripheral interface 10, a first end of which is grounded, and the peripheral interface 10 is used to access an external device;
[0054] A conversion module 20, one end of which is connected to the second end of the peripheral interface 10, and the conversion module 20 is used to convert the signal output by the external device into a serial port signal;
[0055] A processor 30, wherein a first pin 31 of the processor 30 is connected to the other end of the conversion module 20, and the processor 30 is used to perform an action according to the serial port signal;
[0056] An isolation module 40, one end of which is connected to the other end of the conversion module 20 and the first pin 31 of the processor 30, and the other end of the isolation module 40 is connected to the second pin 32 of the processor 30, and the isolation module 40 is used to open and close the connection between the first pin 31 and the second pin 32.
[0057] A control module 50, one end of which is connected to the third end of the peripheral interface 10, and the other end of which is connected to the processor 30 and the controlled end of the isolation module 40. The control module 50 is used to output a level signal according to the type of the external device, control the second pin 32 to output a signal or receive a signal, and the control module 50 is also used to control the isolation module 40 to be turned on or off.
[0058] In this embodiment, the pin multiplexing circuit can control whether the pin of the processor 30 it includes is used to output signals or receive signals according to the external device it is connected to, so that when the pin multiplexing circuit is connected to different external devices, it can meet the requirements of the external device to realize its function.
[0059] The pin multiplexing circuit in this embodiment includes a peripheral interface 10, a conversion module 20, a processor 30, an isolation module 40 and a control module 50. Among them, the peripheral interface 10 is used to access an external device, which can be a computer; the conversion module 20 is connected to the peripheral interface 10, and the output signal of the external device is transmitted to the conversion module 20 through the peripheral interface 10, and the conversion module 20 converts the output signal of the external device into a serial port signal; the processor 30 is connected to the other end of the conversion module 20, and after receiving the serial port signal, the processor 30 performs a corresponding action to complete the function that the external device wants to achieve; one end of the isolation module 40 is connected to the first pin 31 of the processor 30, and the other end is connected to the second pin 32 of the processor 30. The isolation module 40 can connect or disconnect the first pin 31 and the second pin 32. When the first pin 31 and the second pin 32 are disconnected, the two do not affect each other, and the connection The first pin 31 and the second pin 32 receive or output their respective signals. When the first pin 31 and the second pin 32 are connected, the two receive or send the same signal; one end of the control module 50 is connected to the peripheral interface 10, and the other end is connected to the controlled end of the processor 30 and the isolation module 40. The control module 50 outputs a level signal to the processor 30 and the isolation module 40 according to the type of the external device connected to the peripheral interface 10, specifically according to the connector of the external device, and controls the processor 30 to set its pin to an output state or a receiving state, so that its pin can achieve different functions when connected to different external devices. At the same time, the control module 50 also controls the conduction and cutoff of the isolation module 40, so that the isolation module 40 connects or disconnects the connection between the first pin 31 and the second pin 32.
[0060] From the perspective of the various components of the pin multiplexing circuit, the peripheral interface 10 is used to access an external device; the conversion module 20 is used to convert the signal output by the external device into a serial port signal and input it into the processor 30; the processor 30 is used to perform corresponding actions according to the serial port signal to complete the function that the external device wants to achieve; the isolation module 40 is used to open and close the connection between the first pin 31 and the second pin 32, so that the two can receive and send signals separately or together; the control module 50 is used to control the second pin 32 to receive or output signals, and at the same time control the isolation module 40 to be turned on or off. This embodiment controls the pins of the processor 30 to meet the needs of different external devices, and does not need to connect external devices with different functions to different pins, thereby realizing the multiplexing of the pins of the processor 30 and reducing the cost of circuit design.
[0061] Reference Figure 2 In some feasible embodiments, the control module 50 includes:
[0062] A first resistor R1, one end of which is connected to a first voltage U1, and the other end of which serves as the other end of the control module 50, connected to the processor 30 and the controlled end of the isolation module 40;
[0063] a first diode DR1, wherein an anode of the first diode DR1 is connected to the other end of the first resistor R1, and a cathode of the first diode DR1 serves as one end of the control module 50 and is connected to a third end of the peripheral interface 10;
[0064] When the peripheral interface 10 is connected to a first external device, the other end of the first resistor R1 outputs a high level signal obtained by dividing the first voltage U1 by the first resistor R1;
[0065] When the peripheral interface 10 is connected to a second external device, the first end and the second end of the peripheral interface 10 are short-circuited, and the other end of the first resistor R1 outputs a low-level signal obtained by dividing the first voltage U1 by the first resistor R1 .
[0066] In this embodiment, the control module 50 includes a first resistor R1 and a first diode DR1. The first external device refers to an external device in which the first end and the third end of the peripheral interface 10 are not short-circuited when the connector is connected to the peripheral interface 10. When the peripheral interface 10 is connected to the first external device, the first voltage U1 provides a voltage, i.e., a high-level signal, to the controlled end of the processor 30 and the isolation module 40 through the first resistor R1. The second external device refers to an external device in which the first end and the third end of the peripheral interface 10 are short-circuited when the connector is connected to the peripheral interface 10. When the peripheral interface 10 is connected to the second external device, since the first end and the third end of the peripheral interface 10 are short-circuited, and since the first end of the peripheral interface 10 is grounded, the first voltage U1 passes through the first resistor R1 and then passes through the first diode DR1 to the first end of the peripheral interface 10 to be grounded, and the voltage at the other end of the first resistor R1 is pulled down to about 0 volts, and the controlled end of the processor 30 and the isolation module 40 is connected to a voltage of about 0 volts.
[0067] In some feasible embodiments, when the level signal is the high level signal, the processor 30 is set to the first state according to the high level signal, and the second pin 32 is used to output a signal;
[0068] In the case that the level signal is the low level signal, the processor 30 is set to the second state according to the low level signal, and the second pin 32 is used to receive a signal.
[0069] In this embodiment, as an example, the first state of the processor 30 may be a communication state. When the controlled end of the processor 30 is connected to a high-level signal, the first pin 31 of the processor 30 receives the serial port signal output by the conversion module 20, and the second pin 32 of the processor 30 is used to output the signal. The second state of the processor 30 may be a boot state, i.e., a Boot state. When the controlled end of the processor 30 is connected to a low-level signal, the first pin 31 of the processor 30 receives the serial port signal, but it cannot be recognized inside the processor 30. The second pin 32 of the processor 30 is used to receive the signal, and the second pin 32 can also receive the serial port signal. After receiving the serial port signal, the processor 30 starts burning the program.
[0070] In some feasible embodiments, when the level signal is the high level signal, the isolation module 40 is turned off, and the first pin 31 and the second pin 32 are disconnected;
[0071] When the level signal is the low level signal, the isolation module 40 is turned on, and the first pin 31 is connected to the second pin 32 .
[0072] In this embodiment, the two ends of the isolation module 40 are respectively connected to the first pin 31 and the second pin 32 of the processor 30. When the controlled end of the isolation module 40 receives a high-level signal, the isolation module 40 is cut off, and the first pin 31 and the second pin 32 are separated by the isolation module 40. The two are independent of each other and do not interfere with each other. When the controlled end of the isolation module 40 receives a low-level signal, the isolation module 40 is turned on, the first pin 31 and the second pin 32 are connected through the isolation module 40, and the serial port signal output by the conversion module 20 is transmitted to the first pin 31 and the second pin 32 through the isolation module 40.
[0073] Reference Figure 3 In some feasible embodiments, the isolation module 40 includes:
[0074] a second resistor R2, one end of the second resistor R2 serving as a controlled end of the conversion module 20, connected to the controlled end of the processor 30 and the other end of the first resistor R1;
[0075] A transistor VT, wherein the base of the transistor VT is connected to the other end of the second resistor R2, and the emitter of the transistor VT is connected to the second voltage U2;
[0076] A grounding resistor Rd, one end of which is connected to the collector of the transistor VT, and the other end of which is grounded;
[0077] A digital isolator 41, wherein the enable end of the digital isolator 41 is connected to one end of the ground resistor Rd, the first end of the digital isolator 41 is connected to the other end of the conversion module 20 and the first pin 31 of the processor 30 as one end of the isolation module 40, and the second end of the digital isolator 41 is connected to the second pin 32 of the processor 30 as the other end of the isolation module 40.
[0078] When the level signal is the high level signal, the transistor VT is turned off, the enable end of the digital isolator 41 is grounded through the grounding resistor Rd, the digital isolator 41 is turned off, and the first pin 31 and the second pin 32 are disconnected;
[0079] When the level signal is the low level signal, the transistor VT is turned on, the enable terminal of the digital isolator 41 is connected to the voltage obtained by dividing the second voltage U2 by the grounding resistor Rd, the digital isolator 41 is turned on, and the first pin 31 and the second pin 32 are connected.
[0080] In this embodiment, the second voltage U2 and the first voltage U1 can be provided by the same power supply, or by a power supply respectively. For example, the first voltage U1 and the second voltage U2 are both 3.3 volts, and the two can be provided by a 3.3 volt power supply, or by two 3.3 volt power supplies respectively. The isolation module 40 includes a second resistor R2, a transistor VT, a grounding resistor Rd and a digital isolator 41, wherein the transistor VT is turned on when the base is at a low level. When the voltage divided by the other end of the first resistor R1 is a high level, the transistor VT is not turned on, the enable end of the digital isolator 41 is grounded through the grounding resistor Rd, and the digital isolator 41 is not enabled in this case. The serial port signal output by the conversion module 20 can only be transmitted to the first pin 31 of the processor 30, and will not be transmitted to the second pin 32 of the processor 30 through the digital isolator 41. At this time, the processor 30 is in the first state, and the first pin 31 and the second pin 32 need to complete their respective signal reception and output independently. Therefore, the digital isolator 41 just realizes the isolation of the two pins. When the voltage distributed to the other end of the first resistor R1 is at a low level, the transistor VT is turned on, and the enable end of the digital isolator 41 is connected to the second voltage U2. The digital isolator 41 is enabled in this case. The serial port signal output by the conversion module 20 can be transmitted to the first pin 31 of the processor 30, and can also be transmitted to the second pin 32 of the processor 30 through the digital isolator 41. At this time, the processor 30 is in the second state, and the second pin 32 just needs to be connected to the signal. Therefore, the digital isolator 41 just realizes the transmission of the signal.
[0081] Reference Figure 4In some feasible embodiments, the pin multiplexing circuit further includes:
[0082] a second diode DR2, wherein the anode of the second diode DR2 is connected to the third voltage U3, and the cathode of the second diode DR2 is connected to the power supply end of the conversion module 20;
[0083] A third diode DR3 , wherein the anode of the third diode DR3 is connected to the third end of the peripheral interface 10 , and the cathode of the third diode DR3 is connected to the cathode of the second diode DR2 and the power supply end of the conversion module 20 .
[0084] In this embodiment, the amplitude of the third voltage U3 is slightly greater than the first voltage U1 and the second voltage U2, and the third voltage U3 is about 5 volts, which is used to power the conversion module 20. The pin multiplexing circuit also includes a second diode DR2 and a third diode DR3. When the peripheral interface 10 is connected to the first external device, the third end of the peripheral interface 10 will be connected to the external voltage output by the first external device. When the external voltage is greater than the third voltage U3, the external voltage passes through the third diode DR3 to the power supply end of the conversion module 20 to power the conversion module 20, and the second diode DR2 is cut off; when the external voltage is less than the third voltage U3, the third voltage U3 is transmitted to the power supply end of the conversion module 20 through the second diode DR2 to power the conversion module 20, and the third diode DR3 is cut off. When the peripheral interface 10 is connected to the second external device, the first end and the third end of the peripheral interface 10 are short-circuited. At this time, there is no external voltage to power the conversion module 20, and the third voltage U3 is used to power it. In addition, the third diode DR3 is cut off at this time to prevent the third voltage U3 from interfering with the voltage division of the first resistor R1.
[0085] In some feasible embodiments, the pin multiplexing circuit also includes multiple bidirectional thyristor diodes, one end of the bidirectional thyristor diode is grounded, and the other end of the bidirectional thyristor diode is connected between the peripheral interface 10 and the conversion module 20, and the bidirectional thyristor diode is used to prevent static electricity.
[0086] In this embodiment, in the actual production process, static electricity is easily generated in electronic equipment, which may damage the electronic equipment. Therefore, a bidirectional thyristor diode, namely a TVS tube (Transient Voltage Suppressor), needs to be provided in the circuit to discharge and eliminate the static electricity.
[0087] In some feasible embodiments, the peripheral device interface 10 includes a USB interface.
[0088] In this embodiment, the peripheral interface 10 includes not only a USB interface, but also other interfaces, but most of the external devices are computers, and the USB interface is used more often. When connecting to a computer, two different USB cables can be used, one end connected to the computer is a normal USB interface commonly seen on the market, and the other end connected to the peripheral interface 10, one of which does not short-circuit the first end and the third end of the peripheral interface 10, and the other can short-circuit the first end and the third end of the peripheral interface 10.
[0089] In some feasible embodiments, the processor 30 includes an MCU.
[0090] In this embodiment, the processor 30 may be an MCU, and may also be extended to other processors, such as a CPU (Central Processing Unit).
[0091] The present embodiment provides a pin multiplexing circuit, wherein the peripheral interface is used to access an external device, when the first external device is accessed, the conversion module converts the signal output by the external device into a serial port signal and inputs it into the first pin of the processor, the control module controls the processor to be set to the first state, the second pin of the processor is used to output the signal at this time, and the isolation module, under the control of the control module, separates the first pin and the second pin to prevent the two from affecting each other; when the second external device is accessed, the control module controls the processor to be set to the second state, the second pin of the processor is used to receive the signal at this time, and the isolation module, under the control of the control module, connects the first pin and the second pin, so that the serial port signal output by the conversion module is input into the second pin of the processor. The present embodiment controls the pins of the processor to meet the needs of different external devices, and does not need to connect external devices with different functions to different pins, thereby realizing the multiplexing of the processor pins and reducing the cost of circuit design.
[0092] In addition, the present application embodiment also provides an electronic device 01, referring to Figure 5 The electronic device 01 includes the pin multiplexing circuit 02 provided in the above embodiment.
[0093] Since the electronic device proposed in this embodiment includes the pin multiplexing circuit proposed in the above embodiments, it has the beneficial effects of the above embodiments. The specific working process and principle of the pin multiplexing circuit are detailed in the pin multiplexing circuits provided in the above embodiments, which will not be described one by one here, and are all within the protection scope of this embodiment.
[0094] It should be noted that the technical solutions of the various embodiments of the present application can be combined with each other, but it must be based on the fact that they can be implemented by technical personnel in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0095] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A pin multiplexing circuit, characterized in that: The pin multiplexing circuit comprises: A peripheral interface, a first end of which is grounded, and the peripheral interface is used to access an external device; A conversion module, one end of which is connected to the second end of the peripheral interface, and the conversion module is used to convert a signal output by the external device into a serial port signal; A processor, wherein a first pin of the processor is connected to the other end of the conversion module, and the processor is used to execute an action according to the serial port signal; An isolation module, one end of which is connected to the other end of the conversion module and the first pin of the processor, and the other end of the isolation module is connected to the second pin of the processor, and the isolation module is used to open and close the connection between the first pin and the second pin; A control module, one end of the control module is connected to the third end of the peripheral interface, and the other end of the control module is connected to the processor and the controlled end of the isolation module. The control module is used to output a level signal according to the type of the external device, control the second pin to output a signal or receive a signal, and the control module is also used to control the isolation module to be turned on or off.
2. The pin multiplexing circuit according to claim 1, characterized in that: The control module comprises: a first resistor, one end of which is connected to a first voltage, and the other end of which serves as the other end of the control module, connecting the processor and the controlled end of the isolation module; a first diode, wherein an anode of the first diode is connected to the other end of the first resistor, and a cathode of the first diode serves as one end of the control module and is connected to a third end of the peripheral interface; When the peripheral interface is connected to a first external device, the other end of the first resistor outputs a high level signal obtained by dividing the first voltage by the first resistor; When the peripheral interface is connected to a second external device, the first end and the second end of the peripheral interface are short-circuited, and the other end of the first resistor outputs a low-level signal obtained by dividing the first voltage by the first resistor.
3. The pin multiplexing circuit according to claim 2, characterized in that: In the case where the level signal is the high level signal, the processor is set to the first state according to the high level signal, and the second pin is used to output a signal; In the case that the level signal is the low level signal, the processor is set to the second state according to the low level signal, and the second pin is used to receive a signal.
4. The pin multiplexing circuit according to claim 3, characterized in that: When the level signal is the high level signal, the isolation module is turned off, and the first pin and the second pin are disconnected; When the level signal is the low level signal, the isolation module is turned on, and the first pin is connected to the second pin.
5. The pin multiplexing circuit according to claim 4, characterized in that: The isolation module comprises: a second resistor, one end of which serves as a controlled end of the conversion module and is connected to the controlled end of the processor and the other end of the first resistor; A transistor, wherein the base of the transistor is connected to the other end of the second resistor, and the emitter of the transistor is connected to the second voltage; A grounding resistor, one end of which is connected to the collector of the transistor, and the other end of which is grounded; A digital isolator, wherein an enable end of the digital isolator is connected to one end of the grounding resistor, a first end of the digital isolator is connected to the other end of the conversion module and a first pin of the processor as one end of the isolation module, and a second end of the digital isolator is connected to the second pin of the processor as the other end of the isolation module; When the level signal is the high level signal, the transistor is turned off, the enable terminal of the digital isolator is grounded through the grounding resistor, the digital isolator is turned off, and the first pin and the second pin are disconnected; When the level signal is the low level signal, the transistor is turned on, the enable terminal of the digital isolator is connected to the voltage obtained by dividing the second voltage through the grounding resistor, the digital isolator is turned on, and the first pin and the second pin are connected.
6. The pin multiplexing circuit according to claim 1, characterized in that: The pin multiplexing circuit also includes: a second diode, wherein an anode of the second diode is connected to a third voltage, and a cathode of the second diode is connected to a power supply end of the conversion module; A third diode, wherein the anode of the third diode is connected to the third end of the peripheral interface, and the cathode of the third diode is connected to the cathode of the second diode and the power supply end of the conversion module.
7. The pin multiplexing circuit according to claim 1, characterized in that: The pin multiplexing circuit also includes a plurality of bidirectional thyristor diodes, one end of each bidirectional thyristor diode is grounded, the other end of each bidirectional thyristor diode is connected between the peripheral interface and the conversion module, and the bidirectional thyristor diode is used to prevent static electricity.
8. The pin multiplexing circuit according to claim 1, characterized in that: The peripheral interface includes a USB interface.
9. The pin multiplexing circuit according to claim 1, characterized in that: The processor includes an MCU.
10. An electronic device, characterized in that: The electronic device comprises the pin multiplexing circuit according to any one of claims 1 to 9.
