A multi-button wake-up circuit and method for hand controller

By using microcontrollers, matrix key circuits and microcontroller wake-up circuits in the manual controller, the problems of large number of wire cores and high processing costs caused by multiple key wake-up circuits in the manual controller are solved, and more efficient key counts and lower processing costs are achieved.

CN112835317BActive Publication Date: 2025-04-01ZHEJIANG JIECHANG LINEAR MOTION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110047564.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-14
Publication Date
2025-04-01
Estimated Expiration
2041-01-14

AI Technical Summary

Technical Problem

The multi-key wake-up circuit in existing manual controllers leads to a large number of wire cores, complex structures and high processing costs.

Method used

A single-chip microcontroller, matrix key circuit and a single-chip microcontroller wake-up circuit are used. By setting a button circuit between each two main circuits, the number of wire cores is reduced and the number of keys is increased.

Benefits of technology

Under the condition that the number of online cores is the same, the number of buttons is increased, the number of wire cores is reduced, and the processing cost is reduced. In addition, the microcontroller can be awakened when any button is pressed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112835317B_ABST
    Figure CN112835317B_ABST
Patent Text Reader

Abstract

The present invention provides a multi-button wake-up circuit and method for a hand controller, belonging to the field of hand controllers. The multi-button wake-up circuit includes a single-chip microcomputer, a matrix button circuit and a single-chip microcomputer wake-up circuit. The matrix button circuit includes a main circuit and a button circuit. The single-chip microcomputer wake-up circuit includes a PNP transistor Q1. The PNP transistor Q1 is used as a switch to control the on-off between a battery and a single-chip microcomputer. The matrix button circuit is connected to the PNP transistor Q1. When a button in the button circuit is pressed, the matrix button circuit controls the PNP transistor Q1 to turn on, thereby controlling the battery and the single-chip microcomputer to turn on and wake up the single-chip microcomputer. The advantage of the present invention is that the use of this structure can reduce the wire core, reduce the processing cost, and can control the single-chip microcomputer wake-up by pressing a button. The present invention is used to realize the key wake-up of the single-chip microcomputer in the hand controller.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The invention relates to a multi-button wake-up circuit and method for a hand controller, belonging to the field of hand controllers. [Background technology]

[0002] Usually, equipment such as lifting tables, kitchen islands, and folding beds are equipped with hand controllers. The hand controllers are provided with multiple buttons for controlling different functions. Usually, one button corresponds to one hand controller wire core. When multiple buttons are provided, the hand controller wire cores are more, resulting in a complex structure of the hand controller and a high processing cost.

[0003] In order to reduce the number of wire cores of the hand controller, a row-column matrix circuit is usually used to connect the wire cores, so that the wire cores can be reduced. For example, M wires and N wires are used to form an M*N matrix, and the buttons are located at the intersection of the M*N matrix. At this time, the number of wire cores is M+N, and the number of buttons is M*N, so the number of buttons can be reduced. However, with this matrix, the number of wire cores is still large and the processing cost is still high. [Summary of the invention]

[0004] The technical problem to be solved by the present invention is to provide a multi-button wake-up circuit for a hand controller, so that the wire cores can be reduced and the processing cost can be reduced.

[0005] In order to solve the above technical problems, the multi-button wake-up circuit for a hand controller of the present invention comprises a single-chip microcomputer, a matrix button circuit and a single-chip microcomputer wake-up circuit;

[0006] The matrix key circuit comprises a main circuit and a key circuit, one end of the main circuit is connected to a power supply Vcc, and the other end is grounded, the main circuit has at least two, the at least two main circuits comprise a main circuit A and a main circuit B, the main circuit A and the main circuit B are any two main circuits of the at least two main circuits, and the key circuit is connected between the main circuit A and the main circuit B;

[0007] The key circuit is a loop and includes a key K1, a diode D1, a key K2 and a diode D2 which are arranged in sequence, the main circuit A is connected to the circuit between the key K1 and the diode D1, and the anode of the diode D1 is connected to the main circuit A, the main circuit B is connected to the circuit between the key K2 and the diode D2, and the anode of the diode D2 is connected to the main circuit B;

