CN204131504U - A kind of key circuit of real-time detection button trigger state and game paddle - Google Patents

A kind of key circuit of real-time detection button trigger state and game paddle Download PDF

Info

Publication number
CN204131504U
CN204131504U CN201420442872.9U CN201420442872U CN204131504U CN 204131504 U CN204131504 U CN 204131504U CN 201420442872 U CN201420442872 U CN 201420442872U CN 204131504 U CN204131504 U CN 204131504U
Authority
CN
China
Prior art keywords
trigger
input
button
output
circuit
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
CN201420442872.9U
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.)
Weifang Goertek Electronics Co Ltd
Original Assignee
Weifang Goertek 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 Weifang Goertek Electronics Co Ltd filed Critical Weifang Goertek Electronics Co Ltd
Priority to CN201420442872.9U priority Critical patent/CN204131504U/en
Application granted granted Critical
Publication of CN204131504U publication Critical patent/CN204131504U/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Input From Keyboards Or The Like (AREA)

Abstract

The utility model discloses a kind of key circuit and game paddle of real-time detection button trigger state.This key circuit can detect 2 nthe trigger state of individual button, comprising: MCU, counter, data selector, OR circuit and comprise 2 nthe push-button unit of individual button, wherein, N be more than or equal to 2 positive integer.This game paddle comprises this key circuit.The technical solution of the utility model is when only using three input/output ports of MCU, effectively detecting in real time some button trigger state can be realized, save the I/O port resource of MCU, reduce circuit production cost, improve circuit working efficiency.

Description

