CN105700698B - Matrix keyboard state recognition and coding circuit - Google Patents

Matrix keyboard state recognition and coding circuit Download PDF

Info

Publication number
CN105700698B
CN105700698B CN201610004249.9A CN201610004249A CN105700698B CN 105700698 B CN105700698 B CN 105700698B CN 201610004249 A CN201610004249 A CN 201610004249A CN 105700698 B CN105700698 B CN 105700698B
Authority
CN
China
Prior art keywords
state
keyboard
row
buffer
register
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
CN201610004249.9A
Other languages
Chinese (zh)
Other versions
CN105700698A (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.)
Pizhou Xinsheng Venture Capital Co Ltd
Original Assignee
Hunan University of Technology
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 Hunan University of Technology filed Critical Hunan University of Technology
Priority to CN201810591958.0A priority Critical patent/CN108847847B/en
Priority to CN201810591942.XA priority patent/CN108919974B/en
Priority to CN201610004249.9A priority patent/CN105700698B/en
Publication of CN105700698A publication Critical patent/CN105700698A/en
Application granted granted Critical
Publication of CN105700698B publication Critical patent/CN105700698B/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
    • 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/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M11/00Coding in connection with keyboards or like devices, i.e. coding of the position of operated keys
    • H03M11/20Dynamic coding, i.e. by key scanning

Abstract

A kind of matrix keyboard state recognition and coding circuit, are made of matrix keyboard, the first buffer register, the second buffer register, encoder.The circuit is scanned via clock pulses, the positioning of state operation will be maintained to single key stroke, combination key operation, keyboard, it is converted into the effective status code and invalid state code of same binary length, output and the corresponding effective key number of each effective status code either output invalid key number corresponding with all invalid state codes after encoder encodes;Different single key stroke, combination key operation, keyboard maintain state operation to be only embodied in not being same as above for conditional code;Button operation function is either adjusted if necessary to increase and decrease button operation function, keyboard scanning circuit structure need not be changed, only need to change encoder according to the conditional code after increase and decrease and the correspondence between key number.The invention circuit does not have to write and run program, reliable operation.

Description

