CN101741395A - Coding method and coding circuit for matrix keyboard - Google Patents
Coding method and coding circuit for matrix keyboard Download PDFInfo
- Publication number
- CN101741395A CN101741395A CN200910198884A CN200910198884A CN101741395A CN 101741395 A CN101741395 A CN 101741395A CN 200910198884 A CN200910198884 A CN 200910198884A CN 200910198884 A CN200910198884 A CN 200910198884A CN 101741395 A CN101741395 A CN 101741395A
- Authority
- CN
- China
- Prior art keywords
- keyboard
- code
- matrix
- coding method
- button
- 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.)
- Granted
Links
Images
Landscapes
- Input From Keyboards Or The Like (AREA)
Abstract
The invention relates to a coding method and a coding circuit for a matrix keyboard, and belongs to the field of keyboards of electric accessories. The coding method for the matrix keyboard is characterized in that: the matrix array of the keyboard has M rows and N columns; the input signal of the m-th row and n-th column key positioned on the matrix array is compiled as a code; and the code comprises position information representing the row and the column of the key and signal information. The coding circuit for realizing the coding method comprises the keyboard with the matrix array of M rows and N columns and is characterized in that: the keys of the keyboard are connected with the input end of the coding circuit respectively; and the output ends of the coding circuit are divided into a row output end, a column output end and other position output ends respectively and are connected with the input port of the keyboard controller respectively. The coding method can realize that few output lines can identify all the key signals. The coding circuit has high generality and wide application range and can be connected with the various conventional contact keys or electronic switches.
Description
Technical field
The present invention relates to a kind of matrix keyboard, relate in particular to a kind of coding method and coding circuit of matrix keyboard.
Background technology
In the design of micromonitor system circuit, keyboard circuit normally adopts the dynamic scan matrix keyboard or realizes with the static switch input mode.
The dynamic scan matrix keyboard connects button with matrix-style, cross-over connection is between the ranks line, between matrix keyboard and microcontroller, must connect the DIO interface, the identification of button and the generation of code need the mode output scanning burst of program control microcontroller with dynamic scan, read corresponding input code then, again through screening the key assignments that respective keys is determined in computing, although it is less that keyboard connects the line of microcontroller DIO interface, but procedure operation more complicated, if expansion can increase the time of computing, the efficient of influence reaction, and be not suitable for the keyboard of forming by electronic switch; And each button in the static switch keyboard circuit is corresponding to each bars incoming line of microcontroller, the identification of button is fairly simple, microcontroller only need detect the state of the input signal cable of corresponding button can determine key code, but required amount of hardware is more, if any N button, then must expand N line DI interface, needing increases more hardware, takes up room.Therefore the application process of these two kinds of keyboards all has limitation separately.
Summary of the invention
Technical problem to be solved by this invention provides a kind of coding method and coding circuit of matrix keyboard, make that the hardware of connection matrix keyboard circuit is less, and the complexity of simplifying procedures, existing keyboard circuit procedure operation complexity solved, need hardware more, the defective of expansion inconvenience.
Technical scheme
A kind of coding method of matrix keyboard, described keyboard matrix is classified the capable N row of M as, it is characterized in that: the compiling by key input signal of the capable n row of m that will be positioned on the rectangular array is a code, and described code packages contains ranks positional information and the signal message of representing described button.
Described code is a fixing figure place code, the line position information and the column position information of button is wherein arranged and characterizes on the not coordination of code.
The line position information that M bit representation button is arranged in the described code, the column position information of N bit representation button.
The push button signalling of the capable n row of described m is compiled code and is adopted following calculating formula:
F
mn=x+a
(m+y)+a
(n+z)+b;
Wherein a is the position flexible strategy of system, and x, y and z are the parameter corresponding to M, N, y 〉=N+z or z 〉=M+y.
B is a constant in the described calculating formula.
An interrupt code is arranged in the code of compiling.
A kind of coding circuit of realizing the matrix keyboard of described coding method, comprise that key-press matrix classifies the keyboard of the capable N of M row as, it is characterized in that: the button of described keyboard is connected with the input of coding circuit respectively, the output of coding circuit is divided into line output end, row output and other output, and links to each other with the input port of keyboard controller respectively.
Beneficial effect
The coding method that the present invention proposes can realize discerning all push button signallings with less output line, and utilize the circuit of coding circuit design keyboard circuit of the present invention simple, utilize coding method of the present invention to realize that the program composition of button identification is also very simple, only need read the ranks signal code and decode and get final product, circuit highly versatile of the present invention, widely applicable, can connect existing all kinds of contact button or electronic switch.
Description of drawings
Fig. 1 is the schematic diagram of the coding circuit of matrix keyboard of the present invention.
Embodiment
Below in conjunction with specific embodiment, further set forth the present invention.
For solving the limitation of present two kinds of form keyboards, between the button of keyboard and microcontroller, increase a encoder, and adopt following coding method with the matrix architecture design:
Suppose that described keyboard matrix classifies the capable N of M row as, the compiling by key input signal of the capable n row of m that will be positioned on the rectangular array is a code, and described code packages contains ranks positional information and the signal message of representing described button.Code is a fixing figure place code, the line position information and the column position information of button is wherein arranged and characterizes on the not coordination of code.The line position information that M bit representation button is arranged in the code, the column position information of N bit representation button.
The push button signalling of the capable n row of described m is compiled code and can be adopted following calculating formula:
F
mn=x+a
(m+y)+a
(n+z)+b;
Wherein a is the position flexible strategy of system, and x, y and z are the parameter corresponding to M, N, and y 〉=N+z or z 〉=M+y, b are constant.
The F that obtains
MnIn have M+N position code to represent key position, other code is represented relevant information.
And the input of described encoder connects all button M*N of keyboard, and output is divided into line output end, row output and other output, and links to each other with the DI input port of keyboard controller respectively.The DI interface that only needs to connect the M+N line between keyboard controller and keyboard coding circuit gets final product, and does not need the necessary DO interface of conventional dynamic scan matrix keyboard, and keyboard controller directly reads the identifying operation that encoded radio can be realized button by the DI interface.
As shown in drawings, the input of encoder connects button K
11, K
12..., K
MN, output line L
1, L
2..., L
MWith alignment R
1, R
2..., R
NConnect the keyboard controller input interface.When no key was pressed, the encoded radio of encoder output was F=x+b; As a certain key K
MnWhen pressing, encoder is then exported code value F corresponding and this key
Mn, microcontroller MCU can inquire about working method and read key by the DI mouth.This coding circuit also can expand keyboard interrupt request signal line, increases the interrupt code position, makes keyboard controller to read key with interrupt mode.
The button that utilizes coding circuit of the present invention to constitute keyboard circuit selects for use scope more extensive, can be contact button or the electronic switch such as hall-effect switch, simplify the complexity of keyboard design of hardware and software greatly, improved the interlock circuit functional reliability.
The coding method that the present invention proposes can realize discerning all push button signallings with less output line, and circuit is simple, when utilizing coding circuit of the present invention to design keyboard circuit, only need each button is connected across between coding circuit input and the common wire, the ranks line of coding circuit output and other output insert keyboard controller DI interface respectively and get final product; The program composition that the present invention realizes is simple, and the design of program only need be write ranks signal code reading command sequence, the ranks code is carried out can constituting after the combination operation code of respective keys; Button of the present invention identification is also simple, and keyboard controller directly reads encoded radio by the DI interface and decodes and can realize the identifying operation of button, no longer needs to carry out the dynamic scan matrix keyboard.The present invention has saved hardware thus, and software programming is simple, has also promoted recognition efficiency.
Claims (7)
1. the coding method of a matrix keyboard, described keyboard matrix is classified the capable N row of M as, it is characterized in that: the compiling by key input signal of the capable n row of m that will be positioned on the rectangular array is a code, and described code packages contains ranks positional information and the signal message of representing described button.
2. the coding method of matrix keyboard as claimed in claim 1 is characterized in that: described code is a fixing figure place code, the line position information and the column position information of button is wherein arranged and characterizes on the not coordination of code.
3. the coding method of matrix keyboard as claimed in claim 2 is characterized in that: the line position information of M bit representation button is arranged, the column position information of N bit representation button in the described code.
4. the coding method of matrix keyboard as claimed in claim 3 is characterized in that: the push button signalling of the capable n row of described m is compiled code and is adopted following calculating formula:
F
mn=x+a
(m+y)+a
(n+z)+b;
Wherein a is the position flexible strategy of system, and x, y and z are the parameter corresponding to M, N, y 〉=N+z or z 〉=M+y.
5. the coding method of matrix keyboard as claimed in claim 4 is characterized in that: b is a constant in the described calculating formula.
6. as the coding method of claim 1 or 2 or 3 described matrix keyboards, it is characterized in that: an interrupt code is arranged in the code of compiling.
7. coding circuit of realizing the matrix keyboard of coding method according to claim 1, comprise that key-press matrix classifies the keyboard of the capable N of M row as, it is characterized in that: the button of described keyboard is connected with the input of coding circuit respectively, the output of coding circuit is divided into line output end, row output and other output, and links to each other with the input port of keyboard controller respectively.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009101988845A CN101741395B (en) | 2009-11-17 | 2009-11-17 | Coding method and coding circuit for matrix keyboard |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009101988845A CN101741395B (en) | 2009-11-17 | 2009-11-17 | Coding method and coding circuit for matrix keyboard |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101741395A true CN101741395A (en) | 2010-06-16 |
CN101741395B CN101741395B (en) | 2013-11-27 |
Family
ID=42464368
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009101988845A Expired - Fee Related CN101741395B (en) | 2009-11-17 | 2009-11-17 | Coding method and coding circuit for matrix keyboard |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101741395B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101958717A (en) * | 2010-09-29 | 2011-01-26 | 惠州Tcl移动通信有限公司 | Key scanning method and key scanning device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1170212C (en) * | 2002-06-03 | 2004-10-06 | 迅杰科技股份有限公司 | Keyboard controller |
CN101241461A (en) * | 2007-02-07 | 2008-08-13 | 纬创资通股份有限公司 | Keyboard automatic test system and its method |
CN101242187A (en) * | 2008-03-17 | 2008-08-13 | 北京安效技术有限公司 | Input method and keyboard based on multiple adjacent keys |
-
2009
- 2009-11-17 CN CN2009101988845A patent/CN101741395B/en not_active Expired - Fee Related
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101958717A (en) * | 2010-09-29 | 2011-01-26 | 惠州Tcl移动通信有限公司 | Key scanning method and key scanning device |
CN101958717B (en) * | 2010-09-29 | 2013-04-03 | 惠州Tcl移动通信有限公司 | Key scanning method and key scanning device |
Also Published As
Publication number | Publication date |
---|---|
CN101741395B (en) | 2013-11-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20030001763A1 (en) | One-chip microcomputer with analog-to-digital converter | |
US8744353B2 (en) | Bluetooth mouse for fast switching linking objects | |
US7345598B2 (en) | Electronic device with keyboard system and method of detecting key conditions thereof | |
CN101741395B (en) | Coding method and coding circuit for matrix keyboard | |
CN102779082A (en) | Touch control detection method, touch control panel and liquid crystal display | |
CN101888250A (en) | Key system and method thereof | |
TW201005589A (en) | Notebook computer and keyboard controller thereof | |
CN102455817A (en) | Method for transmitting information of touch panel | |
CN102385795B (en) | Method and device for controlling multiple systems based on single group of infrared receiving devices | |
US6680678B2 (en) | Circuit layout arrangement for key switch signal recognition | |
CN101996013A (en) | Touch sensing method of resistance-type touch device | |
JP2008059190A (en) | Keyboard device and radio tag reader device | |
CN105788921A (en) | Key assembling structure and key assembly, electronic product and shell body thereof | |
CN1159641C (en) | Keyboard instruction fetch device for notebook computer | |
CN101499242B (en) | Horizontal drive device, driving device and correlated sequence type transmission circuit apparatus | |
CN101477743B (en) | Multiplex system for induction press-key code and remote control code | |
CN101888235B (en) | Projection touch key | |
CN1493959A (en) | Pushbutton device and operation method | |
CN201765695U (en) | Device for controlling a plurality of systems based on single-group infrared receivers | |
CN2735465Y (en) | Wireless RF intelligence remote controller for household electric appliances | |
JP3199805B2 (en) | Key input device | |
CN201453296U (en) | Integrated color ultrasonography control panel and color ultrasonography machine | |
CN218497371U (en) | Digital rotary coding control circuit | |
CN2479573Y (en) | Keyboard | |
CN200962625Y (en) | Key scanning circuit and STB with the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20131127 Termination date: 20181117 |
|
CF01 | Termination of patent right due to non-payment of annual fee |