A kind of key circuit of real-time detection button trigger state and game paddle
Technical field
The utility model relates to circuit design field, is specifically related to a kind of key circuit and game paddle of real-time detection button trigger state.
Background technology
Key circuit is topmost man-machine interaction input mode in micro-control unit MCU application system, it reasonably designs, not only can save the design cost of system, the operation of instrument and equipment more can be made to become more simple, conveniently, improve overall system performance to a great extent.
Current modal key circuit is roughly divided into two kinds: connect one to one and be connected with matrix form.Connection is exactly the input port of the direct corresponding MCU of a button one to one, such circuit is simply direct, directly can use when the less port number of number of keys is rich, but the I/O port resource of a large amount of MCU can be taken when number of keys is more, cause the reduction of system works efficiency; Matrix form connection refers to and the mode of button by line-column matrix is arranged, wherein every public line of a line, and each arranges a public alignment, if the line number that matrix form connects is x, columns is y, uses N respectively by bond number and required port number sand N i/Orepresent, have:
N S=x*y
N I/O=x+y
Can find out, compared with man-to-man direct connected mode, the port number shared by matrix form connects has had suitable minimizing.If key circuit needs 16 buttons, need 16 ports by the words that mode connects one to one, and connect only needs 8 ports by matrix form.
Nonetheless, the matrix form of key circuit connects the demand of electronic information technology to port resource that more and more cannot meet high speed development, how to reduce key circuit taking I/O port to greatest extent, and how reduce key circuit taking memory and calculation resources by processing procedure of simplifying procedures, be one of current study hotspot.
Summary of the invention
In view of the above problems, the utility model provides a kind of key circuit and game paddle of real-time detection button trigger state, to solve the problem or to solve the problem at least in part.
According to an aspect of the present utility model, provide a kind of key circuit of real-time detection button trigger state, this key circuit can detect 2 nthe trigger state of individual button, this key circuit comprises: micro-control unit MCU, counter, data selector, OR circuit and comprise 2 nthe push-button unit of individual button, N be more than or equal to 2 positive integer;
First input/output terminal of described micro-control unit MCU is connected with the output of described OR circuit, second input/output terminal of described micro-control unit MCU is connected with the output of described data selector, and the 3rd input/output terminal of described micro-control unit MCU is connected with the input of described counter;
Described counter comprises N position output, and this N position output is connected with the address choice end of described data selector and the input of described OR circuit;
Described data selector is 1/2 ndata selector, they are 2 years old nindividual input and described 2 nindividual button one_to_one corresponding is connected.
Alternatively, described counter comprises: N-1 trigger;
The input of a described N-1 trigger all connects high level;
A described N-1 trigger is connected successively, and the output wherein going up a trigger is connected with the trigger end of adjacent next trigger, and the trigger end of first trigger of series connection is connected with the 3rd input/output terminal of described micro-control unit MCU;
The N position output of described counter is made up of the 3rd input/output terminal of described micro-control unit MCU and the output of a described N-1 trigger.
Alternatively, described trigger is JK flip-flop; Or described trigger is T trigger.
Alternatively, described push-button unit comprises further: 2 nindividual pull-up resistor;
Described 2 none termination high level of individual pull-up resistor, 2 of its other end and described data selector nindividual input one_to_one corresponding is connected.
According to another aspect of the present utility model, provide a kind of game paddle, this game paddle comprises described key circuit.
In sum, technical scheme provided by the utility model is when only using three input/output ports of MCU, effectively detecting in real time some button trigger state can be realized, save the input/output port resource of MCU, reduce the production cost of circuit, improve the operating efficiency of circuit.
Accompanying drawing explanation
Fig. 1 shows the structural diagrams intention of the key circuit of a kind of real-time detection button trigger state according to the utility model embodiment;
Fig. 2 shows the circuit structure diagram schematic diagram of the key circuit of a kind of real-time detection button trigger state according to another embodiment of the utility model;
Fig. 3 shows the activation schedule schematic diagram according to another embodiment of the utility model;
Fig. 4 shows the structural representation of a kind of game paddle according to the utility model embodiment;
Embodiment
For making the purpose of this utility model, technical scheme and advantage clearly, below in conjunction with accompanying drawing, the utility model execution mode is described in further detail.
Fig. 1 shows the structural representation of the key circuit of a kind of real-time detection button trigger state according to the utility model embodiment.As shown in Figure 1, this key circuit comprises: micro-control unit MCU, counter, data selector, OR circuit and comprise 2 nthe push-button unit of individual button, N be more than or equal to 2 positive integer.
First input/output terminal of micro-control unit MCU is connected with the output of OR circuit, second input/output terminal of micro-control unit MCU is connected with the output of data selector, and the 3rd input/output terminal of micro-control unit MCU is connected with the input IN of counter; Counter comprises N position output, the address choice end of this N position output and data selector, and the input of OR circuit is connected; Data selector is 1/2 ndata selector, they are 2 years old nindividual input and 2 nindividual button one_to_one corresponding is connected.
Wherein, 3rd input/output terminal of micro-control unit MCU is used for exporting triggering signal to counter, counter exports N position and outputs signal the address choice end of data selector and the input of OR circuit under the effect of this triggering signal, second input/output terminal of corresponding key-press status to micro-control unit MCU is exported under the effect that data selector outputs signal in this N position, second input/output terminal of micro-control unit MCU is for detecting key-press status, first input/output terminal of synchronizing signal to micro-control unit MCU is exported under the effect that OR circuit outputs signal in this N position, first input/output terminal of micro-control unit MCU is for detecting synchronizing signal to know each beginning taking turns button detection or end.
From the above, technical scheme provided by the utility model is when only using three input/output ports of micro-control unit MCU, effectively detecting in real time some button trigger state can be realized, save the input/output port resource of MCU, reduce the production cost of circuit, improve the operating efficiency of circuit.
Fig. 2 shows the electrical block diagram of the key circuit of a kind of real-time detection button trigger state according to another embodiment of the utility model.In the present embodiment, as shown in Figure 2, this key circuit comprises: micro-control unit MCU, the first trigger J1, the second trigger J2, data selector MUX, OR circuit M, 8 button S1-S8 and 8 pull-up resistor R1-R8.
First input/output terminal of micro-control unit MCU is connected with the output of OR circuit M; Second input/output terminal of micro-control unit MCU is connected with the output of data selector MUX; 3rd input/output terminal of micro-control unit MCU is connected with the 3rd address choice end of the trigger end of the first trigger J1, data selector MUX and the input of OR circuit M; The input of the first trigger J1 and the second trigger J2 all connects high level; The output of the first trigger J1 is connected with the second address choice end of the trigger end of the second trigger J2, data selector MUX and the input of OR circuit M; The output of the second trigger J2 is connected with the input of the first address choice end of data selector MUX and OR circuit; 8 inputs of data selector MUX and one end of 8 button S1-S8, and one end one_to_one corresponding of 8 pull-up resistor R1-R8 is connected; The other end common ground of 8 button S1-S8; The other end of 8 pull-up resistor R1-R8 all connects high level.
In the present embodiment, the first trigger J1 is set and the second trigger J2 is JK flip-flop, the input of the two is all connect high level, make trigger after each triggering signal effect export the output signal contrary with preceding state.3 outputs of previously described counter are together constituted by the output of the 3rd input/output terminal of micro-control unit MCU, the output of the first trigger J1 and the second trigger J2, that is, this three together constitutes the 3 bit address selecting sides of data selector MUX, data selector by the signal condition exported with this three for according to selecting corresponding button trigger state.
Fig. 3 shows the sequential chart exporting 3 signal conditions according to the counter of another embodiment of the utility model.The triggering signal that 3rd input/output terminal of the micro-control unit MCU shown in Fig. 2 exports, the timing variations of the output signal of the first trigger J1 and the output signal of the second trigger J2 are as shown in Figure 3, in the present embodiment, first, the triggering signal that the 3rd input/output terminal arranging micro-control unit MCU exports is square-wave signal, be called the first square-wave signal, the cycle is T1; Secondly, the initial condition of triggering signal, the output signal of the first trigger J1 and the output signal of the second trigger J2 that the 3rd input/output terminal arranging micro-control unit MCU exports is low level; Finally, the first trigger J1 is set and the second trigger J2 is that triggering signal trailing edge is effective.
As shown in Figure 3, under the effect of the square-wave signal of the 3rd input/output terminal output of micro-control unit MCU, the output signal of the first trigger J1 overturns at each trailing edge of the first square-wave signal, the square-wave signal that the formation cycle is double, be called the second square-wave signal, the cycle is T2; The output signal of the second trigger J2 overturns at each trailing edge of the second square-wave signal, the square-wave signal that the formation cycle is again double, and be called third party's ripple signal, the cycle is T3.Wherein,
T3=2*T2=4*T1
Therefore, in time domain, 3 output signals of the second square-wave signal that the first square-wave signal exported by the 3rd input/output terminal of micro-control unit MCU, the first trigger J1 export and the counter mentioned above that third party's ripple signal that the second trigger J2 exports is formed are followed successively by: 000,100,010,110,001,101,011,111.
Circuit connecting mode according to Fig. 2, because the 3rd input/output terminal of micro-control unit MCU is connected with the 3rd address choice end of data selector MUX, the output of the first trigger J1 is connected with the second address choice end of data selector MUX, and the output of the second trigger J2 is connected with the first address choice end of data selector MUX, the address signal that therefore corresponding data selector receives is followed successively by:
000, now, data selector MUX selects first passage D0, and namely the first button S1 is selected, and micro-control unit MCU detects the trigger state of the first button S1 by the second input/output port; Meanwhile, the input of OR circuit M is low level, and cause output signal to be low level, namely first input/output terminal of micro-control unit MCU receives low level synchronizing signal, and the beginning that button detects is taken turns in expression one;
001, now, data selector MUX selects second channel D1, and namely the second button S2 is selected, and micro-control unit MCU detects the trigger state of the second button S2 by the second input/output port;
010, now, data selector MUX selects third channel D2, and namely the 3rd button S3 is selected, and micro-control unit MCU detects the trigger state of the 3rd button S3 by the second input/output port;
011, now, data selector MUX selects four-way D3, and namely the 4th button S4 is selected, and micro-control unit MCU detects the trigger state of the 4th button S4 by the second input/output port;
100, now, data selector MUX selects Five-channel D4, and namely the 5th button S5 is selected, and micro-control unit MCU detects the trigger state of the 5th button S5 by the second input/output port;
101, now, data selector MUX selects Hexamermis spp D5, and namely the 6th button S6 is selected, and micro-control unit MCU detects the trigger state of the 6th button S6 by the second input/output port;
110, now, data selector MUX selects the 7th passage D6, and namely the 7th button S7 is selected, and micro-control unit MCU detects the trigger state of the 7th button S7 by the second input/output port;
111, now, data selector MUX selects the 8th passage D7, and namely the 8th button S8 is selected, and micro-control unit MCU detects the trigger state of the 8th button S8 by the second input/output port;
000, now, data selector MUX selects first passage D0 again, and namely the first button S1 is selected again, and micro-control unit MCU detects the trigger state of the first button S1 again by the second input/output port; Meanwhile, the input of OR circuit M is low level, and cause output signal to be low level, namely first input/output terminal of micro-control unit MCU receives low level synchronizing signal, represents the beginning that new round button detects.
By that analogy, in the present embodiment, key circuit carries out repeatedly to 8 button S1-S8 Scanning Detction.
Fig. 4 shows the structure chart of a kind of game paddle according to the utility model embodiment.As shown in Figure 5, this game paddle comprises described key circuit, comprises micro-control unit MCU, counter, data selector, OR circuit and push-button unit.
During button on user operation game paddle in push-button unit, the key circuit of handle inner is by micro-control unit MCU flip-flop number, counter OPADD is made to select signal to data selector, data selector selects respective keys, its trigger state is inputed to micro-control unit MCU detect, circulate this process, the low level synchronizing signal that micro-control unit MCU exports using OR circuit is as detection beginning label, in turn Scanning Detction is carried out to the button in push-button unit, and then detect the mode of operation of user to button on handle, realize man-machine interaction.
In sum, the technical scheme that the utility model provides is when only taking three input/output ports of MCU, the real-time detection to multiple button trigger state can be realized, that a pair at present conventional same form key circuit and matrix form key circuit are beyond one's reach more satisfactory state, save valuable input/output port resource, further reduce based on the storage resources of MCU application system and taking of calculation resources, can more preferably human-computer interaction function be realized.
The foregoing is only preferred embodiment of the present utility model, be not intended to limit protection range of the present utility model.All do within spirit of the present utility model and principle any amendment, equivalent replacement, improvement etc., be all included in protection range of the present utility model.

