CN117971052B - Control circuit and method for mining keyboard and mouse - Google Patents

Control circuit and method for mining keyboard and mouse Download PDF

Info

Publication number
CN117971052B
CN117971052B CN202410366484.5A CN202410366484A CN117971052B CN 117971052 B CN117971052 B CN 117971052B CN 202410366484 A CN202410366484 A CN 202410366484A CN 117971052 B CN117971052 B CN 117971052B
Authority
CN
China
Prior art keywords
key
information
state
communication
time
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.)
Active
Application number
CN202410366484.5A
Other languages
Chinese (zh)
Other versions
CN117971052A (en
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 Davao Electronics Co ltd
Original Assignee
Shenzhen Davao Electronics 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 Davao Electronics Co ltd filed Critical Shenzhen Davao Electronics Co ltd
Priority to CN202410366484.5A priority Critical patent/CN117971052B/en
Publication of CN117971052A publication Critical patent/CN117971052A/en
Application granted granted Critical
Publication of CN117971052B publication Critical patent/CN117971052B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/0202Constructional details or processes of manufacture of the input device
    • G06F3/0219Special purpose keyboards
    • 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/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

According to the control circuit and the method for the mining keyboard and mouse, key state information is obtained according to a preset key detection signal; if the key is in a pressed state, entering a key information transmission state, and sending the key state information in the pressed state through a third communication instruction according to the first time information; when the key is switched to the lifting state, sending the key state information in the lifting state through a third communication instruction according to the second time information; according to the invention, the stability of key scanning detection is improved through the filter circuit, the Schmidt conversion circuit and the optical coupler isolation circuit; through the key detection mode and the instruction communication mode, the use experience of the key mouse is improved while the key detection stability is improved.

Description

Control circuit and method for mining keyboard and mouse
Technical Field
The invention belongs to the technical field of mining electronics, and particularly discloses a mining keyboard and mouse control circuit and a mining keyboard and mouse control method.
Background
In severe working environments such as mines and mines, electronic equipment needs to have the capabilities of resisting wet and cold, preventing impact, resisting interference and the like to run for a long time, so the stability of electrons is particularly important. At present, the USB mouse is connected with an upper computer, so that the power supply is unstable, the communication between the mouse and the upper computer is greatly influenced by an interference signal, and the pointer discontinuous movement and even misoperation problem easily occur. In addition, mechanical vibration in mines and the like can cause disordered movement of a mouse. Therefore, a stable control technology of the mining mouse needs to be designed.
Disclosure of Invention
In view of the above problems, the invention aims to provide a control circuit and a control method for a mining keyboard and mouse, which improve the stability of key scanning detection through a filter circuit, a schmitt switching circuit and an optical coupler isolation circuit. In addition, according to the state of the key and the time information corresponding to the state of the key, the key grade information is used for representing the state information of the key, and the data transmission with the upper computer is realized by sending a preset communication instruction; through the key detection mode and the instruction communication mode, the use experience of the key mouse is improved while the key detection stability is improved.
In order to achieve the above object, a first aspect of the present invention provides a mining keyboard and mouse control circuit, which:
The key filtering module is used for acquiring a key detection input signal according to the key detection output signal and obtaining key state information;
The Schmitt signal processing module comprises a Schmitt circuit and is used for processing the key detection output signal and the key detection input signal to obtain square waveforms;
The communication isolation module comprises a photoelectric coupler and a first communication interface circuit, wherein an output signal of the upper computer obtains a communication input signal through the photoelectric coupler, and the communication output signal obtains the input signal of the upper computer through the photoelectric coupler.
In this scheme, the button filter module includes:
The key filtering module is used for detecting the key state; at least comprises the following steps: a first key (S21), a first resistor (R21), a first capacitor (C21), a first diode (D21) and a second diode (D23);
a first end of the first key (S21) is connected with the key detection output signal and the cathode of the second diode (D23); the second end of the first key (S21) is connected with the key detection input signal, the first end of the first resistor (R21), the first end of the first capacitor (C21) and the negative electrode of the second diode (D23); -a second end of the first resistor (R21), -a second end of the first capacitor (C21), -a positive pole of the first diode (D21), and-a positive pole of the second diode (D23) -a ground level (GND).
In this scheme, the schmitt signal processing module:
The schmitt signal processing module is used for processing the key detection output signal and the key detection input signal into square waveforms, and specifically comprises the following steps: schmitt circuits or schmitt chips;
The schmitt circuit includes at least: a first triode (Q31), a second triode (Q32), a second resistor (R31), a third resistor (R32) and a fourth resistor (R33);
The base electrode of the first triode (Q31) is connected with the processing signal input end of the Schmitt circuit; the collector electrode of the first triode (Q31) is connected with the first end of the third resistor (R32); the collector of the second triode (Q32) is connected with the first end of the fourth resistor (R33) and the processing signal output end of the Schmitt circuit; a second end of the third resistor (R32) and a second end of the fourth resistor (R33) are connected with a power supply level (VCC); a first end of the second resistor (R31) is connected with an emitter of the first triode (Q31) and an emitter of the second triode (Q32); the second end of the second resistor (R31) is grounded to a ground level (GND).
In this scheme, communication isolation module includes:
the first communication interface circuit is an RS485 serial communication interface and comprises a communication input signal and a communication output signal;
And the photoelectric coupler is used for obtaining the communication input signal according to the output signal of the upper computer and obtaining the input signal of the upper computer according to the communication output signal.
The second aspect of the present invention also provides a method for controlling a mining keyboard and mouse, which is applied to any one of the above-mentioned mining keyboard and mouse control circuits, and specifically includes:
Obtaining key state information according to a preset key detection signal;
judging whether the key state information is in a pressed state or not;
if yes, acquiring first time information, sending a first communication instruction, and entering a key information transmission state;
judging whether the first time information exceeds a preset first time threshold value or not;
if yes, sending the key state information in the pressed state according to a third communication instruction, and judging whether the key state information is in the lifted state or not;
If yes, acquiring second time information, and judging whether the second time information exceeds a preset first time threshold;
if yes, sending the key state information in the lifting state according to the third communication instruction.
In this scheme, still include:
In a key information transmission state, when the key state information in a lifting state is sent according to the third communication instruction;
acquiring the second time information;
judging whether the second time information exceeds a preset second time threshold value or not;
If yes, a second communication instruction is sent to exit the key information transmission state;
the second communication instruction is a communication instruction for informing the upper computer to exit from the key information transmission state through information by the key mouse.
In this scheme, according to the button detection signal of predetermineeing, obtain button state information, specifically be:
starting a first timer to acquire third time information;
Judging whether the third time information is a third time threshold value or not;
if yes, setting the key detection output signal as a preset first level threshold value to obtain a key detection input signal;
judging whether the key detection input signal is a preset first level threshold value or not;
if yes, the key is in a pressed state;
If not, the key is in a lifting state;
Judging whether the third time information is a fourth time threshold value or not;
if yes, the key detection output signal is set to a preset second level threshold.
In this scheme, still include:
when entering a key information transmission state;
setting the first time period information as a preset first time period threshold;
According to the first time period information, a third communication instruction is sent according to a preset communication format;
The third communication instruction at least comprises 4 key grade information, wherein when the key grade information is 0, the sent key information is expressed as a lifting state.
In this scheme, still include:
When the key state information is in a pressed state;
setting key grade information according to the first time information and a preset time grade corresponding table
In this scheme, still include:
when the key state information of the first key is in a pressed state;
acquiring key state information of a second key;
judging whether the key state information of the second key is in a pressed state or not;
If yes, setting first mark information and setting key grade information of the second key to 0;
The first key is a key in any direction of the button type mouse;
The second key is a key with the opposite direction to the first key;
if yes, setting key grade information according to the first pressure information.
According to the control circuit and the method for the mining keyboard and mouse, key state information is obtained according to a preset key detection signal; if the key is in a pressed state, entering a key information transmission state, and sending the key state information in the pressed state through a third communication instruction according to the first time information; when the key is switched to the lifting state, sending the key state information in the lifting state through a third communication instruction according to the second time information; according to the invention, the stability of key scanning detection is improved through the filter circuit, the Schmidt conversion circuit and the optical coupler isolation circuit; through the key detection mode and the instruction communication mode, the use experience of the key mouse is improved while the key detection stability is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be considered as limiting the scope.
FIG. 1 shows a block diagram of a control circuit for a mining keyboard and mouse according to the present invention;
Fig. 2 shows a circuit connection structure diagram of the key filtering module according to an embodiment of the present invention;
fig. 3 shows a circuit connection structure diagram of the schmitt signal processing module according to an embodiment of the invention;
fig. 4 shows a connection structure diagram of the communication isolation module according to the embodiment of the present invention;
FIG. 5 shows a flowchart of the mining keyboard and mouse control method provided by the embodiment of the invention;
FIG. 6 is a flow chart illustrating communication state switching provided by an embodiment of the present invention;
fig. 7 shows a flowchart of a key scanning method according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Unless otherwise defined, all terms (including technical and scientific terms) used in the embodiments of the invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The terms "first," "second," and the like, as used in embodiments of the present invention, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. Nor does the terms "a," "an," or "the" or similar terms mean a limitation of quantity, but rather that at least one is present. Likewise, the word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The steps preceding or following the methods of embodiments of the present invention are not necessarily performed in a sequential order. Rather, the various steps may be processed in reverse order or simultaneously. Also, other operations may be added to or removed from these processes.
Referring to fig. 1, fig. 1 shows a block diagram of a control circuit for a mining keyboard and mouse according to the present invention.
As shown in fig. 1, the first aspect of the present invention discloses a mining keyboard and mouse control circuit, which comprises:
The key filtering module is used for acquiring a key detection input signal according to the key detection output signal and obtaining key state information;
The Schmitt signal processing module comprises a Schmitt circuit and is used for processing the key detection output signal and the key detection input signal to obtain square waveforms;
The communication isolation module comprises a photoelectric coupler and a first communication interface circuit, wherein an output signal of the upper computer obtains a communication input signal through the photoelectric coupler, and the communication output signal obtains the input signal of the upper computer through the photoelectric coupler.
It should be noted that the processor is an operation and control center of the button mouse control circuit, and is an execution unit for information processing and program running. The processor sends a key detection output signal to the Schmitt signal processing module according to a preset key detection program; and the Schmitt signal processing module processes the key detection output signal to obtain a square waveform with standard stroke and is used for driving a key detection function. Because of square waveform driving of the key detection output signals, the keys generate key detection input signals corresponding to key states, that is, when the keys are respectively in a pressed state and a lifted state, the keys respectively correspond to different key detection input signals. The key detection input signal is subjected to filtering treatment by the key filtering module, so that signal interference on equipment caused by a mine environment can be effectively reduced; and the key detection input signal after the filtering processing is transmitted into another Schmitt signal processing module to generate a square waveform corresponding to the key detection input signal, so that the square waveform is received and identified by the processor, and the stability of signal transmission and identification is improved. The processor sends data to be transmitted to an upper computer, usually mining computer equipment, according to a preset communication instruction through the communication isolation module. In the communication isolation module, the stability of the button-type mouse communication is ensured by utilizing the anti-interference capability and the long-distance transmission capability of the RS485 serial interface through the arranged RS485 serial interface; in addition, the photoelectric coupler is also arranged to isolate the electric signal of the upper computer from the electric signal of the button mouse, so that the working voltage of the button mouse is prevented from being influenced by the voltage instability of other equipment. The invention adopts the keys to control the movement of the mouse, replaces the common roller or the photoelectric mouse, and can effectively avoid disordered movement of the mouse caused by mechanical vibration, signal interference and the like in the severe environment of a mine.
Referring to fig. 2, fig. 2 shows a circuit connection structure diagram of the key filtering module according to an embodiment of the present invention.
According to an embodiment of the present invention, the key filtering module includes:
The key filtering module is used for detecting the key state; at least comprises the following steps: a first key (S21), a first resistor (R21), a first capacitor (C21), a first diode (D21) and a second diode (D23);
a first end of the first key (S21) is connected with the key detection output signal and the cathode of the second diode (D23); the second end of the first key (S21) is connected with the key detection input signal, the first end of the first resistor (R21), the first end of the first capacitor (C21) and the negative electrode of the second diode (D23); -a second end of the first resistor (R21), -a second end of the first capacitor (C21), -a positive pole of the first diode (D21), and-a positive pole of the second diode (D23) -a ground level (GND).
It should be noted that, the keys of the invention adopt array scanning, and two ends of any key are respectively connected with different key detection output signals and key detection input signals. For example, when the keys are arranged in a combination of M rows and N columns, at most m×n keys can be detected and identified; at this time, M key detection output signals and N key detection input signals are set; if the key numbered (m, n) in the key array is pressed, when the mth key detection output signal outputs a designated level, the nth key detection input signal can obtain the level corresponding to the key detection output signal. The circuit of the invention carries out signal filtering on each path of key input detection signals through RC filtering so as to avoid abrupt signal change interference of the mine environment on the equipment circuit. In addition, the first diode (D21) and the second diode (D23) are ESD protection diodes dedicated to protecting the circuit from overvoltage surges, in particular electrostatic discharge events. Because of the characteristics of long-time accumulation, high voltage, low electric quantity, small current and short acting time of static electricity, damage or misoperation of electronic equipment can be caused, electromagnetic interference is caused, fire hazard, explosion and other hazards are caused, and the ESD protection diodes are arranged on the key detection output signal and the key detection input signal in the circuit, so that the anti-interference capability of the signal circuit can be effectively enhanced, and the stability of key detection is improved.
Referring to fig. 3, fig. 3 shows a circuit connection structure diagram of the schmitt signal processing module according to an embodiment of the invention.
According to the embodiment of the invention, the schmitt signal processing module is as follows:
The schmitt signal processing module is used for processing the key detection output signal and the key detection input signal into square waveforms, and specifically comprises the following steps: schmitt circuits or schmitt chips;
The schmitt circuit includes at least: a first triode (Q31), a second triode (Q32), a second resistor (R31), a third resistor (R32) and a fourth resistor (R33);
The base electrode of the first triode (Q31) is connected with the processing signal input end of the Schmitt circuit; the collector electrode of the first triode (Q31) is connected with the first end of the third resistor (R32); the collector of the second triode (Q32) is connected with the first end of the fourth resistor (R33) and the processing signal output end of the Schmitt circuit; a second end of the third resistor (R32) and a second end of the fourth resistor (R33) are connected with a power supply level (VCC); a first end of the second resistor (R31) is connected with an emitter of the first triode (Q31) and an emitter of the second triode (Q32); the second end of the second resistor (R31) is grounded to a ground level (GND).
In practical applications, for example, in an electronic circuit voltage system with 5V, the processor usually recognizes a voltage value of 0V to 0.8V as a low level, and recognizes a voltage value of 2.5V to 5V as a high level; then the voltage value is considered to be unstable when it is between 0.8V and 2.5V. Because the key circuit is provided with the filter, the key detection signal is likely to pass through the unstable state in the switching process. The circuit of the invention ensures that the key detection signal only has a low level or high level state by arranging the Schmitt signal processing module. As shown in fig. 3, when the voltage of the processing signal input terminal of the schmitt signal processing circuit is lower than the on voltage of the first triode (Q31), the first triode (Q31) is in an off state, the second triode (Q32) is in an on state, and the level of the processing signal output terminal is determined by the voltage division of the second resistor (R31) and the fourth resistor (R33), and is usually set to a voltage value in a low level state; when the voltage of the processing signal input end of the Schmitt signal processing circuit is not lower than the conducting voltage of the first triode (Q31), the first triode (Q31) is in a conducting state, the second triode (Q32) is in a cut-off state, and the processing signal output end outputs a high level, namely a VCC level state. Therefore, the key detection output signal and the key detection input signal are processed into only a high level or low level state, that is, a square wave signal by the schmitt signal processing module, so that detection abnormality caused by an unstable state is reduced.
Referring to fig. 4, fig. 4 shows a connection structure diagram of the communication isolation module according to an embodiment of the present invention.
According to an embodiment of the present invention, the communication isolation module includes:
the first communication interface circuit is an RS485 serial communication interface and comprises a communication input signal and a communication output signal;
And the photoelectric coupler is used for obtaining the communication input signal according to the output signal of the upper computer and obtaining the input signal of the upper computer according to the communication output signal.
RS485 is a serial communication standard, which specifies a specification of multipoint communication with 2-wire, half-duplex, and balanced transmission lines, and is particularly suitable for long-distance and high-efficiency communication in an environment with electronic noise. The anti-interference capability and the long-distance transmission capability of the RS485 serial interface are utilized to ensure the stability of the button-type mouse communication. The photoelectric coupler, also called an optocoupler, is a device for transmitting and converting electric signals by using light as a medium. When the electric signal of the input end changes, the luminous source can emit corresponding optical signals, and the optical signals are transmitted to the light receiver through the transparent insulator and then converted into the electric signal of the output end. The electric signals at two ends of communication are isolated through the optical coupler, namely, the direct conduction between the electric signal of the upper computer and the electric signal of the button mouse is isolated, so that the influence of the upper computer equipment on the button mouse circuit is avoided.
It is worth mentioning that the method further comprises:
And the pressure sensor is used for acquiring the pressure value applied by the key and perpendicular to the pressure sensor.
A pressure sensor is provided below the key for measuring a pressure value applied to the key perpendicular to the pressure sensor. The button mouse is provided with different pressure values corresponding to different working states, so that the flexibility of button operation is enhanced, and the use experience of a user is improved.
Referring to fig. 5, fig. 5 shows a flowchart of the method for controlling a mining keyboard and mouse according to an embodiment of the present invention.
As shown in fig. 5, the second aspect of the present invention discloses the mining keyboard and mouse control method, which comprises:
s502, obtaining key state information according to a preset key detection signal;
s504, judging whether the key state information is in a pressed state;
s506, if yes, acquiring first time information, sending a first communication instruction, and entering a key information transmission state;
S508, judging whether the first time information exceeds a preset first time threshold value;
s510, if yes, sending the key state information in a pressed state according to a third communication instruction, and judging whether the key state information is in a lifted state or not;
s512, if yes, acquiring second time information, and judging whether the second time information exceeds a preset first time threshold;
And S514, if yes, sending the key state information in the lifted state according to the third communication instruction.
The key state information is the working state of a key of the key type mouse, and comprises a pressing state and a lifting state; the first time information is timing time of a key in a pressed state; the second time information is timing time when the key is in a lifting state; the first communication instruction is a communication instruction for informing the upper computer to enter a key information transmission state through information by the key mouse; and the third communication instruction is a communication instruction for uploading the key state information represented by the key level information to the upper computer by the key mouse when the key information is transmitted. And sending a preset key detection signal according to the scanning process of the array type keys to obtain key state information and judging whether the keys are in a pressed state or not. If yes, recording first time information, namely the timing time of the key in the pressed state, and sending a first communication instruction to the upper computer to indicate that the key information transmission state is entered. Then executing a key jitter elimination program, judging whether the first time information exceeds a preset first time threshold value, if so, indicating that the key is not an input signal generated by jitter, and sending an instruction that the key is in a pressed state to an upper computer through a third communication instruction. Finally, continuously detecting whether the key is released, namely judging whether the lifting is in a lifting state, if so, recording second time information, and when the second time information exceeds a preset first time threshold value, indicating that the key is thoroughly released; at this time, an instruction that the key is in a lifted state is sent to the upper computer through the third communication instruction. According to the invention, through the delay judgment and the continuously transmitted third communication instruction, the key detection is ensured to be stable, the real-time communication with the upper computer is maintained, and the sensitivity of key feedback is improved.
Referring to fig. 6, fig. 6 is a flowchart illustrating communication status switching according to an embodiment of the present invention.
According to an embodiment of the present invention, further comprising:
S602, in a key information transmission state, when the key state information in a lifting state is sent according to the third communication instruction;
s604, acquiring the second time information;
s606, judging whether the second time information exceeds a preset second time threshold value;
s608, if yes, a second communication instruction is sent to exit the key information transmission state.
It should be noted that, the second communication instruction is a communication instruction that the key-type mouse notifies the upper computer to exit from the key information transmission state through information. When the key is still in the key information transmission state, a third communication instruction is continuously sent, and when the key is switched from the pressing state to the lifting state, namely, the case state sent by the third communication instruction is switched from the pressing state to the lifting state, the second time information is recorded. And when the second time information exceeds a preset second time threshold value, the fact that no key is in a pressed state is indicated, and continuous communication is not required to be maintained. Therefore, a second communication instruction is sent to the upper computer to indicate that the key information transmission state is exited. Through communication state switching, namely when the key is in a pressed state, continuous communication keeps the sensitivity of key state transmission; when the key is in the lifting state, the key is withdrawn from the communication state, so that the energy consumption in the communication process is reduced, and the service life of the communication serial port is prevented from being reduced due to heating caused by continuous operation of the communication serial port.
Referring to fig. 7, fig. 7 shows a flowchart of a key scanning method according to an embodiment of the invention.
According to the embodiment of the invention, the key state information is obtained according to the preset key detection signal, specifically:
S702, starting a first timer to acquire third time information;
s704, judging whether the third time information is a third time threshold value;
s706, if yes, setting the key detection output signal as a preset first level threshold value to obtain a key detection input signal;
S708, judging whether the key detection input signal is a preset first level threshold value;
S710, if yes, the key is in a pressed state;
S712, if not, the key is in a lifted state;
S714, judging whether the third time information is a fourth time threshold;
s716, if yes, setting the key detection output signal to a preset second level threshold.
The third time information is timing information, and is used for setting the level of the key detection output signal. The first timer is an interface for timing counting of a processor of the button type mouse and can be used for acquiring timing information. For array keys, a detection output signal is typically sent to each row or each column sequentially, and then the detection input signal of each column or each row is read, for example, a key detection output signal is sent to the a-th row, and if the B-th row receives a specified key detection input signal, the key with the coordinates of the a-th row and the B-th column is in a pressed state. The invention sets the working level of the key detection output signal through the third time information. Firstly, when the third time information is preset third time information, the preset first level threshold value is set for the set row or column output signals, namely the set row or column key detection output signals; the first level threshold is usually a high level, and may also be a ground level. Then, judging whether the key detection input signal of the set column or row is a first level threshold value; if yes, the key is in a pressed state; if not, the key is in a lifted state. Finally, judging whether the third time information is a fourth time threshold value, if so, indicating that the detection of the set row or column is completed, and setting the key detection output signal of the corresponding row or column as a second level threshold value; wherein the second level threshold is a level state opposite to the first level threshold.
In an embodiment of the present invention, the method further includes:
when entering a key information transmission state;
setting the first time period information as a preset first time period threshold;
According to the first time period information, a third communication instruction is sent according to a preset communication format;
The third communication instruction at least comprises 4 key grade information, wherein when the key grade information is 0, the sent key information is expressed as a lifting state.
The first time period information is a time period for the button mouse to send the third communication command to the upper computer, and the longer the time period is, the longer the sending interval of the third communication command is. When the key information transmission state is entered, the first time period information is firstly set as a preset first time period threshold value, and the set communication speed is used for sending the key information to the upper computer, so that the feedback sensitivity is ensured. The third communication instruction at least comprises grade information of 4 keys; wherein, 4 keys can respectively represent 4 directions up, down, left and right; the key rank information is a rank state of key depression for increasing operability of keys. As an embodiment, the key level information indicates a level of the upper computer for a pixel point where the mouse moves, and indicates that 0 pixel point is moved each time when the key level is 0, and indicates that 1 pixel point is moved each time when the key level is 1. As another embodiment, when the key level information is 0, it indicates that the key is not pressed; when the key level information is 1, the key is in a normal pressing state; and when the key level information is 2, the key is in a continuously pressed state.
In an embodiment of the present invention, the method further includes:
When the key state information is in a pressed state;
setting key grade information according to the first time information and a preset time grade corresponding table
It should be noted that, when the key state information is in the pressed state and the first time information exceeds the preset time threshold, it may indicate that the key is in the long pressed state. When the key is in the long-press state, the key grade information of the key can be set according to a preset time grade corresponding table at the moment so as to improve the expansibility of key operation. For example, the larger the first time information is, the higher the key level information is, the faster the mouse moving speed identified by the upper computer is, so that the user can quickly move the mouse pointer in the upper computer to a set position, and the use experience of the user is improved.
In an embodiment of the present invention, the method further includes:
when the key state information of the first key is in a pressed state;
acquiring key state information of a second key;
judging whether the key state information of the second key is in a pressed state or not;
if yes, setting the first mark information, and setting the key grade information of the second key to 0.
It should be noted that, the first key is a key in any direction of the button mouse; the second key is a key with the opposite direction to the first key. When the two opposite keys are in the pressed state, the key grade information of the first key which is recognized first is kept, and the key grade information of the second key which is recognized later is set to 0 and the first mark information is recorded. Because of the manner in which the array-type keys are scanned, there must be a precedence relationship in key detection, that is, there is no physically simultaneous pressing.
It is worth mentioning that the method further comprises:
When the key information transmission state is exited;
Judging whether the second time information exceeds a preset fifth time threshold value;
If yes, adjusting the key scanning time period information according to the second time information.
It should be noted that, when the key information transmission state is exited, the key is in the lifted state, and if the second time information exceeds the preset fifth time threshold, it indicates that the key is in the state of not being pressed for a long time. Under the above circumstances, the invention achieves the effect of reducing power consumption by increasing the key scanning time period information, that is, reducing the output frequency of the key detection output signal.
It is worth mentioning that the method further comprises:
after the third communication instruction is sent, fourth time information is obtained;
Judging whether to acquire feedback information of the third communication instruction;
if yes, the fourth time information is cleared;
if not, judging whether the fourth time information exceeds a preset sixth time threshold;
if yes, setting second mark information for recording the overlapped key grade information.
The fourth time information is a time count after the button mouse sends the third communication instruction to the upper computer. And when receiving the feedback information of the third communication instruction, indicating that the communication is normal, resetting the fourth time information. When the third communication instruction feedback information is not received and the fourth time information exceeds the preset sixth time threshold, the instruction reception abnormality is indicated, and the upper computer can be determined to not receive the current third communication instruction. At this time, second flag bit information is set, and key level information is set according to superposition of the second flag bit information for sending to the upper computer in the next round of third communication instruction. For example, when the upper computer does not receive a communication instruction with the current key level information of 1, an instruction for losing 1 pixel point movement exists; therefore, according to the second flag bit, the key level information is set to be 2, and the upper computer receives the key level of 2 in the next communication, so that the pixel point moving instruction lost by the previous instruction can be complemented.
It is worth mentioning that the method further comprises:
judging whether the key is in a continuous pressing state according to the first time information and the second time information;
If yes, a fourth communication instruction is sent.
It should be noted that, according to the time of pressing the key and the time of lifting the key, it is determined whether the key is in the continuous pressing state, that is, the key is changed from the lifting state to the pressing state, and at least 2 rounds of switching are performed. In the embodiment of the invention, a fourth communication instruction is sent to the upper computer for representing the operation of setting the mouse to the top; the mouse top-setting operation is to move the mouse cursor of the upper computer to the extreme point of the direction pointed by the key, for example, when the direction of the key is pointed upwards, the mouse cursor is moved to the extreme top of the upper computer.
It is worth mentioning that the method further comprises:
when the key state information is in a pressed state;
acquiring first pressure information;
Judging whether the first pressure information exceeds a preset pressure threshold value or not;
if yes, setting key grade information according to the first pressure information.
It should be noted that, in the embodiment of the present invention, when the first pressure information exceeds the preset pressure threshold, it is determined that the user wants to increase the movement speed of the mouse in the upper computer. Therefore, the invention is set to the key grade information according to the size of the first pressure information and is used for informing the upper computer to adjust the moving speed of the mouse cursor, thereby improving the use experience of the user.
In summary, according to the control circuit and method for the mining keyboard and mouse provided by the invention, key state information is obtained according to the preset key detection signal; if the key is in a pressed state, entering a key information transmission state, and sending the key state information in the pressed state through a third communication instruction according to the first time information; when the key is switched to the lifting state, sending the key state information in the lifting state through a third communication instruction according to the second time information; according to the invention, the stability of key scanning detection is improved through the filter circuit, the Schmidt conversion circuit and the optical coupler isolation circuit; through the key detection mode and the instruction communication mode, the use experience of the key mouse is improved while the key detection stability is improved.
In addition, functional modules in the embodiments of the present invention may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. The mining keyboard and mouse control circuit is characterized by comprising:
the key filtering module is used for obtaining a key detection input signal according to a key detection output signal and obtaining key state information, wherein the key detection input signal at least comprises a first key (S21), a first resistor (R21), a first capacitor (C21), a first diode (D21) and a second diode (D23);
A first end of the first key (S21) is connected with the key detection output signal and the cathode of the second diode (D23); the second end of the first key (S21) is connected with the key detection input signal, the first end of the first resistor (R21), the first end of the first capacitor (C21) and the negative electrode of the second diode (D23); -a second end of the first resistor (R21), a second end of the first capacitor (C21), an anode of the first diode (D21) and an anode ground level (GND) of the second diode (D23);
The Schmitt signal processing module is used for processing the key detection output signal and the key detection input signal to obtain square waveforms, and comprises a Schmitt circuit or a Schmitt chip;
The schmitt circuit includes at least: a first triode (Q31), a second triode (Q32), a second resistor (R31), a third resistor (R32) and a fourth resistor (R33);
The base electrode of the first triode (Q31) is connected with the processing signal input end of the Schmitt circuit; the collector electrode of the first triode (Q31) is connected with the first end of the third resistor (R32); the collector of the second triode (Q32) is connected with the first end of the fourth resistor (R33) and the processing signal output end of the Schmitt circuit; a second end of the third resistor (R32) and a second end of the fourth resistor (R33) are connected with a power supply level (VCC); a first end of the second resistor (R31) is connected with an emitter of the first triode (Q31) and an emitter of the second triode (Q32); -a second ground level (GND) of said second resistor (R31);
The communication isolation module comprises a photoelectric coupler and a first communication interface circuit, wherein an upper computer output signal obtains a communication input signal through the photoelectric coupler, and the communication output signal obtains an upper computer input signal through the photoelectric coupler;
The first communication interface circuit is an RS485 serial communication interface and comprises a communication input signal and a communication output signal;
And the photoelectric coupler is used for obtaining the communication input signal according to the output signal of the upper computer and obtaining the input signal of the upper computer according to the communication output signal.
2. A mining keyboard and mouse control method applied to the mining keyboard and mouse control circuit as claimed in claim 1, which is characterized by comprising the following steps:
Obtaining key state information according to a preset key detection signal;
judging whether the key state information is in a pressed state or not;
if yes, acquiring first time information, sending a first communication instruction, and entering a key information transmission state;
judging whether the first time information exceeds a preset first time threshold value or not;
if yes, sending the key state information in the pressed state according to a third communication instruction, and judging whether the key state information is in the lifted state or not;
If yes, acquiring second time information, and judging whether the second time information exceeds a preset first time threshold;
if yes, sending the key state information in the lifting state according to the third communication instruction;
the key state information is the working state of keys of the key type mouse, and comprises a pressing state and a lifting state;
The first time information is timing time of a key in a pressed state;
the second time information is timing time when the key is in a lifting state;
The first communication instruction is a communication instruction for informing the upper computer to enter a key information transmission state through information by the key mouse;
And the third communication instruction is a communication instruction for uploading the key state information represented by the key level information to the upper computer by the key mouse when the key information is transmitted.
3. The mining keyboard and mouse control method according to claim 2, further comprising:
In a key information transmission state, when the key state information in a lifting state is sent according to the third communication instruction;
acquiring the second time information;
judging whether the second time information exceeds a preset second time threshold value or not;
If yes, a second communication instruction is sent to exit the key information transmission state;
the second communication instruction is a communication instruction for informing the upper computer to exit from the key information transmission state through information by the key mouse.
4. The method for controlling a mining keyboard and mouse according to claim 2, wherein the key state information is obtained according to a preset key detection signal, specifically:
starting a first timer to acquire third time information;
Judging whether the third time information is a third time threshold value or not;
if yes, setting the key detection output signal as a preset first level threshold value to obtain a key detection input signal;
judging whether the key detection input signal is a preset first level threshold value or not;
if yes, the key is in a pressed state;
If not, the key is in a lifting state;
Judging whether the third time information is a fourth time threshold value or not;
If yes, setting the key detection output signal as a preset second level threshold;
the third time information is timing information for setting the level of the key detection output signal.
5. The mining keyboard and mouse control method according to claim 2, further comprising:
when entering a key information transmission state;
setting the first time period information as a preset first time period threshold;
According to the first time period information, a third communication instruction is sent according to a preset communication format;
the third communication instruction at least comprises 4 key grade information, wherein when the key grade information is 0, the transmitted key information is expressed as a lifting state;
The first time period information is a time period of the button mouse sending a third communication instruction to the upper computer.
6. The mining keyboard and mouse control method according to claim 2, further comprising:
When the key state information is in a pressed state;
And setting key grade information according to the first time information and a preset time grade corresponding table.
7. The mining keyboard and mouse control method according to claim 2, further comprising:
when the key state information of the first key is in a pressed state;
acquiring key state information of a second key;
judging whether the key state information of the second key is in a pressed state or not;
If yes, setting first mark information and setting key grade information of the second key to 0;
The first key is a key in any direction of the button type mouse;
The second key is a key with the opposite direction to the first key;
if yes, setting key grade information according to the first pressure information.
CN202410366484.5A 2024-03-28 2024-03-28 Control circuit and method for mining keyboard and mouse Active CN117971052B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410366484.5A CN117971052B (en) 2024-03-28 2024-03-28 Control circuit and method for mining keyboard and mouse

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410366484.5A CN117971052B (en) 2024-03-28 2024-03-28 Control circuit and method for mining keyboard and mouse

Publications (2)

Publication Number Publication Date
CN117971052A CN117971052A (en) 2024-05-03
CN117971052B true CN117971052B (en) 2024-06-07

Family

ID=90853731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410366484.5A Active CN117971052B (en) 2024-03-28 2024-03-28 Control circuit and method for mining keyboard and mouse

Country Status (1)

Country Link
CN (1) CN117971052B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102566868A (en) * 2010-12-24 2012-07-11 北京普源精电科技有限公司 Method and device for treating mouse drawn wave
CN106383462A (en) * 2016-08-22 2017-02-08 浙江火山电气科技有限公司 Intelligent controller and data processing method
CN109639263A (en) * 2019-02-01 2019-04-16 南宁学院 A kind of matrix keyboard circuit with hardware for jitters elimination and interrupt signal
CN212832208U (en) * 2020-05-12 2021-03-30 国能荥阳热电有限公司 Portable non-contact elevator button device based on photoelectric effect
CN116126152A (en) * 2023-03-14 2023-05-16 南京信息工程大学 Keyboard control system and method based on single chip microcomputer
CN220252543U (en) * 2023-07-01 2023-12-26 深圳市达沃电子有限公司 High aircraft of security detects keyboard

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102566868A (en) * 2010-12-24 2012-07-11 北京普源精电科技有限公司 Method and device for treating mouse drawn wave
CN106383462A (en) * 2016-08-22 2017-02-08 浙江火山电气科技有限公司 Intelligent controller and data processing method
CN109639263A (en) * 2019-02-01 2019-04-16 南宁学院 A kind of matrix keyboard circuit with hardware for jitters elimination and interrupt signal
CN212832208U (en) * 2020-05-12 2021-03-30 国能荥阳热电有限公司 Portable non-contact elevator button device based on photoelectric effect
CN116126152A (en) * 2023-03-14 2023-05-16 南京信息工程大学 Keyboard control system and method based on single chip microcomputer
CN220252543U (en) * 2023-07-01 2023-12-26 深圳市达沃电子有限公司 High aircraft of security detects keyboard

Also Published As

Publication number Publication date
CN117971052A (en) 2024-05-03

Similar Documents

Publication Publication Date Title
US8253530B2 (en) Keyboard for powering on or off computer
CN110476143B (en) Discrete high impedance implementation on push-pull output
US10289221B2 (en) Electrostatic pen
CN102075194B (en) Circuit and method for scanning keyboard and electronic equipment
US7466305B2 (en) Method and related apparatus for decreasing delay time and power consumption of a wireless mouse
CN103678226A (en) General purpose input/output (GPIO) port reuse circuit and method of chip
CN117971052B (en) Control circuit and method for mining keyboard and mouse
EP0689737A4 (en) Inductively coupled keyboard
CN103823540A (en) Starting-up control circuit
CN201122942Y (en) Reset circuit
CN202339631U (en) Transmitting and learning control circuit of remote control, remote control and tablet computer
CN103905025A (en) Shockproof type sensing touch switch and control method
US20130283077A1 (en) Wake-up circuit and electronic device
US8598979B2 (en) Keyboard
CN206931197U (en) A kind of low power consumption switch system based on wireless encoding decoding chip
CN102890650A (en) Operation state indication circuit for electronic equipment
CN203013261U (en) Intelligent mobile hard disk
CN103686010A (en) ADC port simulation multi-IO-port key input device, television-system and method
CN201966879U (en) Reset circuit
US20120169599A1 (en) Wireless mouse
CN201928255U (en) Household electronic appliance automation wire holder with sending data line management by serial port
CN203608276U (en) ADC port simulated multi-IO port key input device and television system
CN102932687A (en) Method and system for realizing mouse function by using television infrared receiving head
KR100784964B1 (en) The infrared data transmission method for remote control of multimedia devices
CN211151947U (en) Low-cost level conversion circuit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant