CN110806816A - Touch detection method, MCU, touch control equipment and storage medium - Google Patents

Touch detection method, MCU, touch control equipment and storage medium Download PDF

Info

Publication number
CN110806816A
CN110806816A CN201911046417.0A CN201911046417A CN110806816A CN 110806816 A CN110806816 A CN 110806816A CN 201911046417 A CN201911046417 A CN 201911046417A CN 110806816 A CN110806816 A CN 110806816A
Authority
CN
China
Prior art keywords
mcu
touch detection
touch
power consumption
consumption mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201911046417.0A
Other languages
Chinese (zh)
Inventor
王林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Goodix Technology Co Ltd
Original Assignee
Shenzhen Goodix Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Goodix Technology Co Ltd filed Critical Shenzhen Goodix Technology Co Ltd
Priority to CN201911046417.0A priority Critical patent/CN110806816A/en
Publication of CN110806816A publication Critical patent/CN110806816A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/0416Control or interface arrangements specially adapted for digitisers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3215Monitoring of peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3243Power saving in microcontroller unit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Power Sources (AREA)

Abstract

The application provides a touch detection method, an MCU, a touch device and a storage medium. The MCU is connected with the N touch keys through N channels, and the N channels correspond to the N touch keys one to one. The method comprises the following steps: the MCU acquires a low power consumption mode setting instruction. And the MCU enters a low power consumption mode according to the low power consumption mode setting instruction. And the MCU performs initial touch detection on at least one touch key in a low power consumption mode. Thereby the power consumption of the MCU can be reduced.

Description

Touch detection method, MCU, touch control equipment and storage medium
Technical Field
The present application relates to the field of touch technologies, and in particular, to a touch detection method, an MCU, a touch device, and a storage medium.
Background
Touch control equipment is frequently used in daily life of people at present, such as a gas stove, a touch control lamp and the like. Among these touch devices are: a Micro Control Unit (MCU) and a touch key, wherein a channel exists between the MCU and the touch key.
The principle that whether the MCU detects the finger pressing condition on the touch key is as follows: any touch key can be understood as a capacitor, the MCU can obtain a voltage Vout on a channel corresponding to the touch key through an Analog-to-Digital Converter (ADC), where when no finger presses on a touch key, the voltage Vout is generally 2048, where 2048 is a value after normalization processing according to the precision of the ADC, and the Vout is a reference voltage Base of the channel corresponding to the touch key. When a finger presses the touch key, a capacitance is formed between a human body and the ground, and the capacitance is connected with the touch key in series, so that the capacitance of the touch key is increased, and further, the voltage on the touch key is decreased within the same time, for example, the voltage is about Vout 1600. This 1600 is again the value after normalization processing according to the accuracy of the ADC. The MCU determines whether there is a finger pressing the touch key by calculating Delta-Base-Vout, for example: and when the Delta value is more than 200, the touch key is considered to be pressed by the finger.
However, as long as the MCU enters the working state, under any scenario, the MCU operates in the normal power consumption mode, such as: after the touch lamp is turned on, each channel is in a wake-up state (i.e., the ADC may collect voltage at a normal frequency for each channel). When a user only needs to control a certain lamp, each channel is still in an awakening state, which inevitably causes the problem of larger power consumption of the MCU.
Disclosure of Invention
The application provides a touch detection method, an MCU, a touch device and a storage medium. Thereby the power consumption of the MCU can be reduced.
In a first aspect, the present application provides a touch detection method, in which a micro control unit MCU is connected to N touch keys through N channels, the N channels are in one-to-one correspondence with the N touch keys, and N is an integer greater than or equal to 1, the method including: the MCU acquires a low power consumption mode setting instruction. And the MCU enters a low power consumption mode according to the low power consumption mode setting instruction. And the MCU performs initial touch detection on at least one touch key in a low power consumption mode. Thereby the power consumption of the MCU can be reduced.
Optionally, the MCU includes: the initial touch detection circuit, initial touch detection circuit are pure hardware circuit, and is corresponding, and MCU carries out initial touch detection to at least one touch button under low-power consumption mode, includes: the initial touch detection circuit performs initial touch detection on at least one touch key in a low power consumption mode. Because the initial touch detection circuit is a pure hardware circuit, that is, the initial touch detection circuit is not loaded with any software code to perform initial touch detection on the touch key, the detection efficiency of the method is higher compared with a software implementation mode. Furthermore, the initial touch detection is a coarse detection mode relative to the touch detection performed by the kernel, and therefore, the detection efficiency can be further improved.
Optionally, the MCU further comprises: the kernel, the kernel and the initial touch detection circuit are connected. Correspondingly, the initial touch detection circuit performs initial touch detection on at least one touch key in a low power consumption mode, and the initial touch detection circuit includes: aiming at any touch key in at least one touch key, the initial touch detection circuit carries out m times of initial touch detection on the touch key in a low power consumption mode, wherein m is an integer larger than 1. Correspondingly, after the initial touch detection circuit performs initial touch detection on at least one touch key in the low power consumption mode, the method further includes: for any touch key of the at least one touch key, if the initial touch detection circuit detects that the number of initial touch detections of the touch operation reaches n, the initial touch detection circuit controls the MCU to enter a normal power consumption mode, and the kernel further performs touch detection on the touch key in the normal power consumption mode. On one hand, if the initial touch detection circuit detects that the number of initial touch detections of touch operation reaches n, the initial touch detection circuit controls the MCU to enter the normal power consumption mode instead of controlling the MCU to enter the normal power consumption mode only when the initial touch detection circuit detects that the touch operation can be detected every time, so that the anti-shaking effect can be achieved. On the other hand, the accuracy of touch detection can be provided while the power consumption of the MCU is reduced.
Optionally, the initial touch detection circuit performs m times of initial touch detection on the touch key in the low power consumption mode, including: aiming at any initial touch detection, the initial touch detection circuit judges whether the voltage on the corresponding channel of the touch key is smaller than a first preset threshold value or not in a low power consumption mode. The kernel further performs touch detection on the touch key in a normal power consumption mode, and the method comprises the following steps: and aiming at any touch key, the kernel judges whether the voltage on the corresponding channel of the touch key is smaller than a second preset threshold value in the normal power consumption mode. The first preset threshold is larger than the second preset threshold. That is, the initial touch detection is a coarse detection method relative to the touch detection of the kernel, so as to improve the touch detection efficiency.
Optionally, the MCU further comprises: and the two ends of the awakening module are respectively connected with the kernel and the initial touch detection circuit. The initial touch detection circuit controls the MCU to enter a normal power consumption mode, including: the initial touch detection circuit sends indication information to the wake-up module. And the awakening module generates an awakening signal according to the indication information and sends the awakening signal to the kernel. And the kernel wakes up the MCU according to the wake-up signal.
Optionally, the initial touch detection circuit controls the MCU to enter a normal power consumption mode, including: the initial touch detection circuit generates a wake-up signal and sends the wake-up signal to the kernel. And the kernel wakes up the MCU according to the wake-up signal.
The MCU enters a normal power consumption mode through the two modes, and then the touch detection efficiency is improved.
Optionally, the MCU further comprises: first time-recorder and second time-recorder, first time-recorder and initial touch detection circuit are connected, and initial touch detection circuit carries out m initial touch detection to the touch button under low-power consumption mode, includes: and the initial touch detection circuit performs m times of initial touch detection on the touch key in a low power consumption mode according to the detection frequency set on the first timer. The kernel further performs touch detection on the touch key in a normal power consumption mode, and the method comprises the following steps: and the kernel further performs touch detection on the touch key in a normal power consumption mode according to the detection frequency set on the second timer, wherein the detection frequency set on the first timer is smaller than the detection frequency set on the second timer. That is, the initial touch detection is a coarse detection mode relative to the primary detection performed by the kernel, and the touch detection efficiency can be further improved.
Optionally, the working voltage of the first timer and the second timer is a first voltage, the working voltage of the initial touch detection circuit is a second voltage, and the first voltage is greater than the second voltage. Based on this, the power consumption of the MCU can also be reduced.
The MCU, the touch device, the readable storage medium, and the computer program product will be described below, and the effects thereof can refer to the effects of the above methods, which will not be described further below.
In a second aspect, the present application provides an MCU, the MCU is connected to N touch keys through N channels, the N channels are in one-to-one correspondence with the N touch keys, N is an integer greater than or equal to 1, and the MCU is configured to: and acquiring a low power consumption mode setting instruction. And entering a low power consumption mode according to the low power consumption mode setting instruction. And performing initial touch detection on at least one touch key in a low power consumption mode.
Optionally, the MCU includes: the initial touch detection circuit is a pure hardware circuit, and correspondingly, the initial touch detection circuit is used for performing initial touch detection on at least one touch key in a low power consumption mode.
Optionally, the MCU further comprises: the kernel, the kernel and the initial touch detection circuit are connected. Correspondingly, the initial touch detection circuit is specifically configured to: and aiming at any one touch key in the at least one touch key, performing m times of initial touch detection on the touch key in a low power consumption mode, wherein m is an integer greater than 1. Correspondingly, the initial touch detection circuit is further configured to: and for any touch key in the at least one touch key, if the number of the initial touch detections of the touch operation reaches n, controlling the MCU to enter a normal power consumption mode. The kernel is used for further touch detection of the touch key in a normal power consumption mode.
Optionally, the initial touch detection circuit is specifically configured to: and aiming at any initial touch detection, judging whether the voltage on the corresponding channel of the touch key is smaller than a first preset threshold value or not in the low power consumption mode. The kernel is specifically configured to: and judging whether the voltage on the corresponding channel of the touch key is smaller than a second preset threshold value or not in the normal power consumption mode aiming at any touch key. The first preset threshold is larger than the second preset threshold.
Optionally, the MCU further comprises: and the two ends of the awakening module are respectively connected with the kernel and the initial touch detection circuit. Correspondingly, the initial touch detection circuit is specifically configured to send the indication information to the wake-up module. And the wake-up module is used for generating a wake-up signal according to the indication information and sending the wake-up signal to the kernel. The kernel is also used for waking up the MCU according to the wake-up signal.
Optionally, the initial touch detection circuit is specifically configured to generate a wake-up signal and send the wake-up signal to the kernel. The kernel is also used for waking up the MCU according to the wake-up signal.
Optionally, the MCU further comprises: the touch control circuit comprises a first timer and a second timer, wherein the first timer is connected with an initial touch detection circuit, the second timer is connected with a kernel, and the initial touch detection circuit is specifically used for: and performing m times of initial touch detection on the touch key in a low power consumption mode according to the detection frequency set on the first timer. The kernel is specifically configured to: and further performing touch detection on the touch key in the normal power consumption mode according to the detection frequency set on the second timer.
Optionally, the detection frequency set on the first timer is smaller than the detection frequency set on the second timer.
Optionally, the working voltage of the first timer and the second timer is a first voltage, the working voltage of the initial touch detection circuit is a second voltage, and the first voltage is greater than the second voltage.
In a third aspect, the present application provides a touch device, including: the touch detection device comprises an MCU and N touch keys, wherein the MCU is connected with the N touch keys through N channels, the N channels correspond to the N touch keys one by one, N is an integer larger than 1, and the MCU is used for executing the touch detection method according to the first aspect or the optional mode of the first aspect.
In a fourth aspect, the present application provides a readable storage medium comprising program instructions which, when run on a computer, cause the computer to perform the touch detection method according to the first aspect or the alternatives of the first aspect.
In a fifth aspect, the present application provides a computer program product comprising program instructions for testing a touch detection method according to the first aspect or alternatives thereof.
The application provides a touch detection method, an MCU, a touch device and a storage medium. And the MCU acquires a low power consumption mode setting instruction. And the MCU enters a low power consumption mode according to the low power consumption mode setting instruction. And the MCU performs initial touch detection on at least one touch key in a low power consumption mode. Thereby the power consumption of the MCU can be reduced.
Drawings
FIG. 1 is a schematic diagram of the connection between the MCU and the touch key;
fig. 2 is a flowchart of a touch detection method according to an embodiment of the present application;
FIG. 3 is a flowchart of a touch detection method according to another embodiment of the present application;
fig. 4 is a flowchart of a method for controlling an MCU to enter a normal power consumption mode according to an embodiment of the present application;
fig. 5 is a flowchart of a method for controlling an MCU to enter a normal power consumption mode according to another embodiment of the present application;
fig. 6 is a schematic diagram of an MCU according to an embodiment of the present application.
Detailed Description
As described above, the current touch device includes: the touch control device comprises a Micro Control Unit (MCU) and a touch key, wherein a channel exists between the MCU and the touch key. Fig. 1 is a schematic diagram illustrating a connection between an MCU and a touch key, and as shown in fig. 1, a typical touch key currently exists, which includes: the touch keys are also called touch sensing electrodes, for example, keys 0, 1 and 2 in fig. 1 are all key touch keys, the key 3 is a circular touch key, and the key 4 is a slide bar touch key. The slider touch key is formed by 3 touch keys or units, the circular touch key is formed by 4 touch keys or units, and each touch key or unit is connected with the MCU through a channel, for example: the keys 0, 1 and 2 are respectively connected with the MCU through the channels 0, 1 and 2, the key 3 is respectively connected with the MCU through the channels 3, 4, 5 and 6, and the key 4 is respectively connected with the MCU through the channels 7, 8 and 9. It should be noted that the touch key to be mentioned below in this application may be the upper key type touch key, or one of the slide bar type touch keys, or one of the circular type touch keys. The MCU determines whether there is a finger pressing the touch key by calculating Delta-Base-Vout, for example: and when the Delta value is more than 200, the touch key is considered to be pressed by the finger.
However, as long as the MCU enters the operating state, in any scenario, the MCU operates in the normal power consumption mode, which inevitably causes a problem of large MCU power consumption.
In order to solve the technical problem, the application provides a touch detection method, an MCU, a touch device and a storage medium.
Fig. 2 is a flowchart of a touch detection method according to an embodiment of the present application, where the method is applied to an MCU, the MCU is connected to N touch keys through N channels, the N channels are in one-to-one correspondence with the N touch keys, and N is an integer greater than or equal to 1, as shown in fig. 2, the method includes the following steps:
step S201: the MCU acquires a low power consumption mode setting instruction.
Step S202: and the MCU enters a low power consumption mode according to the low power consumption mode setting instruction.
Step S203: and the MCU performs initial touch detection on at least one touch key in a low power consumption mode.
The N touch keys may be disposed on the touch panel, and the touch panel may further be disposed with a mode selection key, for example: one mode selection key A is used for selecting the mode of the MCU to be a normal power consumption mode, and the other mode selection key B is used for selecting the mode of the MCU to be a low power consumption mode. When a user presses the mode selection key A, the MCU is triggered to acquire a normal power consumption mode setting instruction, and when the user presses the mode selection key B, the MCU is triggered to acquire a low power consumption mode setting instruction. Or when the MCU enters a working state, the system defaults that the MCU enters a normal power consumption mode, and after preset time, the MCU automatically enters a low power consumption mode. The preset time may be factory set or may be set by a user.
And after the MCU acquires the low power consumption mode setting instruction, the MCU enters a low power consumption mode. Wherein the low power mode is relative to the normal power mode. The normal power consumption mode refers to a power consumption mode formed when all modules in the MCU work by adopting corresponding standard parameters after the MCU enters a working state. Such as: and the ADC in the MCU samples the voltage of each channel according to a preset standard voltage sampling frequency. Such as voltage sampling every 5 milliseconds for a channel. For another example: after the kernel in the MCU acquires the voltage sampled by the ADC, the frequency is calculated according to a preset standard, the Delta value is calculated, and whether touch operation exists on the touch key is judged. For another example: each channel of the MCU is enabled, i.e., the ADC can sample the voltage of each channel. Conversely, a low power mode refers to as long as the MCU consumes less power than its normal power mode. Such as: and the ADC in the MCU samples the voltage of each channel at a voltage sampling frequency lower than the standard voltage sampling frequency. Such as voltage sampling every 10 milliseconds for a channel. For another example: after the kernel in the MCU acquires the voltage sampled by the ADC, calculating a Delta value according to the calculation frequency lower than the standard calculation frequency, and judging whether touch operation exists on the touch key. For another example: only part of the channels are in an enabled state, and other channels are in a non-enabled state, namely, the ADC can only sample the voltage of the part of the channels, and cannot sample the voltage of the other channels. Or only part of the channels are in the wake-up state, and other channels are in the non-wake-up state, that is, the ADC performs voltage sampling on the part of the channels according to the standard sampling frequency, and performs voltage sampling on the other channels according to the sampling frequency lower than the standard sampling frequency. In one example, the MCU or a kernel in the MCU outputs a driving signal through a driving interface according to a certain frequency to set an enabled state, a disabled state, a wake-up state, or a non-wake-up state of each channel.
Further, the MCU performs initial touch detection on at least one touch key in a low power consumption mode, and if the MCU is in the low power consumption mode and each channel is still in an enabling state, the at least one touch key is the N touch keys. If the MCU is in the low power consumption mode, but only part of the channels are still in the enabled state, and the other part of the channels are in the disabled state, at this time, the at least one touch key is the touch key corresponding to the channel in the enabled state.
Optionally, the initial touch detection may be implemented by an initial touch detection circuit in the MCU, where the initial touch detection circuit is a pure hardware circuit, and the initial touch detection circuit is a coarse detection mode relative to a touch detection circuit implemented by an inner core.
Suppose a touch light system comprising multiple street lights has multiple touch keys, and each touch key is used for controlling the on/off, brightness and the like of one street light. When all the street lamps are turned on, the system defaults that the MCU enters a normal power consumption mode, and after the preset time or after the preset time, the MCU automatically enters a low power consumption mode, such as: only one channel is in an enabled state, other channels are in a non-enabled state, the kernel is in a sleep state, and the initial touch detection circuit can work normally. When a user needs to turn off a certain street lamp (namely, a street lamp controlled by a channel in an enabled state), the initial touch detection circuit performs initial touch detection on the touch key corresponding to the channel, but does not perform touch detection on other channels.
In summary, an embodiment of the present application provides a touch detection method, including: the MCU acquires a low power consumption mode setting instruction. And entering a low power consumption mode according to the low power consumption mode setting instruction. And performing initial touch detection on at least one touch key in a low power consumption mode. Thereby the power consumption of the MCU can be reduced. Furthermore, the initial touch detection circuit included in the MCU is a pure hardware circuit, that is, the initial touch detection circuit is not loaded with any software code to perform initial touch detection on the touch key, which is more efficient than a software implementation. Further, as described above, the initial touch detection is a coarse detection method with respect to the touch detection performed by the kernel, and based on this, the detection efficiency can be further improved.
As described above, the initial touch detection is a coarse detection method with respect to the touch detection performed by the kernel, so that when the initial touch detection circuit determines that there is a touch operation on the touch key through the initial touch detection, the kernel can further perform the touch detection.
Specifically, fig. 3 is a flowchart of a touch detection method according to another embodiment of the present application, where the method is applied to an MCU, the MCU is connected to N touch keys through N channels, the N channels are in one-to-one correspondence with the N touch keys, N is an integer greater than or equal to 1, and as shown in fig. 3, the step S203 includes:
step S301: aiming at any touch key in at least one touch key, the initial touch detection circuit carries out m times of initial touch detection on the touch key in a low power consumption mode, wherein m is an integer larger than 1. Correspondingly, after step S301, the method further includes:
step S302: for any touch key of the at least one touch key, if the initial touch detection circuit detects that the number of initial touch detections of the touch operation reaches n, the initial touch detection circuit controls the MCU to enter a normal power consumption mode, and the kernel further performs touch detection on the touch key in the normal power consumption mode.
For example: the initial touch detection circuit is configured with m being 10 and n being 6 in advance, for any one of the at least one touch key, the initial touch detection circuit performs initial touch detection on the touch key 10 times in a low power consumption mode, and if the initial touch detection circuit detects that the number of initial touch detections of touch operation reaches 6, the initial touch detection circuit triggers the whole MCU to enter a normal power consumption mode. Namely, all modules in the MCU work by adopting corresponding standard parameters. Such as: and the ADC in the MCU samples the voltage of each channel according to a preset standard voltage sampling frequency. Such as voltage sampling every 5 milliseconds for a channel. For another example: after the kernel in the MCU acquires the voltage sampled by the ADC, the frequency is calculated according to a preset standard, the Delta value is calculated, and whether touch operation exists on the touch key is judged. For another example: each channel of the MCU is enabled, i.e., the ADC can sample the voltage of each channel.
For any initial touch detection, the initial touch detection circuit judges whether the voltage on the corresponding channel of the touch key is smaller than a first preset threshold value in a low power consumption mode. And if the initial touch detection circuit determines that the voltage on the channel corresponding to the touch key is smaller than a first preset threshold value, determining that the touch key has touch operation.
Further, the kernel performs further touch detection on the touch key in the normal power consumption mode. Namely, the kernel judges whether the voltage on the corresponding channel of the touch key is smaller than a second preset threshold value in the normal power consumption mode. And if the initial touch detection circuit determines that the voltage on the channel corresponding to the touch key is smaller than a second preset threshold value, determining that the touch key has touch operation. The first preset threshold is larger than the second preset threshold. I.e. the initial touch detection is a coarse detection mode with respect to the touch detection of the kernel.
The embodiment of the application provides a touch detection method, wherein an initial touch detection circuit performs m times of initial touch detection on a touch key in a low power consumption mode, if the number of the initial touch detections of touch operation reaches n, the initial touch detection circuit controls an MCU to enter a normal power consumption mode, and a kernel performs further touch detection on the touch key in the normal power consumption mode. On one hand, if the initial touch detection circuit detects that the number of initial touch detections of touch operation reaches n, the initial touch detection circuit controls the MCU to enter the normal power consumption mode instead of controlling the MCU to enter the normal power consumption mode only when the initial touch detection circuit detects that the touch operation can be detected every time, so that the anti-shaking effect can be achieved. On the other hand, the accuracy of touch detection can be provided while the power consumption of the MCU is reduced.
As described above, the initial touch detection circuit may control the MCU to enter the normal power consumption mode, and the following description is directed to this control manner:
the first alternative is as follows: fig. 4 is a flowchart of a method for controlling an MCU to enter a normal power consumption mode according to an embodiment of the present application, where the MCU further includes: and the two ends of the awakening module are respectively connected with the kernel and the initial touch detection circuit. As shown in fig. 4, the method includes the steps of:
step S401: the initial touch detection circuit sends indication information to the wake-up module.
Step S402: and the awakening module generates an awakening signal according to the indication information and sends the awakening signal to the kernel.
Step S403: and the kernel wakes up the MCU according to the wake-up signal.
The indication information is used to indicate a wake-up module to generate a wake-up signal, where the wake-up module may be a functional module on the kernel or a functional module independent of the kernel, which is not limited in this application.
The second option is: fig. 5 is a flowchart of a method for controlling an MCU to enter a normal power consumption mode according to another embodiment of the present application, where as shown in fig. 5, the method includes the following steps:
step S501: the initial touch detection circuit generates a wake-up signal and sends the wake-up signal to the kernel.
Step S502: and the kernel wakes up the MCU according to the wake-up signal.
In the first optional mode and the second optional mode, after the kernel wakes up the whole MCU, the whole MCU enters a normal power consumption mode. Namely, all modules in the MCU work by adopting corresponding standard parameters. Such as: and the ADC in the MCU samples the voltage of each channel according to a preset standard voltage sampling frequency. Such as voltage sampling every 5 milliseconds for a channel. For another example: after the kernel in the MCU acquires the voltage sampled by the ADC, the frequency is calculated according to a preset standard, the Delta value is calculated, and whether touch operation exists on the touch key is judged. For another example: each channel of the MCU is enabled, i.e., the ADC can sample the voltage of each channel.
The above MCU further includes: a first timer and a second timer, the first timer being connected to the initial touch detection circuit, the second timer being connected to the core, wherein the first timer is used to determine a voltage detection frequency of the initial touch detection circuit, for example: the initial touch detection circuit performs initial touch detection once every first preset time from the first preset time. The second timer is used to determine the voltage sensing efficiency of the core, for example: the initial touch detection circuit performs touch detection once every second preset time from the second preset time. The detection frequency set on the first timer is smaller than the detection frequency set on the second timer. The first preset time, the second preset time, the first preset time and the second preset time can be set by the MCU when leaving a factory, and a user can configure the values according to requirements.
Optionally, the working voltages of the first timer and the second timer are first voltages, such as: 3.3V, the working voltage of the initial touch detection circuit is a second voltage, and the first voltage is greater than the second voltage, such as: 1.5V.
The embodiment of the application provides a method for controlling an MCU to enter a normal power consumption mode, and the MCU enters the normal power consumption mode through the two modes, so that the touch detection efficiency is improved. In addition, because the detection frequency set on the first timer is less than the detection frequency set on the second timer, that is, the initial touch detection is a coarse detection mode relative to the primary detection performed by the kernel, the touch detection efficiency can be further improved. Further, the operating voltage of the initial touch detection circuit is smaller than the first voltage, and based on this, the power consumption of the MCU can also be reduced.
Fig. 6 is a schematic diagram of an MCU according to an embodiment of the present application, where the MCU is configured to: and acquiring a low power consumption mode setting instruction. And entering a low power consumption mode according to the low power consumption mode setting instruction. And performing initial touch detection on at least one touch key in a low power consumption mode. As shown in fig. 6, the MCU includes: the initial touch detection circuit is a pure hardware circuit, and correspondingly, the initial touch detection circuit is used for performing initial touch detection on at least one touch key in a low power consumption mode.
Optionally, the MCU further comprises: the kernel, the kernel and the initial touch detection circuit are connected. Correspondingly, the initial touch detection circuit is specifically configured to: for any one of the at least one touch key, performing m times of initial touch detection on the touch key in a low power consumption mode, and correspondingly, the initial touch detection circuit is further configured to: and for any touch key in the at least one touch key, if the number of the initial touch detections of the touch operation reaches n, controlling the MCU to enter a normal power consumption mode. The kernel is used for further touch detection of the touch key in a normal power consumption mode.
Optionally, the initial touch detection circuit is specifically configured to: and aiming at any initial touch detection, judging whether the voltage on the corresponding channel of the touch key is smaller than a first preset threshold value or not in the low power consumption mode.
Optionally, the kernel is specifically configured to: and judging whether the voltage on the corresponding channel of the touch key is smaller than a second preset threshold value or not in the normal power consumption mode aiming at any touch key. The first preset threshold is larger than the second preset threshold.
Optionally, the MCU further comprises: and the two ends of the awakening module are respectively connected with the kernel and the initial touch detection circuit. Correspondingly, the initial touch detection circuit is specifically configured to send the indication information to the wake-up module. And the wake-up module is used for generating a wake-up signal according to the indication information and sending the wake-up signal to the kernel. The kernel is also used for waking up the MCU according to the wake-up signal.
Optionally, the initial touch detection circuit is specifically configured to generate a wake-up signal and send the wake-up signal to the kernel. The kernel is also used for waking up the MCU according to the wake-up signal.
Optionally, the MCU further comprises: the touch control circuit comprises a first timer and a second timer, wherein the first timer is connected with an initial touch detection circuit, and the initial touch detection circuit is specifically used for: and performing m times of initial touch detection on the touch key in a low power consumption mode according to the detection frequency set on the first timer. The kernel is specifically configured to: and further performing touch detection on the touch key in the normal power consumption mode according to the detection frequency set on the second timer.
Optionally, the detection frequency set on the first timer is smaller than the detection frequency set on the second timer.
Optionally, the MCU further comprises: a first channel controller which can control an enabled state and a disabled state of the N channels, for example: the first channel controller controls the MCU to be in an enabling state in the channels 0-7 and a non-enabling state in the channels 8-23 in the normal power consumption mode. Of course, channels 0-23 may be controlled to be enabled, which is not limited by this application. The operating voltage of the first channel controller may be a first voltage.
Optionally, the MCU further comprises: a second channel controller that can control an enabled state and a non-enabled state of the wake-up channel.
Optionally, the MCU further comprises: one or more registers for storing a low power mode setting instruction, a normal power mode setting instruction, and the like. The MCU also includes: a decoder, the register for decoding instructions in the register at the second voltage.
Optionally, the MCU further comprises: ADC, ADC controller etc. ADC controller is used for controlling the ADC to gather the voltage on each channel.
Optionally, the operating voltages of the kernel, the first timer, the second timer, the first channel controller, the register, the ADC, and the ADC controller are first voltages, the operating voltages of the initial touch detection circuit, the wake-up module, the second channel controller, and the decoder are second voltages, and the first voltage is greater than the second voltage. The working voltage of each module in the MCU is not limited, and in addition, each module in the MCU can be electrically connected through a bus.
The MCU provided in this application can execute the touch detection method, and the content and effect thereof can refer to the method embodiment section, which is not described herein again.
The present application further provides a touch device, exemplarily, the touch device includes: the touch key comprises an MCU and N touch keys, wherein the MCU is connected with the N touch keys through N channels, the N channels correspond to the N touch keys one to one, and N is an integer larger than 1. Illustratively, as shown in fig. 1, a typical touch key currently exists, which includes: the touch key comprises a key type touch key, a slide bar type touch key and a circular type touch key, for example, keys 0, 1 and 2 in fig. 1 are all key type touch keys, a key 3 is a circular type touch key, and a key 4 is a slide bar type touch key. The slider touch key is formed by 3 touch keys or units, the circular touch key is formed by 4 touch keys or units, and each touch key or unit is connected with the MCU through a channel, for example: the keys 0, 1 and 2 are respectively connected with the MCU through the channels 0, 1 and 2, the key 3 is respectively connected with the MCU through the channels 3, 4, 5 and 6, and the key 4 is respectively connected with the MCU through the channels 7, 8 and 9. The MCU is configured to execute the touch detection method, and the content and effect of the method can refer to the embodiment of the method, which is not described herein again.
The present application further provides a readable storage medium, which includes program instructions, and when the program instructions are run on a computer, the computer executes the touch detection method, and the content and effect of the touch detection method can refer to the embodiment of the method, which is not described herein again.
The present application further provides a computer program product, which includes program instructions, where the program instructions are used to execute the touch detection method described above, and the content and effect of the program instructions may refer to the embodiment of the method, which is not described herein again.

Claims (20)

1. A touch detection method is characterized in that a Micro Control Unit (MCU) is connected with N touch keys through N channels, the N channels correspond to the N touch keys one by one, N is an integer greater than or equal to 1, and the method comprises the following steps:
the MCU acquires a low power consumption mode setting instruction;
the MCU enters a low power consumption mode according to the low power consumption mode setting instruction;
and the MCU performs initial touch detection on at least one touch key in the low power consumption mode.
2. The method of claim 1, wherein the MCU comprises: the initial touch detection circuit is a pure hardware circuit, and correspondingly, the MCU performs initial touch detection on at least one of the touch keys in the low power consumption mode, including:
and the initial touch detection circuit performs initial touch detection on at least one touch key in the low power consumption mode.
3. The method of claim 2, wherein the MCU further comprises: a core, the core being connected to the initial touch detection circuit; correspondingly, the initial touch detection circuit performs initial touch detection on at least one touch key in the low power consumption mode, and the initial touch detection circuit includes:
aiming at any one touch key in at least one touch key, the initial touch detection circuit carries out m times of initial touch detection on the touch key in the low power consumption mode, wherein m is an integer greater than 1;
correspondingly, after the initial touch detection is performed on at least one of the touch keys in the low power consumption mode by the initial touch detection circuit, the method further includes:
for any touch key of at least one touch key, if the initial touch detection circuit detects that the number of initial touch detections of touch operation reaches n, the initial touch detection circuit controls the MCU to enter a normal power consumption mode, and the kernel performs further touch detection on the touch key in the normal power consumption mode.
4. The method of claim 3, wherein the initial touch detection circuit performs m initial touch detections on the touch key in the low power mode, and comprises:
aiming at any one time of initial touch detection, the initial touch detection circuit judges whether the voltage on a channel corresponding to the touch key is smaller than a first preset threshold value or not in the low power consumption mode;
the kernel further performs touch detection on the touch key in the normal power consumption mode, including:
aiming at any one touch key, the kernel judges whether the voltage on a channel corresponding to the touch key is smaller than a second preset threshold value or not in the normal power consumption mode;
wherein the first preset threshold is greater than the second preset threshold.
5. The method according to claim 3 or 4, wherein the MCU further comprises: the two ends of the awakening module are respectively connected with the inner core and the initial touch detection circuit; the initial touch detection circuit controls the MCU to enter a normal power consumption mode, including:
the initial touch detection circuit sends indication information to the awakening module;
the awakening module generates an awakening signal according to the indication information and sends the awakening signal to the kernel;
and the kernel wakes up the MCU according to the wake-up signal.
6. The method of claim 3 or 4, wherein the initial touch detection circuit controls the MCU to enter a normal power consumption mode, comprising:
the initial touch detection circuit generates a wake-up signal and sends the wake-up signal to the kernel;
and the kernel wakes up the MCU according to the wake-up signal.
7. The method according to claim 3 or 4, wherein the MCU further comprises: the touch key comprises a first timer and a second timer, wherein the first timer is connected with the initial touch detection circuit, and the initial touch detection circuit performs m times of initial touch detection on the touch key in the low power consumption mode, and the touch key comprises:
the initial touch detection circuit performs m times of initial touch detection on the touch key in the low power consumption mode according to the detection frequency set on the first timer;
the kernel further performs touch detection on the touch key in the normal power consumption mode, including:
and the kernel further performs touch detection on the touch key in the normal power consumption mode according to the detection frequency set on the second timer.
8. The method of claim 7, wherein the detection frequency set on the first timer is less than the detection frequency set on the second timer.
9. The method of claim 8, wherein the operating voltage of the first timer and the second timer is a first voltage, the operating voltage of the initial touch detection circuit is a second voltage, and the first voltage is greater than the second voltage.
10. The MCU is characterized in that the MCU is connected with N touch keys through N channels, the N channels correspond to the N touch keys one to one, N is an integer greater than or equal to 1, and the MCU is used for: acquiring a low power consumption mode setting instruction; entering a low power consumption mode according to the low power consumption mode setting instruction; and carrying out initial touch detection on at least one touch key in the low power consumption mode.
11. The MCU of claim 10, wherein the MCU comprises: the initial touch detection circuit is a pure hardware circuit, and correspondingly, the initial touch detection circuit is used for performing initial touch detection on at least one touch key in the low power consumption mode.
12. The MCU of claim 11, wherein the MCU further comprises: a core, the core being connected to the initial touch detection circuit; correspondingly, the initial touch detection circuit is specifically configured to: aiming at any touch key in at least one touch key, performing m times of initial touch detection on the touch key in the low power consumption mode, wherein m is an integer greater than 1;
correspondingly, the initial touch detection circuit is further configured to: for any touch key in at least one touch key, if the number of initial touch detections of touch operation reaches n, controlling the MCU to enter a normal power consumption mode;
the kernel is used for further touch detection of the touch key in the normal power consumption mode.
13. The MCU of claim 12, wherein the initial touch detection circuit is specifically configured to: aiming at any one time of initial touch detection, judging whether the voltage on a channel corresponding to the touch key is smaller than a first preset threshold value or not in the low power consumption mode;
the kernel is specifically configured to: for any one touch key, judging whether the voltage on a channel corresponding to the touch key is smaller than a second preset threshold value or not in the normal power consumption mode;
wherein the first preset threshold is greater than the second preset threshold.
14. The MCU of claim 12 or 13, wherein the MCU further comprises: the two ends of the awakening module are respectively connected with the inner core and the initial touch detection circuit;
correspondingly, the initial touch detection circuit is specifically configured to send instruction information to the wake-up module;
the awakening module is used for generating an awakening signal according to the indication information and sending the awakening signal to the kernel;
the kernel is also used for waking up the MCU according to the wake-up signal.
15. The MCU of claim 12 or 13, wherein the initial touch detection circuit is specifically configured to generate a wake-up signal and send the wake-up signal to the core;
the kernel is also used for waking up the MCU according to the wake-up signal.
16. The MCU of claim 12 or 13, wherein the MCU further comprises: the first timer is connected with the initial touch detection circuit, the second timer is connected with the kernel, and the initial touch detection circuit is specifically configured to: performing m-time initial touch detection on the touch key in the low power consumption mode according to the detection frequency set on the first timer;
the kernel is specifically configured to: and further performing touch detection on the touch key in the normal power consumption mode according to the detection frequency set on the second timer.
17. The MCU of claim 16, wherein the detection frequency set on the first timer is less than the detection frequency set on the second timer.
18. The MCU of claim 17, wherein the operating voltages of the first timer and the second timer are first voltages, the operating voltage of the initial touch detection circuit is a second voltage, and the first voltage is greater than the second voltage.
19. A touch device, comprising: the touch detection device comprises an MCU and N touch keys, wherein the MCU is connected with the N touch keys through N channels, the N channels correspond to the N touch keys one by one, N is an integer larger than 1, and the MCU is used for executing the touch detection method according to any one of claims 1 to 9.
20. A readable storage medium characterized by comprising program instructions which, when run on a computer, cause the computer to perform the touch detection method of any one of claims 1 to 9.
CN201911046417.0A 2019-10-30 2019-10-30 Touch detection method, MCU, touch control equipment and storage medium Withdrawn CN110806816A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911046417.0A CN110806816A (en) 2019-10-30 2019-10-30 Touch detection method, MCU, touch control equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911046417.0A CN110806816A (en) 2019-10-30 2019-10-30 Touch detection method, MCU, touch control equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110806816A true CN110806816A (en) 2020-02-18

Family

ID=69489606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911046417.0A Withdrawn CN110806816A (en) 2019-10-30 2019-10-30 Touch detection method, MCU, touch control equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110806816A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113489497A (en) * 2021-06-21 2021-10-08 苏州聚元微电子股份有限公司 Realization circuit and chip for TCK or ADC
CN113760092A (en) * 2021-09-06 2021-12-07 合肥松豪电子科技有限公司 Detection method applied to man-machine interaction in low power consumption mode
TWI796143B (en) * 2022-02-21 2023-03-11 神雲科技股份有限公司 Computer system and wake-up method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0553706A (en) * 1991-08-28 1993-03-05 Sharp Corp Key input circuit and key input detecting method
CN101872172A (en) * 2009-04-22 2010-10-27 凌通科技股份有限公司 Sleep mode power saving method, keyboard control circuit and triangular scanning keyboard
CN106406496A (en) * 2016-09-05 2017-02-15 芯海科技(深圳)股份有限公司 Low power consumption control method for pressure-sensitive key identification device
CN108259044A (en) * 2018-02-26 2018-07-06 上海东软载波微电子有限公司 Touch key scanning method and device, computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0553706A (en) * 1991-08-28 1993-03-05 Sharp Corp Key input circuit and key input detecting method
CN101872172A (en) * 2009-04-22 2010-10-27 凌通科技股份有限公司 Sleep mode power saving method, keyboard control circuit and triangular scanning keyboard
CN106406496A (en) * 2016-09-05 2017-02-15 芯海科技(深圳)股份有限公司 Low power consumption control method for pressure-sensitive key identification device
CN108259044A (en) * 2018-02-26 2018-07-06 上海东软载波微电子有限公司 Touch key scanning method and device, computer readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113489497A (en) * 2021-06-21 2021-10-08 苏州聚元微电子股份有限公司 Realization circuit and chip for TCK or ADC
CN113489497B (en) * 2021-06-21 2024-04-26 苏州聚元微电子股份有限公司 Implementation circuit and chip for TKC or ADC
CN113760092A (en) * 2021-09-06 2021-12-07 合肥松豪电子科技有限公司 Detection method applied to man-machine interaction in low power consumption mode
TWI796143B (en) * 2022-02-21 2023-03-11 神雲科技股份有限公司 Computer system and wake-up method