Claims (5)

1. detect a key circuit for button trigger state in real time, it is characterized in that, this key circuit can detect 2 nthe trigger state of individual button, this key circuit comprises: micro-control unit MCU, counter, data selector, OR circuit and comprise 2 nthe push-button unit of individual button, N be more than or equal to 2 positive integer;
First input/output terminal of described micro-control unit MCU is connected with the output of described OR circuit, second input/output terminal of described micro-control unit MCU is connected with the output of described data selector, and the 3rd input/output terminal of described micro-control unit MCU is connected with the input of described counter;
Described counter comprises N position output, and this N position output is connected with the address choice end of described data selector and the input of described OR circuit;
Described data selector is 1/2 ndata selector, they are 2 years old nindividual input and described 2 nindividual button one_to_one corresponding is connected.
2. key circuit as claimed in claim 1, it is characterized in that, described counter comprises: N-1 trigger;
The input of a described N-1 trigger all connects high level;
A described N-1 trigger is connected successively, and the output wherein going up a trigger is connected with the trigger end of adjacent next trigger, and the trigger end of first trigger of series connection is connected with the 3rd input/output terminal of described micro-control unit MCU;
The N position output of described counter is made up of the 3rd input/output terminal of described micro-control unit MCU and the output of a described N-1 trigger.
3. key circuit as claimed in claim 2, is characterized in that,
Described trigger is JK flip-flop;
Or,
Described trigger is T trigger.
4. key circuit as claimed in claim 1, it is characterized in that, described push-button unit comprises further: 2 nindividual pull-up resistor;
Described 2 none termination high level of individual pull-up resistor, 2 of its other end and described data selector nindividual input one_to_one corresponding is connected.
5. a game paddle, is characterized in that, this game paddle comprises the key circuit according to any one of claim 1-4.
CN201420442872.9U 2014-08-06 2014-08-06 A kind of key circuit of real-time detection button trigger state and game paddle Active CN204131504U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201420442872.9U CN204131504U (en) 2014-08-06 2014-08-06 A kind of key circuit of real-time detection button trigger state and game paddle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201420442872.9U CN204131504U (en) 2014-08-06 2014-08-06 A kind of key circuit of real-time detection button trigger state and game paddle

