CN101741395B - Coding method and coding circuit for matrix keyboard - Google Patents

Coding method and coding circuit for matrix keyboard Download PDF

Info

Publication number
CN101741395B
CN101741395B CN2009101988845A CN200910198884A CN101741395B CN 101741395 B CN101741395 B CN 101741395B CN 2009101988845 A CN2009101988845 A CN 2009101988845A CN 200910198884 A CN200910198884 A CN 200910198884A CN 101741395 B CN101741395 B CN 101741395B
Authority
CN
China
Prior art keywords
keyboard
code
matrix
button
row
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.)
Expired - Fee Related
Application number
CN2009101988845A
Other languages
Chinese (zh)
Other versions
CN101741395A (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.)
Shanghai Normal University
University of Shanghai for Science and Technology
Original Assignee
Shanghai Normal University
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 Shanghai Normal University filed Critical Shanghai Normal University
Priority to CN2009101988845A priority Critical patent/CN101741395B/en
Publication of CN101741395A publication Critical patent/CN101741395A/en
Application granted granted Critical
Publication of CN101741395B publication Critical patent/CN101741395B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

A kind of coding method of matrix keyboard and coding circuit
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, be connected across 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, then read corresponding input code, through screening computing, determine again the key assignments of respective keys, 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 efficiency of impact reaction, and be not suitable for the keyboard formed by electronic switch, and each button in the static switch keyboard circuit is corresponding to each bars input line of microcontroller, the identification of button is 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, must expand N line DI interface, needing increases more hardware, takes up room.Therefore the application process of these two kinds of keyboards has limitation separately.
Summary of the invention
Technical problem to be solved by this invention is to provide a kind of coding method and coding circuit of matrix keyboard, make the hardware of connection matrix keyboard circuit less, and the complexity of simplifying procedures, existing keyboard circuit procedure operation complexity solved, need hardware more, expand inconvenient defect.
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: it is a code that the key-press input signal that will be positioned at the capable n row of m on rectangular array is compiled, and described code packages contains ranks positional information and the signal message that represents described button.
Described code is a fixing figure place code, line position information and the column position information of button is wherein arranged and characterize on the not coordination of code.
The line position information that M bit representation button is arranged in 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.
In described calculating formula, b is constant.
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 with the input port of keyboard controller, is connected respectively.
Beneficial effect
The coding method that the present invention proposes can realize with the less all push button signallings of output line identification, 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 recognition by pressing keys 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.
The accompanying drawing explanation
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 an encoder with the matrix architecture design, and adopt following coding method:
Suppose that described keyboard matrix classifies the capable N of M row as, it is a code that the key-press input signal that will be positioned at the capable n row of m on rectangular array is compiled, and described code packages contains ranks positional information and the signal message that represents described button.Code is a fixing figure place code, line position information and the column position information of button is wherein arranged and characterize on the not coordination of code.The line position information that M bit representation button is arranged in 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 obtained MnIn have M+N position code to represent key position, other code represents relevant information.
And the input of described encoder connects all button M*N of keyboard, output is divided into line output end, row output and other output, and with the DI input port of keyboard controller, is connected 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 by the DI interface identifying operation that encoded radio can be realized button.
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 without key, pressing, the encoded radio of encoder output is F=x+b; As a certain key K MnWhile pressing, encoder is exported code value F corresponding and this key Mn, microcontroller can be inquired about working method and read key by the DI mouth.This coding circuit also can expand keyboard interrupt request signal line, increases and interrupts code bit, makes keyboard controller to read key with interrupt mode.
Utilize the button Application Range of coding circuit formation keyboard circuit of the present invention more extensive, can be contact button or the electronic switch such as hall-effect switch, greatly simplify the complexity of keyboard design of hardware and software, improved the interlock circuit functional reliability.
The coding method that the present invention proposes can realize with the less all push button signallings of output line identification, and circuit is simple, while utilizing coding circuit design keyboard circuit of the present invention, only each button need be connected across between coding circuit input and common wire, the ranks line of coding circuit output and other output access respectively keyboard controller DI interface 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 after combination operation forming to the code of respective keys; Recognition by pressing keys of the present invention 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 (4)

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: it is a code that the key-press input signal that will be positioned at the capable n row of m on rectangular array is compiled, and described code packages contains ranks positional information and the signal message that represents described button;
Described code is a fixing figure place code, line position information and the column position information of button is wherein arranged and characterize on the not coordination of code;
The line position information that M bit representation button is arranged in 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.
2. the coding method of matrix keyboard as claimed in claim 1 is characterized in that: in described calculating formula, b is constant.
3. the coding method of matrix keyboard as claimed in claim 1 is characterized in that: an interrupt code is arranged in the code of compiling.
4. coding circuit of realizing the matrix keyboard of coding method as claimed in 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 with the input port of keyboard controller, is connected respectively.
CN2009101988845A 2009-11-17 2009-11-17 Coding method and coding circuit for matrix keyboard Expired - Fee Related CN101741395B (en)

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 CN101741395A (en) 2010-06-16
CN101741395B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101958717B (en) * 2010-09-29 2013-04-03 惠州Tcl移动通信有限公司 Key scanning method and key scanning device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1381775A (en) * 2002-06-03 2002-11-27 迅杰科技股份有限公司 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

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1381775A (en) * 2002-06-03 2002-11-27 迅杰科技股份有限公司 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

Also Published As

Publication number Publication date
CN101741395A (en) 2010-06-16

Similar Documents

Publication Publication Date Title
CN101609385B (en) Method and system for using a plurality of resistive touch screens to realize multi-point input
US8744353B2 (en) Bluetooth mouse for fast switching linking objects
US7345598B2 (en) Electronic device with keyboard system and method of detecting key conditions thereof
CN102075194A (en) Circuit and method for scanning keyboard and electronic equipment
CN101741395B (en) Coding method and coding circuit for matrix keyboard
CN101876930B (en) Keyboard automatic test system
CN102779082A (en) Touch control detection method, touch control panel and liquid crystal display
TWI395116B (en) Notebook computer and keyboard controller thereof
CN201673498U (en) Keyboard test system
US4470038A (en) Shift control system for keyboards
CN101996013A (en) Touch sensing method of resistance-type touch device
CN101888250A (en) Key system and method thereof
JP2008059190A (en) Keyboard device and radio tag reader device
US20110199309A1 (en) Input Device
CN1159641C (en) Keyboard instruction fetch device for notebook computer
CN101989138A (en) Touch panel device, sensing control device and control method of touch panel
CN2816909Y (en) Keyboard scanning device
CN1228703C (en) Pushbutton device and operation method
CN207611366U (en) A kind of operation identification device and the intelligent terminal with the operation identification device
CN102193849A (en) Keyboard testing system
CN102122961A (en) Key scanning method for electronic equipment
CN109994334A (en) Keyboard
KR100442370B1 (en) Key scan apparatus and method for mobile communication terminal
CN217113815U (en) Electric piano keyboard control circuit
CN101534126B (en) Method and system for detecting hidden ghost key position of key-press matrix

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20131127

Termination date: 20181117