Matrix keyboard state recognition and coding circuit
Technical field
The present invention relates to a kind of scanning circuit of keyboard, especially a kind of matrix keyboard state recognition and coding circuit.
Background technology
With the continuous development of embedded technology, current each electronic product generally uses microcontroller as control core The heart, keyboard are widely used as main input equipment.
Current keyboard scan is mainly controlled by microcontroller, need by run microcontroller in program come into Row, encounters interference, program is caused to run fast, and scanner program is by cisco unity malfunction.
Application No. is the patents of invention of CN201010153560.2 " a kind of fast scanning and positioning method of matrix keyboard " to adopt The Scan orientation process for entering keyboard with the mode that keyboard interrupt triggers is judged using the method that keyboard scan step is repeated several times Whether button is effective, and the key assignments to being obtained carries out condition adjudgement;If multiple repairing weld state is identical, it is in and stablizes shape State, key assignments are effective;If multiple repairing weld state is different, key assignments is invalid.Single key stroke or combination key operation need individually judgement, such as It is single key stroke, then enters singly-bound tupe;Combination key operation in this way then enters Macintosh tupe.Described in the patent Method is solved causes the Problem-Errors such as wrong key, continuous touching since keyboard caused by the mechanical property of keyboard itself is shaken, And the support issue to Macintosh and repeat key.But the method single key stroke needs to handle respectively with key operation is combined; Not accounting for keyboard state maintains a period of time just to execute the keyboard operation function of effectively operating after;Increase and decrease button operation function When either adjusting button operation function, need to change keyboard scan finder structure.
Invention content
In order to solve above-mentioned technical problem existing for existing keyboard scan localization method, the present invention provides a kind of matrix forms Keyboard state identifies and coding circuit, is made of matrix keyboard, the first buffer register, the second buffer register, encoder.
The matrix keyboard shares X rows, Y row, is equipped with N bit keyboard status signal outputs;The N bit keyboards state letter Number be level signal;The N=X+Y.
First buffer register is N binary registers;The positions the N data input pin connection of first buffer register To N bit keyboard status signal outputs.
Second buffer register is N binary registers;The positions the N data input pin connection of second buffer register To the positions the N data output end of the first buffer register.
The encoder has 2 × N coding input ends;The positions N data input pin in the coding input end 2 × N connects It is connected to the positions the N data output end of the first buffer register, in addition N data input pins are connected to the positions N of the second buffer register Data output end;The encoder has M key output ends.
The reception pulse input end of first buffer register and the reception pulse input end of the second buffer register are equal It is connected to clock pulses.
The matrix keyboard is by X row-Y row key-press matrix, row three state buffer, row three state buffer, row Status register Device, column-shaped state register group at;The line of all key-press matrixs is respectively connected to the output end of row three state buffer, all buttons Matrix column line is respectively connected to the output end of row three state buffer;All inputs of row three state buffer and row three state buffer End is connected to low level;The line of all key-press matrixs is respectively connected to the input terminal of row status register, all key-press matrixs Alignment be respectively connected to the input terminal of row status register;The output end of the row status register and row status register Output end collectively constitutes keyboard state signal output end.
The matrix keyboard is controlled by sampling pulse and obtains keyboard state signal;The row three state buffer is in sampling arteries and veins When the low level of punching enables effective, it is desirable that row status register is slow in the rising edge progress data latch of sampling pulse, row tri-state Enabled effective, the row status register of high level that device is rushed in sampling pulse carries out data latch in the failing edge of sampling pulse;Or Person is that row three state buffer is when the high level of sampling pulse enables effective, it is desirable that row status register is under sampling pulse Drop enables effective, row status register in sampling arteries and veins along the latch of progress data, row three state buffer in the low level of sampling pulse The rising edge of punching carries out data latch.
First buffer register and the second buffer register are carried out at the same time data in the rising edge of clock pulses and latch, Or it is carried out at the same time data latch in the failing edge of clock pulses;The N position data output ends of first buffer register and The positions the N data output end of two buffer registers exports 2 × N conditional codes jointly;The conditional code is by effective status code and nothing Imitate conditional code composition;The key number of the encoder output is made of effective key number and invalid key number;The effective status code is by having It imitates keyboard operation or state generates, encoder corresponds to output corresponding effectively key number when inputting each effective status code;It is described Invalid state code is generated by invalid keyboard operation or state, and encoder inputs all corresponding output invalid key when all invalid state codes Number.
The encoder has M key output ends, the selection of M values that should meet 2MMore than or equal to effective key number and invalid key number The sum of quantity.
The period of the clock pulses is 20~100ms;The period of the sampling pulse is no more than the clock pulses Period, special case are that the sampling pulse is the clock pulses.
The matrix keyboard state recognition and coding circuit further include oscillator;The oscillator exports clock pulses And sampling pulse.
The matrix keyboard state recognition and coding circuit further include that keyboard state change pulse generates unit, are used for Whether the key number of judgment matrix formula keyboard output changes, when the key number of matrix keyboard output changes, run-out key Plate-like state change pulse.
The keyboard state change pulse generates unit and is made of M delay buffers, M XOR gate and/or door;M are prolonged Slow buffer for carrying out signal delay respectively to the positions the M key number that matrix keyboard exports;The input of M XOR gate is respectively M The input of position delay buffer, output signal;The output of M XOR gate is respectively connected to or the input terminal of door;Or the output of door End output keyboard state change pulse.
The positions N, 2 × N, M refer both to binary digit data.
The beneficial effects of the invention are as follows:The positioning of state operation will be maintained to single key stroke, combination key operation, keyboard, by Clock pulses scan transformation is handled at the conditional code of same binary length by the way of Unified coding, single key stroke, Combination key operation, keyboard maintain state operation to be only embodied in not being same as above for conditional code;If necessary to increase and decrease button operation function or Person is adjustment button operation function, need not change keyboard scanning circuit structure, only need to be according to the conditional code and key number after increase and decrease Between correspondence change encoder, re-write the storage content of read-only memory.The invention circuit does not have Using microcontrollers such as microcontroller, ARM, operation program, reliable operation are not had to.
Description of the drawings
Fig. 1 is matrix keyboard state recognition and coding circuit functional block diagram;
Fig. 2 is the matrix keyboard circuit diagram of the embodiment of the present invention;
Fig. 3 is the Scan orientation circuit diagram of the embodiment of the present invention;
Fig. 4 is that the keyboard state change pulse of the embodiment of the present invention generates the circuit diagram of unit;
Fig. 5 is the waveform correlation schematic diagram that the keyboard of the embodiment of the present invention effectively operates.
Specific implementation mode
Below in conjunction with attached drawing, the invention will be further described.
Fig. 1 is matrix keyboard state recognition and coding circuit functional block diagram, is posted by the buffering of matrix keyboard 400, first Storage 100, the second buffer register 200, encoder 300, oscillator 500 form.
Oscillator 500 is multivibrator, is equipped with CP output terminal of clock pulse and CK sampling pulse output ends, CP clock arteries and veins The period of punching is 20~100ms, and the period of CK sampling pulses is not more than the period of CP clock pulses.
Fig. 2 is the circuit diagram of the matrix keyboard 400 of the embodiment of the present invention, 2 rows, 2 row is shared, totally 4 buttons, by button S1, button S2, button S3, button S4 and be connected to the pull-up resistor R1 of power supply+VCC, pull-up resistor R2, pull-up resistor R3, on Pull-up resistor R4 and row three state buffer 401, row three state buffer 402, row status register 403, row status register 404 Composition.2 output ends Y1, Y2 of row three state buffer 401 are respectively connected to 2 lines, and 2 of row three state buffer 402 are defeated Outlet Y3, Y4 is respectively connected to 2 alignments;All input terminal X1~X4 of row three state buffer 401 and row three state buffer 402 It is connected to low level.
2 input terminals D41, D42 of row status register 403 are respectively connected to 2 lines, and the 2 of row status register 404 A input terminal D43, D44 are respectively connected to 2 alignments;2 output ends Q41, Q42 of row status register 403 export row state Signal I1, I2,2 output end Q43, Q44 output row status signals I3, I4 of row status register 404;Row status register 403 2 output ends collectively constitute 4 bit keyboard status signal outputs with 2 output ends of row status register 404, export Keyboard state signal I1, I2, I3, I4.
In embodiment, the enabled input EN1 low levels of row three state buffer 401 are effective, and row three state buffer 402 enables It is effective to input EN2 high level;EN1 and EN2 is connected to the CK sampling pulse output ends of oscillator 500.Row status register 403 The CK sampling pulses that oscillator 500 is connected to reception pulse input end CLK3, CLK4 of row status register 404 export End, row status register 403 carry out data latch in the failing edge of CK sampling pulses, and row status register 404 samples arteries and veins in CK The rising edge of punching carries out data latch.
When row three state buffer 401 and row three state buffer 402 are using the three state buffer with model, for example, making simultaneously When with three state buffer 74HC241, the enabled input of 74HC241 is that high level is effective, therefore, CK sampling pulses output end with Between the enabled input terminal EN1 of row three state buffer 401, need to increase a NOT gate.Similarly, when row status register 403 With row status register 404 using the data register with model, for example, row status register 403 and row status register 404 When using double D trigger 74HC74 composition data registers, the triggering input of 74HC74 is that rising edge is effective, therefore, in CK Between sampling pulse output end and the reception pulse input end CLK3 of row status register 403, need to increase a NOT gate.
The first buffer register 100, the second buffer register 200, encoder 300 in Fig. 1 form scanning encoding circuit, Embodiment circuit diagram is as shown in Figure 3.The keyboard state signal of matrix keyboard is 4 binary codes, and therefore, the first buffering is posted Storage 100, the second buffer register 200 are required to 4 bit binary datas of deposit.4 data of the first buffer register 100 are defeated Enter D10~D13 is held to be connected to I1, I2, I3, I4;4 data input pin D24~D27 of the second buffer register 200 are connected to 4 output end Q10~Q13 of the first buffer register 100;In 8 input terminal A0~A7 of encoder 300,4 are connected to 4 output end Q10~Q13 of one buffer register 100, in addition 44 output ends for being connected to the second buffer register 200 Q24~Q27.Encoder 300, which exports, is scanned through 4 determining binary system keys number of coding.
In Fig. 3, trigger 101 forms the first buffer register 100, trigger 201 forms the second buffer register 200. Trigger 101 is made of 4 edge triggered flip flops, and the triggering input terminal CLK1 of 4 edge triggered flip flops is the first buffer register 100 Reception pulse input end, be connected to the CP output terminal of clock pulse of oscillator 500;Trigger 201 is by 4 edge triggered flip flops The triggering input terminal CLK2 of composition, 4 edge triggered flip flops is the reception pulse input end of the second buffer register 200, is all connected with To the CP output terminal of clock pulse of oscillator 500.Trigger 101, trigger 201 are preferably made of the d type flip flop of edging trigger, For example, being made of double D trigger 74HC74,4D trigger 74HC175,8D trigger 74HC273.In Fig. 3 embodiments, trigger 101, trigger 201 selects the 8D trigger 74HC273 of rising edge triggering, at this point, by unillustrated clear input in Fig. 3 It is connected to high level, the Protection Counter Functions of 74HC273 is made to be in invalid state, only there is Trigger Function.Trigger 101 and trigger 201 only need 4D triggers, respectively arbitrarily use 4 d type flip flops in selected 8D triggers 74HC273.8D is triggered The triggering input terminal of device 74HC273 is connected to CP.
In Fig. 3, read-only memory 301 forms encoder 300.Address input end A7~A0 of read-only memory 301 is to compile The input terminal of code device 300, data output end D3~D0 of read-only memory 301 are coding output end C3~C0 of encoder 300.
The operation principle of matrix keyboard state recognition and coding circuit is as follows:
In Fig. 2,4 buttons of matrix keyboard are arranged with 2 × 2 matrix form, and all lines and alignment all pass through Pull-up resistor is connected to power supply+VCC.Matrix keyboard is controlled by CK sampling pulses, using reversal process obtain keyboard state signal I4, I3、I2、I1.For example, it is 1010 that the keyboard state signal of key pressing, which is not the keyboard state signal that 1111, S1 is pressed, S1, S2 The keyboard state signal pressed simultaneously is 0010.4 binary codes of keyboard state signal are known as key assignments.
The control of CK sampling pulses carries out the method that key assignments is read in sampling to matrix keyboard:In the low electricity of CK sampling pulses It is flat, all lines are controlled by row three state buffer 401 and export low level, row three state buffer 402 exports high-impedance state and opens row Line;It is sampled by row status register 404 in the rising edge of CK sampling pulses and reads alignment state as the 2 high of key assignments;In CK The high level of sampling pulse controls all alignments by row three state buffer 402 and exports low level, and row three state buffer 401 is defeated Go out high-impedance state and opens line;It is sampled by row status register 403 in the failing edge of CK sampling pulses and reads line state as key Low 2 of value;In cycles, 4 key assignments that row status register 404, row status register 403 export are always the above process The last state of matrix keyboard.
Sampling is carried out to matrix keyboard from the control of CK sampling pulses and reads the method for key assignments it is found that row three state buffer 401 when the low level of CK sampling pulses enables effective, while requiring row status register 404 in the rising edge of CK sampling pulses Data latch, row three state buffer 402 are carried out in enabled effective, the row status register 403 of the high level of CK sampling pulses in CK The failing edge of sampling pulse carries out data latch.In turn, if row three state buffer 401 makes in the high level of CK sampling pulses When can be effective, while row status register 404 being required to carry out data latch, row three state buffer in the failing edge of CK sampling pulses 402 CK sampling pulses low level is enabled effectively, row status register 403 carries out data lock in the rising edge of CK sampling pulses It deposits.
During above-mentioned CK sampling pulses control sampling and read key assignments, row status register 403, row status register 404 at the time of precisely row three state buffer 402 is with the 401 carry out state reversion of row three state buffer at the time of sampled, just Often the row status register 403 under work or row status register 404 can be sampled correctly.If it is required that having in certain sequential Allowance can then postpone, method to being connected to row three state buffer 402 and the CK sampling pulses of row three state buffer 401 Be enable CK sampling pulses by RC retardation ratio circuit be then connected to row three state buffer 401 and row three state buffer 402 EN1, EN2, delay time are determined by RC retardation ratio circuit, determine that the principle of the delay time of RC retardation ratio circuit is, the CK of delay samples arteries and veins It rushes phase and is no more than 90 °;Either CK sampling pulses are then connected to row three state buffer 401 after the buffering of several gate circuits With EN1, EN2 of row three state buffer 402, delay time at this time is the overall delay time of several gate circuits.
First buffer register 100, the second buffer register 200 are under the control of CP clock pulses, in each week of CP Effective triggering of phase is along progress data latch.In Fig. 3,74HC273 is that rising edge triggering is effective, and therefore, CP clock pulses has Effect triggering edge is rising edge.
4 output datas of the first buffer register 100 only pass through first-level buffer, and 4 of the second buffer register 200 are defeated Go out data and have passed through level 2 buffering.Therefore, on effective triggering edge of CP clock pulses, the first buffer register 100 corresponding 4 The data that data output end Q10~Q13 is latched are the current state of matrix keyboard, and 4 digits are stated to be existing state key assignments;Second The data that the data output end of buffer register 200 corresponding 4 Q24~Q27 are latched are the previous state of matrix keyboard, 4 State key assignments before digit is stated to be.4 existing state key assignments and 4 preceding state key assignments collectively constitute 8 conditional codes.
The current state and mode of operation of 8 conditional codes matrix keyboard for identification.For example, the present embodiment In, the conditional code of no key pressing is 11111111;The conditional code of S1 key singly-bound pushes is 11111010;S1 key singly-bounds are pressed And the conditional code maintained is 10101010;The conditional code of S1 key singly-bounds release operation is 10101111;S2 key singly-bound pushes Conditional code be 11110110;The conditional code of S4 key singly-bound pushes is 11110101;The S1 of S2+S1 combination operations presses behaviour Make, after expression first presses S2, maintains the state pressed to press the operation of S1 again in S2, the conditional code of the operation is 01100010.
Encoder 300 is used to conditional code being converted to key number.In embodiment, it is equipped with 6 effective keyboard operations and state, Including:
Operation 0:The singly-bound push of button S1, key number are 0000;
Operation 1:The singly-bound push of button S2, key number are 0001;
Operation 2:The singly-bound push of button S3, key number are 0010;
Operation 3:Button S3 singly-bounds press after maintenance state, key number be 0011;
Operation 4:After button S4 singly-bounds are pressed, then the combination key operation of S2 is pushed button, key number is 0100;
Operation 5:The singly-bound release operation of button S1, key number is 0101.
The conditional code and key number obtained according to above-mentioned regulation is shown in coding schedule 1:
1 coding schedule of table
Keyboard operation Conditional code (address) Key number (storage data)
S1 singly-bounds are pressed 11111010 0000
S2 singly-bounds are pressed 11110110 0001
S3 singly-bounds are pressed 11111001 0010
S3 singly-bounds press maintenance 10011001 0011
S4+S2 combination operations 01010100 0100
S1 singly-bounds discharge 10101111 0101
Other operations or state ******** 1111
Encoder 300 is combinational logic circuit, designs circuit, meets the logical relation of table 1.
The encoder 300 of embodiment is preferably made of read-only memory 301.Read-only memory 301 has 8 bit address, and totally 28 A 4 binary storage cells.6 effective keyboard operations have 6 effective status codes, corresponding 6 effective keys number with state; It, will in storage unit corresponding with 6 effective status codes using conditional code as address A7~A0 of read-only memory 301 Corresponding key number is as storage data write-in.The conditional code generated except 6 effective keyboard operations and state is invalid state Code, i.e., other operations or state in table 1 are generated for invalid state code;In other storage units, all write-in is invalid Key number, invalid key number are that one except 6 effective keys number is worth, and in embodiment, invalid key number is 1111.
Read-only memory 301 always works at data output state.When read-only memory 301 has piece selected control system, data When exporting cushioning control function, its piece selected control system, data output cushioning control should be made to be in effective status.
Key number in embodiment is 4 binary codes.The number of bits of key number can increase as needed, or subtract It is few, at this point, need to only select the read-only memory 301 to match with this.If the number of bits of key number is M, the selection of M values 2 should be metMMore than or equal to the sum of effective key number and the quantity of invalid key number.When matrix keyboard has N bit keyboard status signals defeated When going out, read-only memory 301 needs the input of 2 × N bit address, M-bit data output.
Button operation function is either adjusted if necessary to increase and decrease button operation function, only need to change table 1 as needed, it will Modified content re-writes the storage content of read-only memory 301.
In embodiment, when matrix keyboard S1 singly-bounds are pressed, CP clock pulses of the encoder 300 after S1 singly-bounds are pressed Effective triggering along starting, to effective triggering edge of next CP clock pulses until, coding output end C3~C0 run-out keies number 0000;When matrix keyboard S2 singly-bounds are pressed, effective triggering edge of CP clock pulses of the encoder 300 after S2 singly-bounds are pressed Start, until effective triggering edge of next CP clock pulses, run-out key number 0001;After matrix keyboard first presses S4, S2 is pressed again, and effective triggering edge that encoder 300 combines the CP clock pulses after key pressing in S2 starts, until next CP clocks Until effective triggering edge of pulse, run-out key number 0100;When matrix keyboard S1 singly-bounds discharge, encoder 300 is in S1 singly-bounds Effective triggering edge of CP clock pulses after release starts, until effective triggering edge of next CP clock pulses, run-out key Number 0101;It can therefore be seen that when identification be effective button operation of matrix keyboard when, encoder 300 is effectively pressed at this Effective triggering edge of CP clock pulses after key operation starts, until effective triggering edge of next CP clock pulses, output Duration is effective key number of CP width clock cycle.
In embodiment, when matrix keyboard S3 singly-bounds are pressed, CP clock pulses of the encoder 300 after S3 singly-bounds are pressed Effective triggering along starting, until effective triggering edge of next CP clock pulses, run-out key number 0010;In next CP Effective triggering edge of clock pulses starts, until the effective of next CP clock pulses after S3 singly-bounds press maintenance state touches Until sending out edge, 300 run-out key number 0011 of encoder;It can therefore be seen that when identification be the maintenance state of matrix keyboard when, Encoder 300 exports the duration of effective key number and the duration of the maintenance state is adapted.
When except the state of keyboard or operation being 6 effective keyboard operations and state described in table 1, encoder 300 output invalid keys number 1111.Effective key number, or output invalid key number are either exported, encoder 300 changes output content At the time of for CP clock pulses effective triggering edge;In embodiment, encoder 300 is CP clock arteries and veins at the time of changing output content The rising edge of punching.
The period of CP clock pulses is the scan period of matrix keyboard.The keyboard scan period, can in 20ms or more It has been effectively shielded from the influence of keyboard shake;The keyboard scan period in 100ms or less, is unlikely to omit keyboard operation; Therefore, the period of CP clock pulses should control in 20~100ms.
The cycle request of CK sampling pulses is not more than the period of CP clock pulses, in this way, each effective in CP clock pulses When triggering is along acquisition conditional code, it can ensure that 4 key assignments that row status register 404, row status register 403 export are always The last state of matrix keyboard.The special case of CK sampling pulses is directly to use CP clock pulses as CK sampling pulses.
In embodiment, CP clock pulses, CK sampling pulses are generated and are exported by oscillator 500.CP clock pulses and CK Sampling pulse can also by except matrix keyboard state recognition and coding circuit circuit or device provide.
Fig. 4 is that the keyboard state change pulse of the embodiment of the present invention generates the circuit diagram of unit.What it is when identification is matrix form When effective button operation of keyboard, effective triggering edge of CP clock pulses of the encoder 300 after effective button operation starts, Until effective triggering edge of next CP clock pulses, output duration is the effective of CP width clock cycle Key number.The device for receiving the matrix keyboard output, needs the output for inquiring matrix keyboard constantly, obtains key number.Inquiry Period distances be necessarily less than period of CP clock pulses.
Whether key number of the circuit shown in Fig. 4 for the output of judgment matrix formula keyboard changes, when matrix keyboard exports Key number when changing, export keyboard state change pulse, be used for the reception device receiving matrix formula of auxiliary moment configuration keyboard The key number of keyboard output, for example, using keyboard state change pulse as the interrupt request singal of reception device.
Circuit shown in Fig. 4 by delay buffer 601, XOR gate 602, XOR gate 603, XOR gate 604, XOR gate 605 or Door 606 forms.By only being formed with 4 edge triggered flip flops of Trigger Function, 4 edge triggered flip flops touch delay buffer 601 The reception pulse input end that input terminal is delay buffer 601 is sent out, the CP output terminal of clock pulse of oscillator 500 is connected to; Delay buffer 601 carries out data latch on effective triggering edge of CP clock pulses.
Delay buffer 601 is used to carry out at delay 4 data C3~C0 of the coding output end of encoder 300 respectively Reason.4 data input pin D63~D60 of delay buffer 601 are connected to coding output end C3~C0 of encoder 300, delay The data that 4 data output end Q63~Q60 of buffer 601 are accordingly exported are C31~C01;C31~C01 is buffered by delay After the first-level buffer of device 601, signal ratio C3~C0 postpones CP clock cycles, and Fig. 5 show the embodiment of the present invention The waveform correlation schematic diagram that effectively operates of keyboard.The sections T1 of CP clock pulses are located at, matrix keyboard exists primary effective It operates, effective operation of embodiment includes:S1 singly-bounds are pressed, S2 singly-bounds are pressed, S3 singly-bounds are pressed, the S2 of S4+S2 combination operations It presses, the release of S1 singly-bounds.On the next effective triggering edge once effectively operated, i.e. in Fig. 5 after the sections CP clock pulses T1 Rising edge, encoder 300 export coding C3~C0 change;In the sections T2, encoder 300 exports having for a cycle Effect coding C3~C0;In T3, T4 and section later, coding C3~C0 that encoder 300 exports changes and enters maintenance again State, the maintenance state may be that such as S1 singly-bounds press subsequent maintenance state, export invalid key number, it is also possible to S3 singly-bounds Subsequent maintenance state is pressed, effective key number is exported, until effectively operation next time.
Coding C3~C0 that D6 pulses in Fig. 5 schematically illustrate the output of encoder 300 is to be in maintenance state, is not become Change, still change, the D6 pulses are not present in actual circuit.As shown in figure 5, D6 pulses are low level, illustrate table Show that coding C3~C0 that encoder 300 exports is to be in maintenance state, does not change;D6 pulses are high level, schematically illustrate volume Code device 300 exports efficient coding C3~C0 of a cycle.What the Q6 in Fig. 5 reflected is the situation of change of C31~C01, it is clear that Q6 ratios D6 postpones CP clock cycles.Equally, the Q6 pulses are not present in actual circuit.
In Fig. 5, coding C3~C0 that encoder 300 exports is to be in maintenance state, does not change, still changes, Really by 606 4 delay buffers 601, XOR gate 602, XOR gate 603, XOR gate 604, XOR gate 605 or door groups At logic circuit complete.1 corresponding, input point that 4 XOR gates encode in output end C3~C0 respectively with encoder 300 It Wei not the inputs of 4 delay buffers 601, output signal.For example, two input signals of XOR gate 602 be respectively C0 and C01, C01 ratio C0 postpones CP clock cycles, and therefore, when C0 changes, XOR gate 602 exports 1 CP clock The positive pulse of pulse period width;When C0 is a CP change width clock cycle signal, XOR gate 602 exports 2 The positive pulse of CP width clock cycle.XOR gate 603, XOR gate 604, XOR gate 605 judge whether C1~C3 sends out respectively Changing, principle with judge it is identical whether C0 changes.XOR gate 602, XOR gate 603, XOR gate 604, XOR gate 605 Output end is respectively connected to or whether the input terminal of door 606 or door 606 change for comprehensive descision C0~C3, as long as C0 ~C3 changes or door 606 exports keyboard state change pulse F, which is positive pulse.
In embodiment, delay buffer 601 selects the 8D triggers 74HC273 of rising edge triggering.
Delay buffer 601 can also use other schemes, for example, using RC circuits, using 4 RC circuits respectively to C0 ~C3 is postponed;If the delay time of RC circuits is less than CP clock cycles, encoder 300 exports a week When efficient coding C3~C0 of phase, starts and export efficient coding C3~C0 in output efficient coding C3~C0 and terminate all to generate one The width of a keyboard state change pulse, keyboard state change pulse is equal to RC circuit delay times;If the delay of RC circuits Time is more than or equal to CP clock cycles, then when encoder 300 exports efficient coding C3~C0 of a cycle, defeated Go out one keyboard state change pulse of generation when efficient coding C3~C0 starts, pulse width is more than or equal to 2 CP clock pulses Period.It is required that the delay time of RC circuits is no more than 2 CP clock cycles, failed to report in order to avoid generating.
In the invention circuit, the positioning of state operation will be maintained to single key stroke, combination key operation, keyboard, by CP Pulse scan transformation is handled at the conditional code of same binary length by the way of Unified coding, single key stroke, combination Key operation, keyboard maintain state operation to be only embodied in not being same as above for conditional code;If necessary to increase and decrease button operation function either Button operation function is adjusted, keyboard scanning circuit structure need not be changed, need to only be updated and be encoded according to the state code table after increase and decrease Device 300, the storage content for re-writing update read-only memory 301.The invention circuit use microcontroller, The microcontrollers such as ARM do not have to operation program, reliable operation.