[0008] The single-chip microcomputer wake-up circuit includes a PNP transistor Q1, the emitter and base of the PNP transistor Q1 are used to be connected to the battery, and the collector is connected to the single-chip microcomputer. A resistor R12 is provided between the emitter and the base of the PNP transistor Q1. The circuit between the button K1 and the diode D2 and the circuit between the button K2 and the diode D2 in the button circuit are both connected to the base of the PNP transistor Q1.

[0009] Preferably, the single-chip microcomputer wake-up circuit also includes an NPN transistor Q2, the emitter of the NPN transistor Q2 is grounded, the collector is connected to the base of the PNP transistor Q1, and the base is connected to the single-chip microcomputer. The single-chip microcomputer is connected to the matrix key circuit to detect whether a key in the key circuit is pressed. When the single-chip microcomputer detects that a key is pressed, the single-chip microcomputer controls the base of the NPN transistor Q2 to be in a high level state.

[0010] Preferably, the main circuit A is provided with a resistor R2, a diode D7 and a resistor R1 in sequence from the power supply Vcc end to the ground end, and the main circuit B is provided with a resistor R3, a diode D8 and a resistor R4 in sequence from the power supply Vcc end to the ground end;

[0011] The anode of the diode D7 is connected to the resistor R2, the anode of the diode D8 is connected to the resistor R3, the circuit between the diode D7 and the resistor R1 in the main circuit A is connected to the key circuit, and the circuit between the diode D8 and the resistor R4 in the main circuit B is connected to the key circuit.

[0012] Preferably, the main circuit A is provided with a port JZ_1 for the single-chip microcomputer to detect, and the main circuit B is provided with a port JZ_2 for the single-chip microcomputer to detect, the port JZ_1 is connected to the circuit between the diode D7 and the resistor R1, and the port JZ_2 is connected to the circuit between the diode D8 and the resistor R4.

[0013] Preferably, both the main circuit A and the main circuit B are provided with pull-up resistors. In the main circuit A, one end of the pull-up resistor is connected to the port JZ_1, and the other end is connected to the circuit between the diode D7 and the resistor R1. In the main circuit B, one end of the pull-up resistor is connected to the port JZ_2, and the other end is connected to the circuit between the diode D8 and the resistor R4.

[0014] Preferably, when the single chip microcomputer detects whether a key is pressed, the sum of the voltage division value of the pull-up resistor and the voltage drop of a diode is a low level, and the sum of the voltage division value of the pull-up resistor and the voltage drop of at least two diodes is a high level.

[0015] Preferably, the single chip computer wake-up circuit further includes a resistor R13, a resistor R9, a diode D14, and a diode D11;

[0016] The resistor R13 and the diode D14 are located between the collector of the NPN transistor Q2 and the base of the PNP transistor Q1, and between the key circuit and the base of the PNP transistor Q1. The anode of the diode D14 is connected to the base of the PNP transistor Q1. The resistor R9 and the diode D11 are located between the diode D14 and the key circuit, and the cathode of the diode D11 is connected to the key circuit.

[0017] The present invention also discloses a multi-button wake-up method for a hand controller, comprising:

[0018] When a key in the matrix key circuit is pressed, the base of the PNP transistor Q1 is connected to the ground terminal in the main circuit, the PNP transistor Q1 is turned on, and the battery is connected to the single-chip microcomputer to wake up the single-chip microcomputer;

[0019] After the single chip is awakened, a key scanning method is used to detect whether a key in the matrix circuit is pressed and / or determine the key value of the pressed key. The key scanning method is:

[0020] First, the detection port JZ_2 on the main circuit B is set as the input detection port through the single-chip microcomputer, and the detection port JZ_1 on the main circuit A is set as the data output port, and JZ_1 is set to a low level, and the level state of JZ_2 is detected. If JZ_2 is at a low level, it is determined that the key K1 is pressed, and the detection is completed. Then, the detection port JZ_1 on the main circuit A is set as the input detection port, and the detection port JZ_2 on the main circuit B is set as the data output port, and JZ_2 is set to a low level, and the level state of JZ_1 is detected. If JZ_1 is at a low level, it is determined that the key K2 is pressed, and the main circuit A and / or the main circuit B are replaced with other main circuits. Repeat the above steps until the states of all the keys in the matrix key circuit are detected;

[0021] When the microcontroller detects that a button is pressed, the base of the NPN transistor Q2 is controlled to remain in a high level state, the NPN transistor Q2 is turned on, the base of the PNP transistor Q1 is connected to the ground terminal through the NPN transistor Q2, the PNP transistor Q1 is turned on continuously, and the battery continues to power the microcontroller.