Publications (1)

Publication Number Publication Date
CN204131504U true CN204131504U (en) 2015-01-28

Family

ID=52387819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201420442872.9U Active CN204131504U (en) 2014-08-06 2014-08-06 A kind of key circuit of real-time detection button trigger state and game paddle

Country Status (1)

Country Link
CN (1) CN204131504U (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202055A (en) * 2014-08-06 2014-12-10 潍坊歌尔电子有限公司 Key circuit for detecting key trigger sate in real time, gamepad and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202055A (en) * 2014-08-06 2014-12-10 潍坊歌尔电子有限公司 Key circuit for detecting key trigger sate in real time, gamepad and method
CN104202055B (en) * 2014-08-06 2017-04-26 潍坊歌尔电子有限公司 Key circuit for detecting key trigger sate in real time, gamepad and method

Similar Documents

Publication Publication Date Title
CN102609072B (en) The method that response button triggers and the portable set that adopts the method
CN201464618U (en) Switching quantity detection circuit
CN103078645A (en) Macrocell and method and circuit for decoding binary codes into thermometer codes
CN109947395A (en) Programmable logic unit structure and chip
CN203457140U (en) A circuit structure using a single IO port to expand a plurality of buttons
CN201018471Y (en) Phase-lock loop all-channel multimode frequency divider
CN204131504U (en) A kind of key circuit of real-time detection button trigger state and game paddle
CN205647513U (en) Network deployment of matrix modularization
CN202364197U (en) Button detection and LED control circuit
CN104202055B (en) Key circuit for detecting key trigger sate in real time, gamepad and method
CN204993296U (en) Circuit of GPIO extension button
CN102346556B (en) Hybrid key module
CN203554420U (en) Matrix circuit
CN201867675U (en) Burr-free double-clock switching device
CN105527919A (en) Parallel bus backboard of PLC controller
CN202904427U (en) Clock tree generation circuit with multiple function modes
CN207720115U (en) A kind of FPGA counter units advantageously reducing system power dissipation
CN204231406U (en) A kind of Multifunction cross of the quick-setting based on toggle switch is changed planes
CN102147720A (en) Device and method for realizing operation among multiple input logical terms by using LUT
CN202841104U (en) Button detection circuit
CN207611366U (en) A kind of operation identification device and the intelligent terminal with the operation identification device
CN206863547U (en) A kind of button scan round circuit
CN202150851U (en) Button scanning system
CN203166877U (en) Control circuit using same I/O port to carry out keyboard and display synchronous scanning
CN201345086Y (en) Low-cost keying signal collection circuit

Legal Events

Date Code Title Description
C14 Grant of patent or utility model
GR01 Patent grant