Claims (9)

1. a kind of matrix keyboard state recognition and coding circuit, which is characterized in that by matrix keyboard, the first buffer stock Device, the second buffer register, encoder composition;
The matrix keyboard shares X rows, Y row, is equipped with N bit keyboard status signal outputs;The N bit keyboards status signal is Level signal;The N=X+Y;
First buffer register is N binary registers;The positions the N data input pin of first buffer register is connected to N Bit keyboard status signal output;
Second buffer register is N binary registers;The positions the N data input pin of second buffer register is connected to The positions the N data output end of one buffer register;
The encoder has 2 × N coding input ends;The positions N data input pin in the coding input end 2 × N is connected to The positions the N data output end of first buffer register, in addition N data input pins be connected to the positions the N data of the second buffer register Output end;
The reception pulse input end of first buffer register and the reception pulse input end of the second buffer register are all connected with To clock pulses;The matrix keyboard is controlled by sampling pulse and obtains keyboard state signal.
2. matrix keyboard state recognition according to claim 1 and coding circuit, it is characterised in that:The matrix form key Disk by X row-Y row key-press matrix, row three state buffer, row three state buffer, row status register, column-shaped state register group at; The line of all key-press matrixs is respectively connected to the output end of row three state buffer, and the alignment of all key-press matrixs is respectively connected to The output end of row three state buffer;All input terminals of row three state buffer and row three state buffer are connected to low level;It is all The line of key-press matrix is respectively connected to the input terminal of row status register, and the alignment of all key-press matrixs is respectively connected to column-shaped The input terminal of state register;The output end of the row status register collectively constitutes keyboard shape with the output end of row status register State signal output end.
3. matrix keyboard state recognition according to claim 2 and coding circuit, it is characterised in that:The row tri-state is slow Device is rushed when the low level of sampling pulse enables effective, it is desirable that row status register carries out data lock in the rising edge of sampling pulse It deposits, row three state buffer is carried out in enabled effective, the row status register of high level of sampling pulse in the failing edge of sampling pulse Data latch;Either, row three state buffer is when the high level of sampling pulse enables effective, it is desirable that row status register is taking The failing edge of sample pulse carries out data latch, row three state buffer in enabled effective, the row Status register of the low level of sampling pulse Device carries out data latch in the rising edge of sampling pulse.
4. matrix keyboard state recognition according to claim 1 and coding circuit, it is characterised in that:First buffering Register and the second buffer register are carried out at the same time data in the rising edge of clock pulses and latch, or in the decline of clock pulses It is latched along data are carried out at the same time;The N position data output ends of first buffer register and the positions the N data of the second buffer register Output end exports 2 × N conditional codes jointly;The conditional code is made of effective status code and invalid state code;The coding The key number of device output is made of effective key number and invalid key number;The effective status code is generated by effective keyboard operation or state, Encoder corresponds to output corresponding effectively key number when inputting each effective status code;The invalid state code is grasped by invalid keyboard Make or state generates, encoder inputs all corresponding output invalid key number when all invalid state codes.
5. matrix keyboard state recognition according to claim 4 and coding circuit, it is characterised in that:The encoder has The selection of M key output ends, M values should meet 2MMore than or equal to the sum of effective key number and the quantity of invalid key number.
6. matrix keyboard state recognition according to claim 5 and coding circuit, it is characterised in that:It further include keyboard shape State change pulse generates unit, and whether the key number for the output of judgment matrix formula keyboard changes, when matrix keyboard exports Key number when changing, export keyboard state change pulse.
7. matrix keyboard state recognition according to claim 1 and coding circuit, it is characterised in that:The clock pulses Period be 20~100ms;The period of the sampling pulse is not more than the period of the clock pulses.
8. matrix keyboard state recognition according to claim 7 and coding circuit, it is characterised in that:The sampling pulse For the clock pulses.
9. matrix keyboard state recognition according to claim 1 and coding circuit, it is characterised in that:It further include oscillation Device;The oscillator output clock pulses and sampling pulse.
CN201610004249.9A 2016-01-05 2016-01-05 Matrix keyboard state recognition and coding circuit Active CN105700698B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201810591958.0A CN108847847B (en) 2016-01-05 2016-01-05 Keyboard state change pulse generation method
CN201810591942.XA CN108919974B (en) 2016-01-05 2016-01-05 Matrix type keyboard state identification and coding method
CN201610004249.9A CN105700698B (en) 2016-01-05 2016-01-05 Matrix keyboard state recognition and coding circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610004249.9A CN105700698B (en) 2016-01-05 2016-01-05 Matrix keyboard state recognition and coding circuit