[0022] Preferably, the multi-key wake-up method includes a combination key wake-up method, and the combination key wake-up method includes:

[0023] The single-chip microcomputer determines which key in the matrix circuit is pressed by the key scanning method. When only a single key is detected to be pressed, the single-chip microcomputer controls the NPN transistor Q2 to be cut off. When multiple keys are detected to be pressed, it determines whether the multiple keys pressed are the set multiple keys by key value comparison. If the multiple keys pressed are not the set multiple keys, the single-chip microcomputer controls the NPN transistor Q2 to be cut off. If the multiple keys pressed are the set multiple keys, the single-chip microcomputer controls the NPN transistor Q2 to be turned on.

[0024] Preferably, the matrix key circuit has at least three main circuits, each of the at least three main circuits is provided with a pull-up resistor, the sum of the voltage division value of the pull-up resistor and the voltage drop of a diode is a low level, and when the sum of the voltage division value of the pull-up resistor and the voltage drop of at least two diodes is a high level, the combination key wake-up method further includes a false touch detection method, and the false touch detection method includes:

[0025] The single-chip microcomputer first sets the detection port on one of the main circuits as the input detection port, sets the detection port on the other main circuits as the data output port, sets the input detection port to a low level, and detects the level state of the data output port. If the data output port is at a low level, it is determined that a single key is pressed, and the single-chip microcomputer determines the key value of the pressed key. If the data output port is at a high level, it is determined that multiple keys are pressed, and the single-chip microcomputer gives up determining the key value of the pressed key.

[0026] Set the detection port on another main circuit as the input detection port, and set the detection port on other main circuits as the data output port. Repeat the above steps. When the detection ports on all main circuits in the matrix key circuit have been set as input detection ports once, the detection is completed.

[0027] Beneficial effects of the present invention:

[0028] Firstly, by adopting this matrix key circuit, a key circuit can be set between every two main circuits, that is, two keys can be set between every two wire cores, and M wire cores can be used to set M*(M-1) keys. Compared with the solutions in the prior art, this solution can set more keys under the condition of the same wire cores, especially for the scenario with more wire cores, so that under the condition of the same button requirements, this solution can reduce the wire cores and reduce the processing cost compared with the prior art.

[0029] Secondly, when one button is pressed or multiple buttons are pressed together, the PNP transistor Q1 can be turned on, so that the microcontroller can be connected to the battery to wake up. At the same time, in this scheme, when any button in the matrix button circuit is pressed, the PNP transistor Q1 can be turned on, so that any button in the matrix button circuit can wake up the microcontroller.

[0030] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and drawings.

Brief Description of the Drawings

[0031] The present invention is further described in detail below with reference to the accompanying drawings, in which:

[0032] Figure 1 Schematic diagram of the multi-button wake-up circuit of the present invention. [Specific implementation method]

[0033] The technical solutions of the embodiments of the present invention are explained and described below in conjunction with the drawings of the embodiments of the present invention, but the following embodiments are only preferred embodiments of the present invention, not all. Based on the embodiments in the implementation mode, other embodiments obtained by those skilled in the art without creative work are all within the protection scope of the present invention.

[0034] In the following description, terms such as "inside", "outside", "up", "down", "left", "right", etc. that indicate orientation or position relationship are based on the orientation or position relationship shown in the drawings and are only for the convenience of describing the embodiments and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore should not be understood as limiting the present invention.

[0035] like Figure 1 As shown, the preferred structure of the multi-button wake-up circuit for the hand controller in this embodiment includes a single-chip microcomputer, a matrix button circuit and a single-chip microcomputer wake-up circuit;

[0036] The matrix key circuit comprises a main circuit and a key circuit, one end of the main circuit is connected to a power supply Vcc, and the other end is grounded, the main circuit has at least two, the at least two main circuits comprise a main circuit A and a main circuit B, the main circuit A and the main circuit B are any two main circuits of the at least two main circuits, and the key circuit is connected between the main circuit A and the main circuit B;

[0037] The key circuit is a loop and includes a key K1, a diode D1, a key K2 and a diode D2 which are arranged in sequence, the main circuit A is connected to the circuit between the key K1 and the diode D1, and the anode of the diode D1 is connected to the main circuit A, the main circuit B is connected to the circuit between the key K2 and the diode D2, and the anode of the diode D2 is connected to the main circuit B;