Similar Documents

Publication Publication Date Title
CN110806816A (en) Touch detection method, MCU, touch control equipment and storage medium
CN104777888B (en) Coordinate the energy consumption in control reduction computer system by the software and hardware of more power supplys
EP3106997A2 (en) On-chip sensor hub, and mobile device and multi-sensor management method therefor
US8533511B2 (en) Notebook computer
GB2294139A (en) Minimizing power consumption in e.g. portable computing devices
CN107317924B (en) Mobile terminal and dormancy method of mobile terminal
CN104182243B (en) Sleep state control system, computer system and sleep state detection method thereof
KR20150021311A (en) Method and apparatus for saving battery of portable terminal
US9703429B2 (en) Touch detection device, touch detection system and touch detection method
CN108055405B (en) Terminal and method for awakening same
JP2004240971A (en) Detection method of wake-up, and device composed by implementing it
CN101923408A (en) Method for automatically adjusting sensitivity of touch screen
CN109831700A (en) A kind of standby mode switching method, device, electronic equipment and storage medium
CN205787043U (en) A kind of detection device of battery electric quantity
US9274661B2 (en) Touch sensing circuit, apparatus, and system and operating method thereof
CN102609072A (en) Method for responding to key trigger and portable device using the method
EP2903246B1 (en) Voice recognition function realizing method and device
CN102147670A (en) Mouse device
US20120042183A1 (en) Apparatus for adjusting computer power mode
US8200997B2 (en) Computer wake up circuit includes a switch configured to prevent a control signals from an I/O controller being transmitted to south-bridge
EP3159780A1 (en) Terminal, protective case and induction method
CN103944217A (en) Awakening device and awakening method for terminal and terminal
KR20150111043A (en) Fingerprint authenticating apparatus detecting finger touch and operating method thereof
CN215298209U (en) Touch awakening detection circuit, fingerprint identification device, display panel and electronic equipment
WO2021081890A1 (en) Control method, mcu, touch control device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20200218

WW01 Invention patent application withdrawn after publication