Related Child Applications (2)

Application Number Title Priority Date Filing Date
CN201810591958.0A Division CN108847847B (en) 2016-01-05 2016-01-05 Keyboard state change pulse generation method
CN201810591942.XA Division CN108919974B (en) 2016-01-05 2016-01-05 Matrix type keyboard state identification and coding method

Publications (2)

Publication Number Publication Date
CN105700698A CN105700698A (en) 2016-06-22
CN105700698B true CN105700698B (en) 2018-07-24

Family

ID=56226913

Family Applications (3)

Application Number Title Priority Date Filing Date
CN201810591942.XA Active CN108919974B (en) 2016-01-05 2016-01-05 Matrix type keyboard state identification and coding method
CN201610004249.9A Active CN105700698B (en) 2016-01-05 2016-01-05 Matrix keyboard state recognition and coding circuit
CN201810591958.0A Expired - Fee Related CN108847847B (en) 2016-01-05 2016-01-05 Keyboard state change pulse generation method

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201810591942.XA Active CN108919974B (en) 2016-01-05 2016-01-05 Matrix type keyboard state identification and coding method

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201810591958.0A Expired - Fee Related CN108847847B (en) 2016-01-05 2016-01-05 Keyboard state change pulse generation method

Country Status (1)

Country Link
CN (3) CN108919974B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0188151A1 (en) * 1984-12-20 1986-07-23 Automobiles Peugeot Keyboard device
CN101840268A (en) * 2010-04-23 2010-09-22 中国电子科技集团公司第五十四研究所 Method for fast scanning and positioning of matrix keyboard
CN101943948A (en) * 2009-07-07 2011-01-12 扬智科技股份有限公司 Keyboard scanning device and keyboard scanning method
CN103226391A (en) * 2013-05-22 2013-07-31 湖南工业大学 Scan locating method for independent keyboard
CN103279197A (en) * 2013-06-08 2013-09-04 湖南工业大学 Keyboard scanning positioning method
CN103631244A (en) * 2013-12-22 2014-03-12 贺义方 Master and slave type keyboard controller based on MCU (microprogrammed control unit) and CPLD (complex programmable logic device)

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB718696A (en) * 1950-03-18 1954-11-17 British Thomson Houston Co Ltd Improvements in and relating to electric computers
CN1034650A (en) * 1988-01-19 1989-08-09 Rca许可公司 Keyboard identfication apparatus
US4888600A (en) * 1988-01-29 1989-12-19 International Business Machine Corp. Keyboard arrangement with ghost key condition detection
CN1049415A (en) * 1989-08-09 1991-02-20 东少青 Abacus interface arrangement of general computer
CA2027103A1 (en) * 1989-10-13 1991-04-14 William A. Clough Method and apparatus for displaying simulated keyboards on touch-sensitive displays
GB2270178A (en) * 1992-08-31 1994-03-02 Chameleon Systems Ltd Generic user configurable keyboard
JPH08272506A (en) * 1995-03-29 1996-10-18 Oki Electric Ind Co Ltd Keyboard lamp turning on/off control system
US5958023A (en) * 1997-01-07 1999-09-28 Micron Electronics, Inc. Method for low power wireless keyboard that detects a host computer query for the state of a key then powers up to determine and transmit back the state of that key
JP2004070695A (en) * 2002-08-07 2004-03-04 Alps Electric Co Ltd Data transmitting method of wireless device
CN101001086B (en) * 2007-01-12 2010-05-26 宁波天安(集团)股份有限公司 Keyboard matrix pagerank method based on Boolean process
CN101373416B (en) * 2007-08-23 2012-04-18 介面光电股份有限公司 Resistance type touching control panel controller structure and method for discriminating and operating multi-point coordinates
CN101593046B (en) * 2008-05-28 2012-09-05 中兴通讯股份有限公司 Realizing method of scroll ball
US8058901B2 (en) * 2008-09-19 2011-11-15 Qualcomm Incorporated Latch structure, frequency divider, and methods for operating same
CN102053712B (en) * 2009-11-02 2013-02-20 研祥智能科技股份有限公司 Multi-keyboard input system, input equipment, switching device and control method
JP5407919B2 (en) * 2010-02-16 2014-02-05 富士通モバイルコミュニケーションズ株式会社 Key scanning device and electronic device
CN202059394U (en) * 2011-05-09 2011-11-30 广州励丰声光科技有限公司 Matrix keyboard scanning device based on programmable element
CN103391103B (en) * 2012-05-08 2016-09-07 凌通科技股份有限公司 Ultralow power consumption wake-up circuit device
CN203250171U (en) * 2013-05-14 2013-10-23 湖南工业大学 Low-power keyboard
CN103257716B (en) * 2013-05-14 2015-11-18 湖南工业大学 A kind of low-power consumption keyboard and Scan orientation method thereof
CN104184479A (en) * 2014-07-31 2014-12-03 山东神戎电子股份有限公司 De-jittering button detection method capable of avoiding omission of events
CN104536330A (en) * 2014-11-13 2015-04-22 河北工业大学 Data communication device for absolute value encoder with SSI

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0188151A1 (en) * 1984-12-20 1986-07-23 Automobiles Peugeot Keyboard device
CN101943948A (en) * 2009-07-07 2011-01-12 扬智科技股份有限公司 Keyboard scanning device and keyboard scanning method
CN101840268A (en) * 2010-04-23 2010-09-22 中国电子科技集团公司第五十四研究所 Method for fast scanning and positioning of matrix keyboard
CN103226391A (en) * 2013-05-22 2013-07-31 湖南工业大学 Scan locating method for independent keyboard
CN103279197A (en) * 2013-06-08 2013-09-04 湖南工业大学 Keyboard scanning positioning method
CN103631244A (en) * 2013-12-22 2014-03-12 贺义方 Master and slave type keyboard controller based on MCU (microprogrammed control unit) and CPLD (complex programmable logic device)