[0038] The single-chip microcomputer wake-up circuit includes a PNP transistor Q1, the emitter and base of the PNP transistor Q1 are used to be connected to the battery, and the collector is connected to the single-chip microcomputer. A resistor R12 is provided between the emitter and the base of the PNP transistor Q1. The circuit between the button K1 and the diode D2 and the circuit between the button K2 and the diode D2 in the button circuit are both connected to the base of the PNP transistor Q1.

[0039] Beneficial effects of the present invention:

[0040] Firstly, by adopting this matrix key circuit, a key circuit can be set between every two main circuits, that is, two keys can be set between every two wire cores, and M wire cores can be used to set M*(M-1) keys. Compared with the solutions in the prior art, this solution can set more keys under the condition of the same wire cores, especially for the scenario with more wire cores, so that under the condition of the same button requirements, this solution can reduce the wire cores and reduce the processing cost compared with the prior art.

[0041] Secondly, when one button is pressed or multiple buttons are pressed together, the PNP transistor Q1 can be turned on, so that the microcontroller can be connected to the battery to wake up. At the same time, in this scheme, when any button in the matrix button circuit is pressed, the PNP transistor Q1 can be turned on, so that any button in the matrix button circuit can wake up the microcontroller.

[0042] Among them, when any button in the matrix key circuit is pressed, the base of the PNP transistor Q1 can be connected to the ground terminal of the main circuit, so that the current flows from the battery through the resistor R12, the base of the PNP transistor Q1 and the key circuit to the ground terminal of the main circuit, so that current flows through the base of the PNP transistor Q1 and divides the voltage through the resistor R12, so that the base voltage of the PNP transistor Q1 is less than the emitter voltage, thereby turning on the PNP transistor Q1.

[0043] In addition, this embodiment takes three main circuits as an example, as shown in the figure, in the main circuit A, the main circuit B and the main circuit C, a key circuit is provided between every two main circuits to form six keys, and a resistor R6, a diode D9 and a resistor R5 are provided on the main circuit C. The key circuit between the main circuit A and the main circuit C includes a key K3, a diode D3, a key K4 and a diode D4, and the key circuit between the main circuit B and the main circuit C includes a key K5, a diode D5, a key K6 and a diode D6. A resistor R10 and a diode D12 are provided between the key circuit between the main circuit A and the main circuit C and the PNP transistor Q1, a resistor R11 and a diode D13 are provided between the key circuit between the main circuit B and the main circuit C and the PNP transistor Q1, and a port JZ_3 is provided on the main circuit C.

[0044] In order to enable the battery to continuously supply power to the single-chip microcomputer, in this embodiment, the single-chip microcomputer wake-up circuit preferably also includes an NPN transistor Q2, the emitter of the NPN transistor Q2 is grounded, the collector is connected to the base of the PNP transistor Q1, and the base is connected to the single-chip microcomputer. The single-chip microcomputer is connected to the matrix key circuit to detect whether a key in the key circuit is pressed. When the single-chip microcomputer detects that a key is pressed, the single-chip microcomputer controls the base of the NPN transistor Q2 to be in a high level state. The single-chip microcomputer detects whether the key is pressed. When it is detected that the key is pressed, the base of the NPN transistor Q2 is controlled to be continuously turned on, so that the base of the PNP transistor Q1 can be grounded through the NPN transistor Q2, and then the PNP transistor Q1 can be continuously turned on, so that the battery can continuously supply power to the single-chip microcomputer.

[0045] In order to optimize the main circuit, in this embodiment, the main circuit A is preferably provided with a resistor R2, a diode D7 and a resistor R1 in sequence from the power supply Vcc end to the ground end, and the main circuit B is preferably provided with a resistor R3, a diode D8 and a resistor R4 in sequence from the power supply Vcc end to the ground end;

[0046] The anode of the diode D7 is connected to the resistor R2, the anode of the diode D8 is connected to the resistor R3, the circuit between the diode D7 and the resistor R1 in the main circuit A is connected to the key circuit, and the circuit between the diode D8 and the resistor R4 in the main circuit B is connected to the key circuit. The voltage is divided by the resistors R2 and R1, and the resistors R3 and R4 to ensure that the circuit is unobstructed and prevent short circuits. The diodes D7 and D8 can prevent the current from flowing in reverse, causing the circuit to fail to function normally.

