Three-state key detection circuit, electronic equipment and automobile
By setting a three-state button detection circuit between the three-state button and the control circuit to isolate and convert the voltage signal, the problem of the three-state button voltage damaging the control circuit is solved, and the safety performance is improved.
Patent Information
- Application Number
- CN202422681136.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2034-11-01
AI Technical Summary
The car's control circuit cannot effectively detect the state of the tri-state button without being damaged by high voltage, affecting the safety performance of electronic equipment and the car.
By setting a three-state button detection circuit between the three-state button and the control circuit, including a voltage acquisition unit, a voltage comparison unit and a voltage conversion unit, the voltage of the three-state button is isolated and converted into a voltage signal acceptable to the control circuit to achieve state detection.
This prevents the tri-state button voltage from directly entering the control circuit and causing damage, thereby improving the safety performance of electronic equipment and automobiles, while eliminating the need to significantly modify the existing control circuit design.
Smart Images

Figure CN223428437U_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic circuits, and in particular to a three-state key detection circuit, electronic equipment, and a car. Background Art
[0002] With the continuous advancement of automotive and electronic circuit technology, more and more intelligent and entertainment-oriented electronic devices are being installed in cars. These electronic devices, in addition to providing users with a wide range of functions, also provide users with more buttons for selection and other operations, such as tri-state buttons. The car's control circuit is connected to the tri-state buttons and is used to detect the state of the tri-state buttons, thereby executing corresponding control of related devices in the car.
[0003] The power supply voltage for the three-state button in some electronic devices is 12V or 24V, while the maximum control voltage supported by the car's control circuit is only about 3V or 5V. When the control circuit detects the changes in the three-state button, the voltage of the three-state button will directly enter the control circuit, causing damage to the control circuit and affecting the safety performance of the electronic device and the car it is in. Utility Model Content
[0004] The present application provides a three-state button detection circuit, an electronic device, and a car, which are used to prevent damage caused by the voltage of the three-state button directly entering the control circuit, thereby improving the safety performance of the electronic device and the car in which it is located.
[0005] A first aspect of the present application provides a three-state key detection circuit, comprising:
[0006] a voltage acquisition unit connected to the tri-state button, the first voltage source, and the voltage comparison unit, and configured to acquire a first voltage provided by the first voltage source and provide a second voltage to the voltage comparison unit according to the state of the tri-state button;
[0007] The voltage comparison unit is connected to the voltage acquisition unit and the voltage conversion unit, and is configured to provide a first signal to the voltage conversion unit according to a magnitude relationship between the second voltage and the first preset voltage, and to provide a second signal to the voltage conversion unit according to a magnitude relationship between the second voltage and the second preset voltage;
[0008] The voltage conversion unit is connected to the voltage comparison unit and the control circuit, and is configured to provide a third voltage to the control circuit according to the first signal and the second signal, so that the control circuit determines the state of the tri-state button according to the third voltage.
[0009] In an embodiment of the first aspect of the present application, the voltage comparison unit includes:
[0010] The first comparator has a positive input end connected to the voltage acquisition unit and configured to acquire the second voltage, a negative input end configured to acquire the first preset voltage, and an output end connected to the voltage conversion unit and configured to output the first signal.
[0011] The second comparator has a positive input end configured to acquire the second preset voltage, a negative input end connected to the voltage conversion unit and configured to acquire the second voltage, and an output end connected to the voltage conversion circuit and configured to output the second signal.
[0012] In an embodiment of the first aspect of the present application, the voltage comparison unit further comprises:
[0013] The preset voltage generation unit is configured to acquire the first voltage, and provide the first preset voltage to the first comparator and the second preset voltage to the second comparator according to the first voltage.
[0014] In an embodiment of the first aspect of the present application, the preset voltage generation unit comprises:
[0015] A first resistor, a second resistor and a third resistor.
[0016] A first end of the first resistor is connected to the first voltage source, a second end of the first resistor is connected to a negative input end of the first comparator and a first end of the second resistor, a second end of the second resistor is connected to a positive input end of the second comparator and a first end of the third resistor, and a second end of the third resistor is grounded.
[0017] In an embodiment of the first aspect of the present application, the voltage acquisition unit comprises:
[0018] A fourth resistor, a fifth resistor and a sixth resistor.
[0019] A first end of the fourth resistor is connected to the first voltage source, a second end of the fourth resistor is connected to a positive input end of the first comparator and a negative input end of the second comparator, a first end of the fifth resistor and a first end of the sixth resistor, a second end of the fifth resistor is connected to a fixed end of the tri-state button, a second end of the sixth resistor is grounded, a first free end of the tri-state button is connected to the first voltage source, a second free end of the tri-state button is grounded, and a third free end of the tri-state button is suspended.
[0020] In an embodiment of the first aspect of the present application, the voltage conversion unit comprises:
[0021] A first switch, a second switch, a seventh resistor, an eighth resistor, a ninth resistor and a tenth resistor.
[0022] A first end of the seventh resistor is connected to a second voltage source and is configured to obtain a fourth voltage provided by the second voltage source. A second end of the seventh resistor is connected to the control circuit and the first end of the eighth resistor. A second end of the eighth resistor is connected to the first end of the first switch and the first end of the ninth resistor. A second end of the ninth resistor is connected to the first end of the second switch and the first end of the tenth resistor. The first end of the tenth resistor, the second end of the first switch, and the second end of the second switch are grounded. The control end of the first switch is configured to obtain the first signal, and the control end of the second switch is configured to obtain the second signal.
[0023] In an embodiment of the first aspect of the present application, the first switch and the second switch are N-type MOS transistors.
[0024] In an embodiment of the first aspect of the present application, the fourth voltage is less than the first voltage.
[0025] A second aspect of the present application provides an electronic device, including:
[0026] Tri-state button;
[0027] The tri-state button detection circuit according to any one of the first aspects of the present application is configured to provide the third voltage to the control circuit according to the state of the tri-state button;
[0028] The control circuit is configured to determine the state of the tri-state button according to the third voltage.
[0029] A third aspect of the present application provides a car, comprising the electronic device as described in the second aspect of the present application.
[0030] In summary, the three-state button detection circuit, electronic device and automobile provided by the present application, the voltage acquisition unit in the three-state button detection circuit provides a second voltage to the voltage comparison unit according to the state of the three-state button, the voltage comparison unit provides a first signal and a second signal to the voltage conversion unit according to the comparison results of the second voltage with the first preset voltage and the second preset voltage, respectively, the voltage conversion unit provides a third voltage to the control circuit according to the first signal and the second signal, and finally the control circuit determines the state of the three-state button according to the third voltage, thereby avoiding the voltage of the three-state button directly entering the control circuit and causing damage to the control circuit, thereby improving the safety performance of the electronic device and the automobile in which it is located. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only represent some of the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without any creative effort.
[0032] Figure 1 A structural schematic diagram of an embodiment of an electronic device in the prior art is shown in FIG. 1.
[0033] Figure 2 A structural schematic diagram of an embodiment of an electronic device provided by the present application is shown in FIG. 2.
[0034] Figure 3 A structural schematic diagram of an embodiment of a three-state key detection circuit provided by the present application is shown in FIG. 3.
[0035] Figure 4 A circuit structural schematic diagram of an embodiment of a voltage acquisition unit and a voltage comparison unit provided by the present application is shown in FIG. 4.
[0036] Figure 5 A circuit structural schematic diagram of an embodiment of a voltage conversion unit provided by the present application is shown in FIG. 5. DETAILED DESCRIPTION
[0037] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort fall within the scope of protection of the present application.
[0038] The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to include all the steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0039] Figure 1 A structural schematic diagram of an embodiment of an electronic device in the prior art is shown in FIG. 1. Figure 1The electronic device 10 shown includes a three-state button 101 and a control circuit 102, wherein the three-state button 101 includes three different states, recorded as a first state, a second state and a third state, and the control circuit 102 can be used to detect the current state of the three-state button 101 and perform relevant control according to the state of the three-state button 101.
[0040] In one embodiment, if Figure 1 The electronic device shown can be used in an automobile. Control circuit 10 can be a controller for implementing relevant control functions in the automobile, such as a CPU, MCU, or SoC. Control circuit 102 in the automobile can be connected to tri-state button 101 and detect the state of tri-state button 101 through the connection relationship with tri-state button 101, thereby performing corresponding control on relevant devices in the automobile based on the state of the tri-state button.
[0041] However, in some electronic devices 10 provided by certain technologies, the voltage powering the tri-state button 101 is 12V or 24V. For example, the tri-state button 101 installed on a car's window lift, rearview mirror folding and flipping, windshield wipers, etc., is powered by 12V or 24V. Meanwhile, the power supply voltage of the car's control circuit 102 is approximately 3V or 5V, so the maximum voltage supported by the control circuit 102 is only 3V.
[0042] Therefore, when the voltage supported by tri-state button 101 is much higher than the voltage supported by control circuit 102, if control circuit 102 is still directly connected to tri-state button 101 and detects the state of tri-state button 101 directly through the connection relationship with tri-state button 101, the higher voltage on tri-state button 101 will directly enter the control circuit. Since control circuit 102 does not support 12V or 24V voltage, this will damage control circuit 102, affecting the safety performance of electronic device 10 and the vehicle in which it is installed.
[0043] Based on this, the present application provides a three-state button detection circuit, an electronic device, and a car. By setting a three-state button detection circuit 100 between the three-state button 101 and the control circuit 102 in the electronic device 10, the control circuit 102 can detect the state of the three-state button 101, thereby preventing the voltage of the three-state button 101 from directly entering the control circuit 102 and causing damage to the control circuit 102, thereby improving the safety performance of the electronic device 10 and the car in which it is located.
[0044] The following specific embodiments are used to describe the technical solution of the present application in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0045] Figure 2This is a structural diagram of an embodiment of an electronic device provided by this application, such as Figure 2 The electronic device 10 shown can be applied to a car. Figure 2 The electronic device 10 shown includes a tri-state button 101 , a tri-state button detection circuit 100 and a control circuit 102 .
[0046] The tri-state button 101 is connected to the control circuit 102 via the tri-state button detection circuit 100. That is, there is no direct connection between the tri-state button 101 and the control circuit 102. The tri-state button detection circuit 100 provided between the tri-state button 101 and the control circuit 102 isolates the tri-state button 101 and the control circuit 102, preventing the voltage of the tri-state button 101 from directly entering the control circuit 102.
[0047] Accordingly, the tri-state button detection circuit 100 has the function of detecting the state of the tri-state button 101 , so that the control circuit 102 determines the state of the tri-state button 101 based on the detection result of the tri-state button detection circuit 100 .
[0048] Therefore, in the electronic device 10 provided in this embodiment, the isolation and detection functions are simultaneously realized by providing the three-state button detection circuit 100 between the three-state button 101 and the control circuit 102. Even when the voltage of the three-state button 101 is much greater than the voltage of the control circuit 102, the control circuit 102 is able to detect the state of the three-state button 101 while preventing the voltage of the three-state button 101 from directly entering the control circuit 102 and causing damage to the control circuit 102. This improves the safety performance of the electronic device 10 and the vehicle in which it is located.
[0049] The following describes the specific structure of the tri-state key detection circuit 101 provided by the present application in conjunction with the accompanying drawings. Figure 3 This is a structural diagram of an embodiment of a three-state key detection circuit provided by the present application, as shown in FIG. Figure 3 The tri-state key detection circuit 101 shown can be applied to Figure 2 In the electronic device 10 shown.
[0050] Specifically, if Figure 3 The tri-state button detection circuit 101 shown includes a voltage acquisition unit 1001, a voltage comparison unit 1002, and a voltage conversion unit. The voltage acquisition unit 1001, the voltage comparison unit 1002, and the voltage conversion unit 1003 are connected in sequence. The voltage acquisition unit 1001 is also connected to the tri-state button 101 and the first voltage source, and the voltage conversion unit 1003 is also connected to the control circuit 102.
[0051] The voltage acquisition unit 1001 is configured to acquire a first voltage V1 provided by a first voltage source, generate a second voltage V2 based on the first voltage V1 according to the state of the tri-state key, and provide the second voltage V2 to the voltage comparison unit 1002 .
[0052] The voltage comparison unit 1002 is configured to obtain the second voltage V2 and compare the second voltage V2 with the first preset voltage Vref1 and the second preset voltage Vref2 respectively, thereby generating a first signal according to the comparison result of the second voltage V2 and the first preset voltage Vref1, and generating a second signal according to the comparison result of the second voltage V2 and the second preset voltage Vref2, and finally providing the first signal V3 and the second signal V4 to the voltage conversion unit.
[0053] In one embodiment, the first preset voltage Vref1 is greater than the second preset voltage Vref2. For example, when the first voltage is 12 V, the first preset voltage Vref1 may be 8 V, and the second preset voltage Vref2 may be 4 V. The first preset voltage Vref1 being greater than the second preset voltage Vref2 may also be set based on the actual voltage value of the first power supply.
[0054] The voltage conversion unit 1003 is configured to receive the first signal V3 and the second signal V4, and provide a third voltage V5 to the control circuit 102 based on the first signal V3 and the second signal V4. Accordingly, the control circuit 102 can determine the state of the tri-state button 101 based on the third voltage V5 provided by the voltage conversion unit 1003.
[0055] In one embodiment, the third voltage V5 provided by the voltage conversion unit 1003 to the control circuit 102 can be a digital signal sent through the input IO interface, or the third voltage V5 provided by the voltage conversion unit 1003 to the control circuit 102 can also be an analog signal sent to the ADC module in the control circuit 102 for processing.
[0056] Therefore, when the control circuit 102 detects the state of the tri-state button 101, the voltage acquisition unit 101 in the tri-state button detection circuit 100 provides a second voltage V2 to the voltage comparison unit 1002 based on the state of the tri-state button 101. The voltage comparison unit 1002 provides a first signal V3 and a second signal V4 to the voltage conversion unit 1003. The voltage conversion unit 1002 provides a third voltage V5 to the control circuit based on the first signal V3 and the second signal V4. Finally, the control circuit 102 determines the state of the tri-state button based on the third voltage V5. During this process, the voltage of the tri-state button 101 does not directly enter the control circuit 102, and the control circuit 102 is still able to determine the state of the tri-state button 101. On the basis of ensuring that the control circuit 102 detects the state of the tri-state button 101, the safety performance of the electronic device 10 and the vehicle in which it is located is guaranteed.
[0057] At the same time, in the electronic device 10 provided in this embodiment, the control circuit 102 determines the state of the tri-state button 101 according to the third voltage V5. Figure 1 Compared with the prior art shown in which the state of the three-state button 101 is determined directly based on the voltage of the three-state button 101, the basic judgment logic is the same, so there is no need to make major changes to the existing design of the control circuit 102, and the difficulty of applying the embodiment of the present application is reduced, which is more conducive to the use and promotion of the embodiment of the present application.
[0058] The following describes the specific circuit structures of the voltage acquisition unit 1001, the voltage comparison unit 1002, and the voltage conversion unit 1003 in the tri-state key detection circuit 101 provided by the present application in conjunction with the accompanying drawings. Figure 4 This is a circuit diagram of an embodiment of a voltage acquisition unit and a voltage comparison unit provided by the present application. Figure 5 This is a schematic diagram of the circuit structure of an embodiment of a voltage conversion unit provided in this application.
[0059] like Figure 4 As shown, the voltage acquisition unit 1001 includes: a fourth resistor R4, a fifth resistor R5, and a sixth resistor R6. The first end of the fourth resistor R4 is connected to the first voltage source and can be used to receive the first voltage V1. The second end of the fourth resistor R4 is connected to the positive input terminal of the first comparator U1A, the negative input terminal of the second comparator U2B, the first end of the fifth resistor R5, and the first end of the sixth resistor R6 in the voltage comparison unit 1002. The second end of the fifth resistor R5 is connected to the fixed terminal 0 of the three-state button 101, and the second end of the sixth resistor R6 is grounded. At the same time, the first free end 1 of the three-state button 101 is connected to the first voltage source, the second free end 2 of the three-state button 101 is grounded, and the third free end 3 of the three-state button 101 is left floating.
[0060] In one embodiment, the resistance of the fourth resistor R4 is 100k, the resistance of the fifth resistor R5 is 1K, and the resistance of the sixth resistor R6 is 100k.
[0061] In such Figure 4 As shown, the voltage comparison unit 1002 includes: a first comparator U1A and a second comparator U1B. The positive input of the first comparator U1A is connected to the voltage acquisition unit 101 and can be used to receive the second voltage V2. The negative input of the first comparator U1A can be used to receive the first preset voltage Vref1. The output of the first comparator U1A is connected to the voltage conversion unit 1003 and can be used to output the first signal V3. The positive input of the second comparator U1B can be used to receive the second preset voltage Vref2. The negative input of the second comparator U1B is connected to the voltage conversion unit 1001 and can be used to receive the second voltage V2. The output of the second comparator U1B is connected to the voltage conversion unit 1003 and can be used to output the second signal V4.
[0062] In one embodiment, if Figure 4 The voltage comparison unit 1002 shown can obtain a first preset voltage and a second preset voltage sent by other circuits in the electronic device 10 .
[0063] In another embodiment, Figure 4 The voltage comparison unit 1002 shown may further include a preset voltage generating unit for receiving a first voltage V1 provided by a first voltage source and providing a first preset voltage Vref1 to the first comparator U1A according to the first voltage V1, and providing a second preset voltage Vref2 to the second comparator U1B according to the first voltage V1.
[0064] like Figure 4 The preset voltage generating unit shown includes: a first resistor R1, a second resistor R2, and a third resistor R3. The first end of the first resistor R1 is connected to a first voltage source and is configured to receive a first voltage V1. The second end of the first resistor R1 is connected to the negative input of the first comparator U1A and the first end of the second resistor R2. The second end of the second resistor R2 is connected to the positive input of the second comparator U1B and the first end of the third resistor R3. The second end of the third resistor R3 is grounded.
[0065] Specifically, when the first voltage V1 is 12V, the first voltage V1 is divided by the first resistor R1, the second resistor R2, and the third resistor R3 to generate a first preset voltage Vref1 of 8V and a second preset voltage Vref2 of 4V.
[0066] In one embodiment, the resistance of the first resistor R1 is 100k, the resistance of the second resistor R2 is 100k, and the resistance of the third resistor R3 is 100k.
[0067] In one embodiment, the voltage comparison unit 1002 further includes a first feedback resistor R11 and a second feedback resistor R12, wherein a first end of the first feedback resistor R11 is connected to the output end of the first comparator U1A, a first end of the second feedback resistor R12 is connected to the output end of the second comparator U1B, a second end of the first feedback resistor R11 is connected to the second end of the second feedback resistor R12, the positive power supply pin 8 of the first comparator U1A, and the positive power supply pin 8 of the second comparator U1B, and the negative power supply pin 4 of the first comparator U1A and the negative power supply pin 4 of the second comparator U1B are grounded. In one embodiment, the resistance of the first feedback resistor R11 is 10k, and the resistance of the second feedback resistor R12 is 10k.
[0068] like Figure 5 As shown, the voltage conversion unit 1003 includes: a first switch Q1, a second switch Q2, a seventh resistor R7, an eighth resistor R8, a ninth resistor R9, and a tenth resistor R10. The first end of the seventh resistor R7 is connected to the second voltage source and can be used to receive the fourth voltage V6 provided by the second voltage source. The second end of the seventh resistor R7 is connected to the control circuit 103 and the first end of the eighth resistor R8. The second end of the eighth resistor R8 is connected to the first end of the first switch Q1 and the first end of the ninth resistor R9. The second end of the ninth resistor R9 is connected to the first end of the second switch Q2 and the first end of the tenth resistor R10. The second end of the tenth resistor R10, the second end of the first switch Q1, and the second end of the second switch Q2 are grounded. The control end of the first switch Q1 can be used to receive the first signal V3, and the control end of the second switch Q2 can be used to receive the second signal V4.
[0069] In one embodiment, the first switch Q1 is an N-type MOS transistor, and the second switch Q2 is an N-type MOS transistor.
[0070] In one embodiment, the fourth voltage V6 is lower than the first voltage V1. For example, the first voltage V1 is 12V or 24V, and the fourth voltage V6 is 3.3V or 5V.
[0071] In one embodiment, the resistance of the seventh resistor R7 is 22k, the resistance of the eighth resistor R8 is 10k, the resistance of the ninth resistor R9 is 22k, and the resistance of the tenth resistor R10 is 100k.
[0072] In one embodiment, a voltmeter V may be further provided in the voltage conversion unit 1003 , wherein a positive electrode of the voltmeter V is connected to the second end of the seventh resistor R7 , and a negative electrode of the voltmeter V is grounded. The voltmeter V may be used to detect the voltage value of the third voltage V5 provided by the voltage conversion unit 1003 to the control circuit 103 .
[0073] In one embodiment, the number of switches and resistors in the voltage conversion circuit 1003 can be increased or decreased as needed to achieve a wider range of voltage selection outputs. The specific implementation method and principle are the same and will not be repeated here.
[0074] More specifically, if Figure 4 and Figure 5 The tri-state button detection circuit 100 shown also presents three corresponding circuit states according to the three states of the tri-state button 101, which are described below respectively.
[0075] When the tri-state key 101 is in the first state SW1, the fixed terminal 0 and the first free terminal 1 are conductive, and the voltage acquisition unit 1001 generates a second voltage V2 of 12V. At this point, the voltage at the positive input of the first comparator U1A in the voltage comparison unit 1002 is 12V, which is greater than the first preset voltage Vre1 at the negative input. The first signal V3 output by the first comparator U1A is a high-level signal. The voltage at the negative input of the second comparator U1A is 12V, which is greater than the second preset voltage Vref2 at the positive input. The second signal V4 output by the second comparator U1B is a low-level signal. The first switch Q1 in the voltage conversion circuit 1003 is turned on by the high-level signal, and the second switch Q2 is turned off by the low-level signal. The fourth voltage V6 is divided by the seventh resistor R7 and the eighth resistor R8 to obtain a third voltage V5 of 1.03V.
[0076] When the tri-state key 101 is in the second state SW2, the fixed terminal 0 and the second free terminal 2 are conductive, and the second voltage V2 generated by the voltage acquisition unit 1001 is 0V. At this time, the voltage at the positive input terminal of the first comparator U1A in the voltage comparison unit 1002 is 0V, which is less than the first preset voltage Vre1 at the negative input terminal. The first signal V3 output by the first comparator U1A is low. The voltage at the negative input terminal of the second comparator U1A is 0V, which is less than the second preset voltage Vref2 at the positive input terminal. The second signal V4 output by the second comparator U1B is high. The first switch Q1 in the voltage conversion circuit 1003 is turned off in response to the low-level signal, and the second switch Q2 is turned on in response to the high-level signal. The fourth voltage V6 is divided by the seventh resistor R7, the eighth resistor R8, and the ninth resistor R9 to obtain a third voltage V5 of 1.96V.
[0077] When the tri-state key 101 is in the third state SW3, the fixed terminal 0 and the third free terminal 3 are conductively connected. The voltage acquisition unit 1001 generates a second voltage V2 of 6V based on the voltage division of the first voltage V1 by the first resistor R1 and the third resistor R3. At this time, the voltage at the positive input terminal of the first comparator U1A in the voltage comparison unit 1002 is 6V, which is less than the first preset voltage Vre1 at the negative input terminal. The first signal V3 output by the first comparator U1A is low. The voltage at the negative input terminal of the second comparator U1A is 6V, which is greater than the second preset voltage Vref2 at the positive input terminal. The second signal V4 output by the second comparator U1B is low. The first switch Q1 in the voltage conversion circuit 1003 is turned off in response to the low-level signal, and the second switch Q2 is turned off in response to the low-level signal. The fourth voltage V6 is divided by the seventh resistor R7, the eighth resistor R8, the ninth resistor R9, and the tenth resistor R10 to obtain a third voltage V5 of 2.83V.
[0078] The control circuit 103 can determine the state of the tri-state button 101 based on the received voltage value of the third voltage V5. For example, when the voltage value of the third voltage V5 is 1.03V, the tri-state button 101 is determined to be in the first state SW1; when the voltage value of the third voltage V5 is 1.96V, the tri-state button 101 is determined to be in the second state SW2; and when the voltage value of the third voltage V5 is 2.83V, the tri-state button 101 is determined to be in the third state SW3.
[0079] Therefore, the voltage comparison unit 1002 provided in this embodiment can generate the third voltage V5 according to the state of the tri-state button 101, so that the control circuit 102 determines the state of the tri-state button 101 according to the third voltage. The voltage comparison unit 102 provided in this embodiment has a relatively simple structure, has little impact on the entire electronic device 10, is more convenient to implement, and can be implemented using common components such as comparators, switches, and resistors, thereby reducing costs.
[0080] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A three-state key detection circuit, characterized in that: include: a voltage acquisition unit connected to the tri-state button, the first voltage source, and the voltage comparison unit, and configured to acquire a first voltage provided by the first voltage source and provide a second voltage to the voltage comparison unit according to the state of the tri-state button; The voltage comparison unit is connected to the voltage acquisition unit and the voltage conversion unit, and is configured to provide a first signal to the voltage conversion unit according to a magnitude relationship between the second voltage and the first preset voltage, and to provide a second signal to the voltage conversion unit according to a magnitude relationship between the second voltage and the second preset voltage; The voltage conversion unit is connected to the voltage comparison unit and the control circuit, and is configured to provide a third voltage to the control circuit according to the first signal and the second signal, so that the control circuit determines the state of the tri-state button according to the third voltage.
2. The tri-state key detection circuit according to claim 1, wherein: The voltage comparison unit includes: a first comparator, having a positive input terminal connected to the voltage acquisition unit and configured to acquire the second voltage, a negative input terminal configured to acquire the first preset voltage, and an output terminal connected to the voltage conversion unit and configured to output the first signal; The second comparator has a positive input terminal configured to obtain the second preset voltage, a negative input terminal connected to the voltage conversion unit, configured to obtain the second voltage, and an output terminal connected to the voltage conversion circuit, configured to output the second signal.
3. The tri-state key detection circuit according to claim 2, characterized in that: The voltage comparison unit further includes: a preset voltage generation unit configured to obtain the first voltage, and provide the first preset voltage to the first comparator according to the first voltage, and provide the second preset voltage to the second comparator.
4. The tri-state key detection circuit according to claim 3, characterized in that: The preset voltage generating unit includes: a first resistor, a second resistor and a third resistor; The first end of the first resistor is connected to the first voltage source, the second end of the first resistor is connected to the negative input end of the first comparator and the first end of the second resistor, the second end of the second resistor is connected to the positive input end of the second comparator and the first end of the third resistor, and the second end of the third resistor is grounded.
5. The tri-state key detection circuit according to any one of claims 2 to 4, characterized in that: The voltage acquisition unit includes: a fourth resistor, a fifth resistor and a sixth resistor; The first end of the fourth resistor is connected to the first voltage source, the second end of the fourth resistor is connected to the positive input end of the first comparator, the negative input end of the second comparator, the first end of the fifth resistor and the first end of the sixth resistor, the second end of the fifth resistor is connected to the fixed end of the three-state button, the second end of the sixth resistor is grounded, the first free end of the three-state button is connected to the first voltage source, the second free end of the three-state button is grounded, and the third free end of the three-state button is left floating.
6. The tri-state key detection circuit according to claim 1, wherein: The voltage conversion unit includes: a first switch, a second switch, a seventh resistor, an eighth resistor, a ninth resistor and a tenth resistor; A first end of the seventh resistor is connected to a second voltage source and is configured to obtain a fourth voltage provided by the second voltage source. A second end of the seventh resistor is connected to the control circuit and the first end of the eighth resistor. A second end of the eighth resistor is connected to the first end of the first switch and the first end of the ninth resistor. A second end of the ninth resistor is connected to the first end of the second switch and the first end of the tenth resistor. The second end of the tenth resistor, the second end of the first switch, and the second end of the second switch are grounded. The control end of the first switch is configured to obtain the first signal, and the control end of the second switch is configured to obtain the second signal.
7. The tri-state key detection circuit according to claim 6, characterized in that: The first switch and the second switch are N-type MOS transistors.
8. The tri-state key detection circuit according to claim 6 or 7, characterized in that: The fourth voltage is lower than the first voltage.
9. An electronic device, characterized in that: include: Tri-state button; The tri-state button detection circuit according to any one of claims 1 to 8, configured to provide the third voltage to the control circuit according to the state of the tri-state button; The control circuit is configured to determine the state of the tri-state button according to the third voltage.
10. An automobile, characterized in that: Comprising the electronic device as claimed in claim 9.