CN108491091B - A kind of independent keyboard state recognition and coding method - Google Patents

A kind of independent keyboard state recognition and coding method Download PDF

Info

Publication number
CN108491091B
CN108491091B CN201810338473.0A CN201810338473A CN108491091B CN 108491091 B CN108491091 B CN 108491091B CN 201810338473 A CN201810338473 A CN 201810338473A CN 108491091 B CN108491091 B CN 108491091B
Authority
CN
China
Prior art keywords
keyboard
state
key
output
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.)
Expired - Fee Related
Application number
CN201810338473.0A
Other languages
Chinese (zh)
Other versions
CN108491091A (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 Tiefu Jiulong Public Service Co ltd
Wang Jingjing
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 CN201810338473.0A priority Critical patent/CN108491091B/en
Publication of CN108491091A publication Critical patent/CN108491091A/en
Application granted granted Critical
Publication of CN108491091B publication Critical patent/CN108491091B/en
Expired - Fee Related 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

Landscapes

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

Abstract

A kind of independent keyboard state recognition and coding method are realized by the circuit that independent keyboard, the first buffer register, the second buffer register, encoder form, and include the independent keyboard output N bit keyboard status signal of N number of key;N bit keyboard status signal is subjected to level 2 buffering latch by clock pulses control buffer register, the data of first-level buffer output are existing state key assignments, and the data of level 2 buffering output are preceding state key assignments;Existing state key assignments and preceding state key assignments collectively constitute 2 × N status codes;Encode simultaneously run-out key number to status code;Different single key stroke, combination key operation, keyboard maintain state operation to be only embodied in not being same as above for status code;Button operation function is either adjusted if necessary to increase and decrease button operation function, does not need modification circuit structure, it only need to be according to the encoded content of the status code after increase and decrease and the change encoder of the corresponding relationship between key number.The method does not have to write and run program, reliable operation.

Description

A kind of independent keyboard state recognition and coding method
Present patent application is divisional application, and application No. is 201610003648.3, the applying date is in January, 2016 for original bill 5 days, entitled independent keyboard state recognition and coding circuit.
Technical field
The present invention relates to a kind of Scan orientation method of keyboard, especially a kind of independent keyboard state recognition and coding staff Method.
Background technique
With the continuous development of embedded technology, current each electronic product generallys use microcontroller as control core The heart, keyboard are widely used as main input equipment.
Current keyboard scan is mainly controlled by microcontroller, need by operation 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 key is effective, and carries out state judgement to key assignments obtained;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 solves the shake of the keyboard as caused by the mechanical property of keyboard itself and causes the Problem-Errors such as wrong key, continuous touching, 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 modify keyboard scan finder structure.
Summary of the invention
In order to solve above-mentioned technical problem existing for existing keyboard scan localization method, the present invention provides a kind of stand alone types Keyboard state identification and coding method include the independent keyboard output N bit keyboard status signal of N number of key;By clock arteries and veins N bit keyboard status signal is carried out level 2 buffering latch by punching control buffer register, and the data of first-level buffer output are existing state key Value, the data of level 2 buffering output are preceding state key assignments;Existing state key assignments and preceding state key assignments collectively constitute 2 × N status codes;To shape State code encode and run-out key number;The N bit keyboard status signal is level signal.
The existing state key assignments of the N bit keyboard status signal is that the N bit keyboard state that clock pulses was effectively triggered along the moment is believed Number, the preceding state key assignments of N bit keyboard status signal is a N bit keyboard status signal for effectively triggering along the moment in clock pulses;Institute Clock pulses is stated effectively to trigger along the rising edge for being clock pulses;The clock pulses effectively triggers along or is clock pulses Failing edge.
The status code is made of effective status code and invalid state code, for identification the current state of independent keyboard and Mode of operation;The key number is made of effective key number and invalid key number;The effective status code is by effective keyboard operation or state It generates, the corresponding effectively key number of corresponding output;The invalid state code is generated by invalid keyboard operation or state, corresponding output nothing Imitate key number.The key number is M, and the selection of M value should meet 2MMore than or equal to the sum of effective key number and the quantity of invalid key number.
Effective keyboard operation includes singly-bound pushing operation, singly-bound release operates, singly-bound presses maintenance operation, Macintosh Operation.After the combination key operation refers to that singly-bound is pressed, then press the operation of other keys;The invalid keyboard operation is effective Operation except keyboard operation.
It is described status code to be encoded and run-out key number is realized by encoder.When encoder inputs all invalid state codes All corresponding output invalid key number, invalid key number are a value except all effective keys number.Further, the encoder is only Read memory;Storage content by modifying read-only memory increases and decreases button operation function and either adjusts button operation function.
Described latched N bit keyboard status signal progress level 2 buffering by clock pulses control buffer register is delayed by first It rushes register and the second buffer register is realized;First buffer register and the second buffer register be N two into Register processed;The position the N data input pin of first buffer register is connected to N bit keyboard status signal output, and the second buffering is posted The position the N data input pin of storage is connected to the position the N data output end of the first buffer register;First buffer register connects The reception pulse input end for receiving pulse input end and the second buffer register is connected to clock pulses.
The position N, 2 × N, M refer both to binary digit;The period of the clock pulses is 20~100ms;The N Meet one-to-one relationship between bit keyboard status signal and N number of key.
Independent keyboard state recognition and coding method are realized by independent keyboard state recognition and coding circuit.It is described only Vertical keyboard, the first buffer register, the second buffer register, encoder composition independent keyboard state recognition and coding electricity Road.
Further, when the key number of output changes, keyboard state change pulse is exported.The independent keyboard shape State identification and coding circuit further include keyboard state change pulse generate unit, the keyboard state change pulse by or door, M The keyboard state change pulse of delay buffer and M XOR gate composition generates unit output;M delay buffers are used for only The position the M key number of vertical keyboard output carries out signal delay respectively;The input of M XOR gate is respectively the defeated of M delay buffers Enter, output signal;The output of M XOR gate is respectively connected to or the input terminal of door;Or the output end output keyboard state of door becomes Change pulse.
The independent keyboard state recognition and coding circuit further include oscillator;The oscillator exports clock pulses.
The beneficial effects of the present invention are: the positioning for state operation being maintained to single key stroke, combination key operation, keyboard, by Clock pulses scan transformation is handled by the way of Unified coding at the status code of same binary length, single key stroke, Combination key operation, keyboard maintain state operation to be only embodied in not being same as above for status code;If necessary to increase and decrease button operation function or Person is adjustment button operation function, does not need modification keyboard scanning circuit structure, only need to be according to the status code and key number after increase and decrease Between corresponding relationship change encoder content, i.e. remodify be written read-only memory storage content.The side Method does not use the microcontrollers such as single-chip microcontroller, ARM, does not have to operation program, reliable operation.
Detailed description of the invention
Fig. 1 is independent keyboard state recognition and coding circuit functional block diagram;
Fig. 2 is the independent keyboard circuit diagram of the embodiment of the present invention;
Fig. 3 is the scanning encoding 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 embodiment
Below in conjunction with attached drawing, the invention will be further described.
Fig. 1 is independent keyboard state recognition and coding circuit functional block diagram, is posted by the buffering of independent keyboard 400, first Storage 100, the second buffer register 200, encoder 300, oscillator 500 form.
Fig. 2 is the circuit diagram of the independent keyboard 400 of the embodiment of the present invention, shares 4 keys, by key S1, key S2, Key S3, key S4 and the pull-up resistor R1, pull-up resistor R2, pull-up resistor R3, pull-up resistor R4 group for being connected to power supply+VCC At.4 output ends of independent keyboard 400 correspond the state of output key S1, key S2, key S3, key S4 respectively Signal I1, I2, I3, I4, when by key pressing, the status signal of corresponding output end is low level;It is corresponding to export when key is not pressed The status signal at end is high level.
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.Independent keyboard circuit has 4 keys, and therefore, the first buffer register 100, second is slow It rushes register 200 and is required to 4 bit binary datas of deposit.4 data input pin D10~D13 of the first buffer register 100 connect It is connected to I1, I2, I3, I4;4 data input pin D24~D27 of the second buffer register 200 are connected to the first buffer register 100 4 output end Q10~Q13;In 8 input terminal A0~A7 of encoder 300,4 are connected to the first buffer register 100 4 output end Q10~Q13, in addition 44 output end Q24~Q27 for being connected to the second buffer register 200.Coding Device 300, which exports, is scanned 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 embodiment, trigger 101, trigger 201 selects the 8D trigger 74HC273 of rising edge triggering, at this point, by clear input unillustrated 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 trigger, respectively arbitrarily using 4 d type flip flops in selected 8D trigger 74HC273.8D triggering 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.
Embodiment is not drawn into the circuit of oscillator 500, and oscillator 500 is multivibrator, and the output period is 20~100ms Rectangular wave, the rectangular wave be Fig. 3 in CP clock pulses.CP clock pulses can also be by independent keyboard state recognition and volume Circuit or device except code circuit provide.
Independent keyboard state recognition and coding method principle are as follows:
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 Data have passed through level 2 buffering out.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 independent keyboard, and 4 digits are stated to be existing state key assignments;Second 200 corresponding 4 data output end Q24~Q27 of buffer register latch data be independent keyboard previous state, 4 State key assignments before digit is stated to be.4 existing state key assignments and 4 preceding state key assignments collectively constitute 8 status codes.
The current state and mode of operation of 8 status codes independent keyboard for identification.For example, the present embodiment In, the status code of no key pressing is 11111111;The status code of S1 key singly-bound pushing operation is 11111110;S1 key singly-bound is pressed And the status code maintained is 11101110;The status code of S1 key singly-bound release operation is 11101111;S2 key singly-bound pushing operation Status code be 11111101;The status code of S4 key singly-bound pushing operation is 11110111;The S1 of S2+S1 combination operation presses behaviour Make, after expression first presses S2, maintains the state pressed to press the operation of S1 again in S2, the status code of the operation is 11011100.
Encoder 300 is used to status code being converted to key number.In embodiment, it is equipped with 7 effective keyboard operations and state, Include:
The singly-bound pushing operation of operation 0: key S1, key number are 0000;
The singly-bound pushing operation of operation 1: key S2, key number are 0001;
The singly-bound pushing operation of operation 2: key S3, key number are 0010;
Operation 3: key S3 singly-bound press after maintenance state, key number be 0011;
Operation 4: after key S4 singly-bound is pressed, then pressing the button the combination key operation of S1, and key number is 0100;
Operation 5: after key S4 singly-bound is pressed, then pressing the button the combination key operation of S2, and key number is 0101;
The singly-bound of operation 6: key S1 discharges operation, and key number is 0110.
The status code and key number obtained according to above-mentioned regulation is shown in coding schedule 1:
1 coding schedule of table
Keyboard operation Status code (address) Key number (storing data)
S1 singly-bound is pressed 11111110 0000
S2 singly-bound is pressed 11111101 0001
S3 singly-bound is pressed 11111011 0010
S3 singly-bound presses maintenance 10111011 0011
S4+S1 combination operation 01110110 0100
S4+S2 combination operation 01110101 0101
The release of S1 singly-bound 11101111 0110
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.7 effective keyboard operations and state have 7 effective status codes, corresponding 7 effective keys number; It, will in storage unit corresponding with 7 effective status codes using status code as address A7~A0 of read-only memory 301 Corresponding key number is written as storing data.The status code generated except 7 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 7 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 according to need increase, 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 value 2 should be metMMore than or equal to the sum of effective key number and the quantity of invalid key number.When independent keyboard has N bit keyboard status signal defeated When 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 modify table 1 as needed, it will Modified content re-writes the storage content of read-only memory 301.
In embodiment, when independent keyboard S1 singly-bound is pressed, CP clock pulses of the encoder 300 after S1 singly-bound is pressed Effective triggering along starting, to effective triggering edge of next CP clock pulses until, coding output end C3~C0 run-out key number 0000;When independent keyboard S2 singly-bound is pressed, effective triggering edge of CP clock pulses of the encoder 300 after S2 singly-bound is pressed Start, until effective triggering edge of next CP clock pulses, run-out key number 0001;After independent keyboard first presses S4, S1 is pressed again, and encoder 300 starts on effective triggering edge that S1 combines the CP clock pulses after key pressing, until next CP clock Until effective triggering edge of pulse, run-out key number 0100;When the release of independent keyboard S1 singly-bound, encoder 300 is in S1 singly-bound Effective triggering edge of CP clock pulses after release starts, until effective triggering edge of next CP clock pulses, run-out key Number 0110;Therefore, it can be seen that when identification be effective button operation of independent 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 independent keyboard S3 singly-bound is pressed, CP clock pulses of the encoder 300 after S3 singly-bound is 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 effective touching of next CP clock pulses after S3 singly-bound presses maintenance state Until sending out edge, 300 run-out key number 0011 of encoder;Therefore, it can be seen that when identification be the maintenance state of independent 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 7 effective keyboard operations described in table 1 and state, 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 independent 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.
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 stand alone type 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 independent keyboard output, needs to inquire the output of independent keyboard constantly, obtains key number.Inquiry Period distances be necessarily less than period of CP clock pulses.
Circuit shown in Fig. 4 is used to judge whether the key number of independent keyboard output to change, when independent keyboard exports Key number when changing, keyboard state change pulse is exported, for assisting the reception device of independent keyboard to receive stand alone type 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.Delay buffer 601 is made of 4 edge triggered flip flops only with Trigger Function, the touching of 4 edge triggered flip flops 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 by delay buffering After the first-level buffer of device 601, signal ratio C3~C0 postpones a CP clock cycle, and Fig. 5 show the embodiment of the present invention The waveform correlation schematic diagram that effectively operates of keyboard.It is located at the section T1 of CP clock pulses, independent keyboard exists primary effective Effective operation of operation, embodiment includes: that S1 singly-bound is pressed, S2 singly-bound is pressed, S3 singly-bound is pressed, the S1 of S4+S1 combination operation It presses, the S2 of S4+S2 combination operation is pressed, the release of S1 singly-bound.On the next effective triggering edge once effectively operated, i.e. Fig. 5 Rising edge after the middle section CP clock pulses T1, coding C3~C0 that encoder 300 exports change;In the section T2, compile Code device 300 exports efficient coding C3~C0 of a cycle;In T3, T4 and section later, coding C3 that encoder 300 exports~ C0 changes again and enters maintenance state, which may be that such as S1 singly-bound presses subsequent maintenance state, output Invalid key number, it is also possible to which S3 singly-bound presses subsequent maintenance state, exports effective key number, until effectively operation next time.
Coding C3~C0 that D6 pulse in Fig. 5 schematically illustrates the output of encoder 300 is not become in maintenance state Change, still change, the D6 pulse is not present in actual circuit.As shown in figure 5, D6 pulse is low level, schematic table Show that coding C3~C0 that encoder 300 exports is not changed in maintenance state;D6 pulse is high level, schematically illustrates 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 ratio D6 postpones a CP clock cycle.Equally, the Q6 pulse is not present in actual circuit.
In Fig. 5, coding C3~C0 that encoder 300 exports is not changed, still changes in maintenance state, 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 postpone a CP clock cycle, 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 trigger 74HC273 of rising edge triggering.
Delay buffer 601 can also use other schemes, for example, using RC circuit, using 4 RC circuits respectively to C0 ~C3 is postponed;If the clock cycle CP of delay time of RC circuit less than one, encoder 300 exports a week When efficient coding C3~C0 of phase, starting and export efficient coding C3~C0 in output efficient coding C3~C0 terminates all to generate one The width of a keyboard state change pulse, keyboard state change pulse is equal to RC circuit delay time;If the delay of RC circuit Time is more than or equal to a CP clock cycle, then when encoder 300 exports efficient coding C3~C0 of a cycle, defeated A keyboard state change pulse is generated when efficient coding C3~C0 starts out, pulse width is more than or equal to 2 CP clock pulses Period.It is required that the delay time of RC circuit 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 by the way of Unified coding at the status code of same binary length, single key stroke, combination Key operation, keyboard maintain state operation to be only embodied in not being same as above for status code;If necessary to increase and decrease button operation function either Button operation function is adjusted, modification keyboard scanning circuit structure is not needed, need to only be updated and be encoded according to the state code table after increase and decrease Device 300 re-writes the storage content for updating read-only memory 301.The invention circuit do not use single-chip microcontroller, The microcontrollers such as ARM do not have to operation program, reliable operation.

Claims (9)

1. a kind of independent keyboard state recognition and coding method, it is characterised in that: include N number of key independent keyboard it is defeated N bit keyboard status signal out;N bit keyboard status signal is subjected to level 2 buffering latch by clock pulses control buffer register, The data of first-level buffer output are existing state key assignments, and the data of level 2 buffering output are preceding state key assignments;Existing state key assignments and preceding state key assignments Collectively constitute 2 × N status codes;Encode simultaneously run-out key number to status code by encoder;Institute's rheme is binary digit;
When the key number of output changes, keyboard state change pulse is exported;The keyboard state change pulse by or door, M The keyboard state change pulse of position delay buffer and M XOR gate composition generates unit output;M delay buffers for pair The position the M key number of independent keyboard output carries out signal delay respectively;The input of M XOR gate is respectively M delay buffers Input, output signal;The output of M XOR gate is respectively connected to or the input terminal of door;Or the output end of door exports keyboard state Change pulse.
2. independent keyboard state recognition according to claim 1 and coding method, it is characterised in that: the N bit keyboard The existing state key assignments of status signal is that clock pulses effectively triggers the N bit keyboard status signal along the moment, N bit keyboard status signal Preceding state key assignments is a N bit keyboard status signal for effectively triggering along the moment in clock pulses.
3. independent keyboard state recognition according to claim 1 and coding method, it is characterised in that: the status code by Effective status code and invalid state code form, for identification the current state and mode of operation of independent keyboard;The key number by Effective key number and invalid key number form;The effective status code is generated by effective keyboard operation or state, and corresponding output is corresponding Effective key number;The invalid state code is generated by invalid keyboard operation or state, corresponding output invalid key number.
4. independent keyboard state recognition according to claim 3 and coding method, it is characterised in that: effective keyboard Operation includes singly-bound pushing operation, singly-bound release operates, singly-bound presses maintenance operation, combination key operation;The invalid keyboard behaviour As the operation except effective keyboard operation.
5. independent keyboard state recognition according to claim 4 and coding method, it is characterised in that: the Macintosh behaviour After work refers to that singly-bound is pressed, then press the operation of other keys.
6. independent keyboard state recognition according to claim 3 and coding method, it is characterised in that: the key number is M Position, the selection of M value should meet 2MMore than or equal to the sum of effective key number and the quantity of invalid key number.
7. independent keyboard state recognition according to claim 6 and coding method, it is characterised in that: the encoder is Read-only memory.
8. independent keyboard state recognition and coding method described in any one of -7 according to claim 1, it is characterised in that: institute State by clock pulses control buffer register by N bit keyboard status signal carry out level 2 buffering latch by the first buffer register and Second buffer register is realized.
9. independent keyboard state recognition according to claim 8 and coding method, it is characterised in that: first buffering Register and the second buffer register are N binary registers;The N position data input pin of first buffer register connects To N bit keyboard status signal output, the position the N data input pin of the second buffer register is connected to the N of the first buffer register Position data output end;The reception pulse input of the reception pulse input end and the second buffer register of first buffer register End is connected to clock pulses.
CN201810338473.0A 2016-01-05 2016-01-05 A kind of independent keyboard state recognition and coding method Expired - Fee Related CN108491091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810338473.0A CN108491091B (en) 2016-01-05 2016-01-05 A kind of independent keyboard state recognition and coding method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810338473.0A CN108491091B (en) 2016-01-05 2016-01-05 A kind of independent keyboard state recognition and coding method
CN201610003648.3A CN105677052B (en) 2016-01-05 2016-01-05 Independent keyboard state recognition and coding circuit

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201610003648.3A Division CN105677052B (en) 2016-01-05 2016-01-05 Independent keyboard state recognition and coding circuit

Publications (2)

Publication Number Publication Date
CN108491091A CN108491091A (en) 2018-09-04
CN108491091B true CN108491091B (en) 2019-10-18

Family

ID=56190367

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201810338473.0A Expired - Fee Related CN108491091B (en) 2016-01-05 2016-01-05 A kind of independent keyboard state recognition and coding method
CN201610003648.3A Active CN105677052B (en) 2016-01-05 2016-01-05 Independent keyboard state recognition and coding circuit

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201610003648.3A Active CN105677052B (en) 2016-01-05 2016-01-05 Independent keyboard state recognition and coding circuit

Country Status (1)

Country Link
CN (2) CN108491091B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116820256B (en) * 2023-08-28 2023-12-08 深圳市蓝晨科技股份有限公司 Multi-cascade key detection method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102348A (en) * 2007-06-28 2008-01-09 中兴通讯股份有限公司 A keyboard circuit and method for recognizing hand-held mobile device
JP2010238207A (en) * 2009-03-31 2010-10-21 Brother Ind Ltd Input device and program for the same
CN103279197B (en) * 2013-06-08 2015-12-09 湖南工业大学 A kind of Scan orientation method of keyboard
CN103226391B (en) * 2013-05-22 2015-12-23 湖南工业大学 A kind of Scan orientation method of independent keyboard

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2575305B1 (en) * 1984-12-20 1987-02-13 Peugeot KEY CONTROL DEVICE
CN101510127B (en) * 2009-03-30 2012-10-17 无锡中星微电子有限公司 Method, apparatus and chip for implementing keyboard module composite key function
CN101943948B (en) * 2009-07-07 2012-11-14 扬智科技股份有限公司 Keyboard scanning device and keyboard scanning method
CN101840268B (en) * 2010-04-23 2012-02-15 中国电子科技集团公司第五十四研究所 Method for fast scanning and positioning of matrix keyboard
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)

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102348A (en) * 2007-06-28 2008-01-09 中兴通讯股份有限公司 A keyboard circuit and method for recognizing hand-held mobile device
JP2010238207A (en) * 2009-03-31 2010-10-21 Brother Ind Ltd Input device and program for the same
CN103226391B (en) * 2013-05-22 2015-12-23 湖南工业大学 A kind of Scan orientation method of independent keyboard
CN103279197B (en) * 2013-06-08 2015-12-09 湖南工业大学 A kind of Scan orientation method of keyboard

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
4×4行列式键盘控制电路设计;何凤 等;《电子世界》;20130630;第128页 *
基于Verilog按键消抖设计;浩瀚之水_csdn;《CSDN》;https://blog.csdn.net/a8039974/article/details/26928251;20140525;第1-5页 *