[0047] In order to enable the single-chip microcomputer to detect whether a key in the key circuit is pressed, in this embodiment, the main circuit A is preferably provided with a port JZ_1 for the single-chip microcomputer to detect, and the main circuit B is provided with a port JZ_2 for the single-chip microcomputer to detect, the port JZ_1 is connected to the circuit between the diode D7 and the resistor R1, and the port JZ_2 is connected to the circuit between the diode D8 and the resistor R4. By controlling the port JZ_1 and the port JZ_2 to continuously change between the output and input states, the single-chip microcomputer can determine which key circuit is turned on by detecting the level state of the input port, and then determine which key is pressed.

[0048] In order to prevent multiple keys from being accidentally touched, in this embodiment, pull-up resistors are preferably provided in both the main circuit A and the main circuit B. In the main circuit A, one end of the pull-up resistor is connected to the port JZ_1, and the other end is connected to the circuit between the diode D7 and the resistor R1. In the main circuit B, one end of the pull-up resistor is connected to the port JZ_2, and the other end is connected to the circuit between the diode D8 and the resistor R4. As shown in the figure, when the number of main circuits is equal to or greater than three, false touches will occur. For example, when the detection port JZ_3 on the main circuit C is set as an input detection port, the detection port JZ_1 on the main circuit A and the detection port JZ_2 on the main circuit A are set as data output ports, JZ_3 is set to a low level, and the level states of JZ_1 and JZ_2 are detected. When JZ_2 is at a low level, it should be determined that the key K6 is pressed. However, if the keys K1 and K4 are pressed at the same time, the detection port JZ_2 will also become a low level, resulting in an inability to determine whether the keys K1 and K4 are pressed at the same time. , or the button K6 is pressed. In this embodiment, the pull-up resistor in the main circuit A is R15, the pull-up resistor in the main circuit B is R16, and the pull-up resistor in the main circuit C is R17. By setting the pull-up resistor R17, the power supply end of the main circuit C can flow to JZ_3 through R6, D9 and R17, so that the resistor R17 can divide the voltage. Since the current needs to pass through two diodes when it flows from the power supply end of the main circuit B through R3, D8, D2, K1, D3, K4 and R17 to JZ_3, there will be 1. When the current flows from the power supply end of the main circuit B through R3, D8, D5, K6 and R17 to JZ_3, it only needs to pass through one diode, with a voltage drop of only about 0.7V. By judging the voltage value detected by the detection port JZ_2, it is judged whether one key is pressed or two or more keys are pressed, so that false touch prevention can be achieved. The pull-up resistor R17 can increase the voltage so that the microcontroller can detect the voltage value, and then the microcontroller can judge whether a false touch occurs.

[0049] In order to further optimize the resistor R17, in this embodiment, when the single-chip microcomputer detects whether a button is pressed, the sum of the voltage division value of the pull-up resistor and the voltage drop of a diode is a low level, and the sum of the voltage division value of the pull-up resistor and the voltage drop of at least two diodes is a high level. Since there is a critical value when the single-chip microcomputer determines the high and low levels, when the detected voltage is higher than the critical value, the single-chip microcomputer determines it as a high level, and when the detected voltage is lower than the critical value, the single-chip microcomputer determines it as a low level. By controlling the resistance value of the pull-up resistor, the sum of the voltage division value of the pull-up resistor and the voltage drop of a diode is a low level, and the sum of the voltage division value of the pull-up resistor and the voltage drop of at least two diodes is a high level. Therefore, when a button is pressed, the single-chip microcomputer can display a low level, and when two or more buttons are pressed, the single-chip microcomputer can display a high level, thereby making it possible to determine whether a button is pressed by the low level of the single-chip microcomputer, and to prevent false touches, making the determination more convenient.

[0050] In order to optimize the single-chip wake-up circuit, the single-chip wake-up circuit in this embodiment preferably further includes a resistor R13, a resistor R9, a diode D14, and a diode D11;

[0051] The resistor R13 and the diode D14 are located between the collector of the NPN transistor Q2 and the base of the PNP transistor Q1, and between the key circuit and the base of the PNP transistor Q1. The anode of the diode D14 is connected to the base of the PNP transistor Q1. The resistor R9 and the diode D11 are located between the diode D14 and the key circuit, and the cathode of the diode D11 is connected to the key circuit. The voltage is divided by the resistor R13 and the resistor R9, and the current flow is limited by the diode D14 and the diode D11, so that the circuit can operate normally.