Also Published As

Publication number Publication date
CN105700698A (en) 2016-06-22
CN108919974B (en) 2023-01-10
CN108847847B (en) 2022-03-18
CN108847847A (en) 2018-11-20
CN108919974A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
CN105468164B (en) Matrix keyboard scanner uni coding circuit
CN105677055B (en) matrix keyboard scanning circuit and method
CN105700698B (en) Matrix keyboard state recognition and coding circuit
CN105703780B (en) Matrix keyboard Scan orientation circuit
CN105677054B (en) Independent keyboard Scan orientation circuit
CN105677052B (en) Independent keyboard state recognition and coding circuit
CN205490496U (en) Matrix type keyboard operation discernment and coding circuit
CN105680874B (en) Matrix keyboard scanning circuit and scanning encoding method
CN105700696B (en) Matrix keyboard scanning encoding circuit
CN105680875B (en) Matrix keyboard operation identification and coding circuit
CN205320063U (en) Matrix type keyboard state recognition and coding circuit
CN105677053B (en) Independent keyboard operation identification and coding circuit
CN105680873B (en) Independent keyboard scanning encoding circuit
CN205485933U (en) Matrix type keyboard scans positioning circuit
CN205384582U (en) Matrix type keyboard scanning circuit and coding circuit
CN105677051B (en) Independent keyboard scanning circuit and coding circuit
CN205318331U (en) Matrix type keyboard scanning and coding circuit
CN105471439B (en) Independent keyboard scanner uni coding circuit
CN105700695B (en) Matrix keyboard scanning circuit and coding circuit
CN205334379U (en) Stand alone type keyboard state recognition and coding circuit
CN105700697B (en) independent keyboard scanning circuit and method
CN205318332U (en) Discernment of stand alone type key board operation and coding circuit
CN105677050B (en) Independent keyboard scanning circuit and scanning encoding method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191030

Address after: 221300, Fumin Road, Pizhou hi tech Industrial Development Zone, Xuzhou, Jiangsu, 13

Patentee after: Pizhou hi tech Zone City Mineral Research Institute Co Ltd

Address before: 412007 School of industry, research and production, Hunan University of Technology, 88 West Taishan Road, Zhuzhou, Hunan

Patentee before: Hunan University of Technology

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210309

Address after: 221300 paoche street, Pizhou City, Xuzhou City, Jiangsu Province

Patentee after: Pizhou Xinsheng Venture Capital Co., Ltd

Address before: 221300 13 Fu Min Road, hi tech Industrial Development Zone, Pizhou, Xuzhou, Jiangsu

Patentee before: Pizhou hi tech Zone City Mineral Research Institute Co.,Ltd.