Also Published As

Publication number Publication date
CN105677052B (en) 2018-05-25
CN105677052A (en) 2016-06-15
CN108491091A (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN108491091B (en) A kind of independent keyboard state recognition and coding method
CN105468164B (en) Matrix keyboard scanner uni coding circuit
CN105677054B (en) Independent keyboard Scan orientation circuit
CN108519827B (en) A kind of matrix keyboard scan method
CN105680873B (en) Independent keyboard scanning encoding circuit
CN205334379U (en) Stand alone type keyboard state recognition and coding circuit
CN105677053B (en) Independent keyboard operation identification and coding circuit
CN205490497U (en) Stand alone type keyboard scan positioning circuit
CN105677051B (en) Independent keyboard scanning circuit and coding circuit
CN105471439B (en) Independent keyboard scanner uni coding circuit
CN108919974A (en) A kind of matrix keyboard state recognition and coding method
CN105677050B (en) Independent keyboard scanning circuit and scanning encoding method
CN205353947U (en) Stand alone type keyboard scan and coding circuit
CN205318332U (en) Discernment of stand alone type key board operation and coding circuit
CN105703780B (en) Matrix keyboard Scan orientation circuit
CN105700697B (en) independent keyboard scanning circuit and method
CN205485933U (en) Matrix type keyboard scans positioning circuit
CN205384581U (en) Stand alone type keyboard scanning circuit and coding circuit
CN205320063U (en) Matrix type keyboard state recognition and coding circuit
CN105680874B (en) Matrix keyboard scanning circuit and scanning encoding method
CN205318331U (en) Matrix type keyboard scanning and coding circuit
CN105700696B (en) Matrix keyboard scanning encoding circuit
CN108874164A (en) A kind of matrix keyboard reversal process scan method
CN108809321A (en) A kind of matrix keyboard operation identification and coding method

Legal Events

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

Effective date of registration: 20200717

Address after: 232200 Democratic constituency of Shiji street, Anfeng Town, Shouxian County, Huainan City, Anhui Province

Patentee after: Wang Jingjing

Address before: 412007 science and Technology Department, Hunan University of Technology, 88 West Taishan Road, Zhuzhou, Hunan

Patentee before: HUNAN University OF TECHNOLOGY

Effective date of registration: 20200717

Address after: 221300 Tiefu Street, Tiefu Town, Pizhou City, Jiangsu Province (Cultural Center)

Patentee after: PIZHOU TIEFU JIULONG PUBLIC SERVICE Co.,Ltd.

Address before: 232200 Democratic constituency of Shiji street, Anfeng Town, Shouxian County, Huainan City, Anhui Province

Patentee before: Wang Jingjing

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: 20191018