[0052] Embodiment 2:

[0053] This embodiment discloses a multi-button wake-up method for a hand controller, including:

[0054] When a key in the matrix key circuit is pressed, the base of the PNP transistor Q1 is connected to the ground terminal in the main circuit, the PNP transistor Q1 is turned on, and the battery is connected to the single-chip microcomputer to wake up the single-chip microcomputer;

[0055] After the single chip is awakened, a key scanning method is used to detect whether a key in the matrix circuit is pressed and / or determine the key value of the pressed key. The key scanning method is:

[0056] First, the detection port JZ_2 on the main circuit B is set as the input detection port through the single-chip microcomputer, and the detection port JZ_1 on the main circuit A is set as the data output port, and JZ_1 is set to a low level, and the level state of JZ_2 is detected. If JZ_2 is at a low level, it is determined that the key K1 is pressed, and the detection is completed. Then, the detection port JZ_1 on the main circuit A is set as the input detection port, and the detection port JZ_2 on the main circuit B is set as the data output port, and JZ_2 is set to a low level, and the level state of JZ_1 is detected. If JZ_1 is at a low level, it is determined that the key K2 is pressed, and the main circuit A and / or the main circuit B are replaced with other main circuits. Repeat the above steps until the states of all the keys in the matrix key circuit are detected;

[0057] When the single-chip microcomputer detects that a key is pressed, the base of the NPN transistor Q2 is controlled to be continuously in a high level state, the NPN transistor Q2 is turned on, the base of the PNP transistor Q1 is connected to the ground terminal through the NPN transistor Q2, the PNP transistor Q1 is continuously turned on, and the battery continues to power the single-chip microcomputer. The above method can be used to enable the hand controller to be awakened by a key.

[0058] In order to enable the single-chip microcomputer to realize multiple key press wake-up, in this embodiment, the multi-key wake-up method preferably includes a combination key wake-up method, and the combination key wake-up method includes:

[0059] The single-chip microcomputer determines which key in the matrix circuit is pressed by the key scanning method. When only a single key is detected to be pressed, the single-chip microcomputer controls the NPN transistor Q2 to be cut off. When multiple keys are detected to be pressed, it determines whether the multiple keys pressed are the set multiple keys by key value comparison. If the multiple keys pressed are not the set multiple keys, the single-chip microcomputer controls the NPN transistor Q2 to be cut off. If the multiple keys pressed are the set multiple keys, the single-chip microcomputer controls the NPN transistor Q2 to be turned on.

[0060] When the single-chip microcomputer determines which key in the matrix circuit is pressed by the key scanning method, during the scanning judgment, one of the detection ports is set as the input detection port, and the detection ports in other main circuits are set as data output ports. Among them, one input detection port to one data output port can detect whether a key is pressed. After all the scans are completed, it can be detected how many keys are pressed. At this time, the single-chip microcomputer needs to make further judgments. When only one key is pressed, the single-chip microcomputer controls the NPN transistor Q2 to be turned off. When multiple keys are pressed, the single-chip microcomputer controls the NPN transistor Q2 to be turned on. Of course, any key When the key is pressed, the PNP transistor Q1 will be turned on, but as the key is released, the PNP transistor Q1 will be turned off and cannot be continuously turned on. The method is to control the PNP transistor Q1 to be continuously turned on, and the role of the pull-up resistor is to prevent false touches caused by pressing multiple keys at the same time when an input detection port is used to detect whether a key is pressed from a data output port to a data output port, rather than limiting the pressing of multiple keys. That is, one detection from an input detection port to a data output port can only detect one key, and when the keys are combined, multiple detections are performed and a collection of keys that pass each detection is detected, which does not conflict with the role of the pull-up resistor.

[0061] In order to prevent false touches when the combination key is awakened, in this embodiment, the matrix key circuit preferably has at least three main circuits, each of the at least three main circuits is provided with a pull-up resistor, and the sum of the voltage division value of the pull-up resistor and the voltage drop of a diode is a low level. When the sum of the voltage division value of the pull-up resistor and the voltage drop of at least two diodes is a high level, the combination key awakening method further includes a false touch detection method, and the false touch detection method includes:

[0062] The single-chip microcomputer first sets the detection port on one of the main circuits as the input detection port, sets the detection port on the other main circuits as the data output port, sets the input detection port to a low level, and detects the level state of the data output port. If the data output port is at a low level, it is determined that a single key is pressed, and the single-chip microcomputer determines the key value of the pressed key. If the data output port is at a high level, it is determined that multiple keys are pressed, and the single-chip microcomputer gives up determining the key value of the pressed key.

[0063] Set the detection port on another main circuit as the input detection port, and set the detection port on other main circuits as the data output port. Repeat the above steps. When the detection ports on all main circuits in the matrix key circuit have been set as input detection ports once, the detection is completed.

[0064] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes but is not limited to the contents described in the drawings and the above specific embodiments. Any modification that does not deviate from the functional and structural principles of the present invention will be included in the scope of the claims.

Claims

1. A multi-button wake-up circuit for a hand controller, characterized in that: Including single chip microcomputer, matrix key circuit and single chip microcomputer wake-up circuit; The matrix key circuit comprises a main circuit and a key circuit, one end of the main circuit is connected to a power supply Vcc, and the other end is grounded, the main circuit has at least two, the at least two main circuits comprise a main circuit A and a main circuit B, the main circuit A and the main circuit B are any two main circuits of the at least two main circuits, and the key circuit is connected between the main circuit A and the main circuit B; The key circuit is a loop and includes a key K1, a diode D1, a key K2 and a diode D2 which are arranged in sequence, the main circuit A is connected to the circuit between the key K1 and the diode D1, and the anode of the diode D1 is connected to the main circuit A, the main circuit B is connected to the circuit between the key K2 and the diode D2, and the anode of the diode D2 is connected to the main circuit B; The single-chip microcomputer wake-up circuit includes a PNP transistor Q1, the emitter and base of the PNP transistor Q1 are used to be connected to the battery, and the collector is connected to the single-chip microcomputer. A resistor R12 is provided between the emitter and the base of the PNP transistor Q1. The circuit between the button K1 and the diode D2 and the circuit between the button K2 and the diode D2 in the button circuit are both connected to the base of the PNP transistor Q1.

2. A multi-button wake-up circuit for a hand controller as claimed in claim 1, characterized in that: The single-chip microcomputer wake-up circuit also includes an NPN transistor Q2, the emitter of the NPN transistor Q2 is grounded, the collector is connected to the base of the PNP transistor Q1, and the base is connected to the single-chip microcomputer. The single-chip microcomputer is connected to the matrix key circuit to detect whether a key in the key circuit is pressed. When the single-chip microcomputer detects that a key is pressed, the single-chip microcomputer controls the base of the NPN transistor Q2 to be in a high level state.

3. A multi-button wake-up circuit for a hand controller as claimed in claim 2, characterized in that: The main circuit A is provided with a resistor R2, a diode D7 and a resistor R1 in sequence from the power supply Vcc end to the ground end, and the main circuit B is provided with a resistor R3, a diode D8 and a resistor R4 in sequence from the power supply Vcc end to the ground end; The anode of the diode D7 is connected to the resistor R2, the anode of the diode D8 is connected to the resistor R3, the circuit between the diode D7 and the resistor R1 in the main circuit A is connected to the key circuit, and the circuit between the diode D8 and the resistor R4 in the main circuit B is connected to the key circuit.

4. A multi-button wake-up circuit for a hand controller as claimed in claim 3, characterized in that: The main circuit A is provided with a port JZ_1 for the single chip microcomputer to detect, and the main circuit B is provided with a port JZ_2 for the single chip microcomputer to detect. The port JZ_1 is connected to the circuit between the diode D7 and the resistor R1, and the port JZ_2 is connected to the circuit between the diode D8 and the resistor R4.

5. A multi-button wake-up circuit for a hand controller as claimed in claim 4, characterized in that: Both the main circuit A and the main circuit B are provided with pull-up resistors. In the main circuit A, one end of the pull-up resistor is connected to the port JZ_1, and the other end is connected to the circuit between the diode D7 and the resistor R1. In the main circuit B, one end of the pull-up resistor is connected to the port JZ_2, and the other end is connected to the circuit between the diode D8 and the resistor R4.

6. A multi-button wake-up circuit for a hand controller as claimed in claim 5, characterized in that: When the single chip microcomputer detects whether a key is pressed, the sum of the voltage division value of the pull-up resistor and the voltage drop of a diode is a low level, and the sum of the voltage division value of the pull-up resistor and the voltage drop of at least two diodes is a high level.

7. A multi-button wake-up circuit for a hand controller as claimed in claim 2, characterized in that: The single chip wake-up circuit also includes a resistor R13, a resistor R9, a diode D14, and a diode D11; The resistor R13 and the diode D14 are located between the collector of the NPN transistor Q2 and the base of the PNP transistor Q1, and between the key circuit and the base of the PNP transistor Q1. The anode of the diode D14 is connected to the base of the PNP transistor Q1. The resistor R9 and the diode D11 are located between the diode D14 and the key circuit, and the cathode of the diode D11 is connected to the key circuit.

8. A multi-button wake-up method for a hand controller, applied to a multi-button wake-up circuit for a hand controller as claimed in any one of claims 1 to 7, characterized in that: include: When a key in the matrix key circuit is pressed, the base of the PNP transistor Q1 is connected to the ground terminal in the main circuit, the PNP transistor Q1 is turned on, and the battery is connected to the single-chip microcomputer to wake up the single-chip microcomputer; After the single chip is awakened, a key scanning method is used to detect whether a key in the matrix circuit is pressed and / or determine the key value of the pressed key. The key scanning method is: First, the detection port JZ_2 on the main circuit B is set as the input detection port through the single-chip microcomputer, and the detection port JZ_1 on the main circuit A is set as the data output port, and JZ_1 is set to a low level, and the level state of JZ_2 is detected. If JZ_2 is at a low level, it is determined that the key K1 is pressed, and the detection is completed. Then, the detection port JZ_1 on the main circuit A is set as the input detection port, and the detection port JZ_2 on the main circuit B is set as the data output port, and JZ_2 is set to a low level, and the level state of JZ_1 is detected. If JZ_1 is at a low level, it is determined that the key K2 is pressed, and the main circuit A and / or the main circuit B are replaced with other main circuits. Repeat the above steps until the states of all the keys in the matrix key circuit are detected; When the microcontroller detects that a button is pressed, the base of the NPN transistor Q2 is controlled to remain in a high level state, the NPN transistor Q2 is turned on, the base of the PNP transistor Q1 is connected to the ground terminal through the NPN transistor Q2, the PNP transistor Q1 is turned on continuously, and the battery continues to power the microcontroller.

9. A multi-button wake-up method for a hand controller as claimed in claim 8, characterized in that: The multi-key wake-up method includes a combination key wake-up method, and the combination key wake-up method includes: The single-chip microcomputer determines which key in the matrix circuit is pressed by the key scanning method. When only a single key is detected to be pressed, the single-chip microcomputer controls the NPN transistor Q2 to be cut off. When multiple keys are detected to be pressed, it determines whether the multiple keys pressed are the set multiple keys by key value comparison. If the multiple keys pressed are not the set multiple keys, the single-chip microcomputer controls the NPN transistor Q2 to be cut off. If the multiple keys pressed are the set multiple keys, the single-chip microcomputer controls the NPN transistor Q2 to be turned on.

10. A multi-button wake-up method for a hand controller as claimed in claim 9, characterized in that: The matrix key circuit has at least three main circuits, each of the at least three main circuits is provided with a pull-up resistor, the sum of the voltage division value of the pull-up resistor and the voltage drop of a diode is a low level, and when the sum of the voltage division value of the pull-up resistor and the voltage drop of at least two diodes is a high level, the combination key wake-up method also includes a false touch detection method, and the false touch detection method includes: The single-chip microcomputer first sets the detection port on one of the main circuits as the input detection port, sets the detection port on the other main circuits as the data output port, sets the input detection port to a low level, and detects the level state of the data output port. If the data output port is at a low level, it is determined that a single key is pressed, and the single-chip microcomputer determines the key value of the pressed key. If the data output port is at a high level, it is determined that multiple keys are pressed, and the single-chip microcomputer gives up determining the key value of the pressed key. Set the detection port on another main circuit as the input detection port, and set the detection port on other main circuits as the data output port. Repeat the above steps. When the detection ports on all main circuits in the matrix key circuit have been set as input detection ports once, the detection is completed.

Citation Information

Patent Citations

  • Multi-key wake-up circuit for hand controller

    CN214427780U