CN108809322A - A kind of independent keyboard scanner uni coding method - Google Patents

A kind of independent keyboard scanner uni coding method Download PDF

Info

Publication number
CN108809322A
CN108809322A CN201810591960.8A CN201810591960A CN108809322A CN 108809322 A CN108809322 A CN 108809322A CN 201810591960 A CN201810591960 A CN 201810591960A CN 108809322 A CN108809322 A CN 108809322A
Authority
CN
China
Prior art keywords
data
state
keyboard
key assignments
key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810591960.8A
Other languages
Chinese (zh)
Other versions
CN108809322B (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.)
Hunan University of Technology
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 CN201810591960.8A priority Critical patent/CN108809322B/en
Publication of CN108809322A publication Critical patent/CN108809322A/en
Application granted granted Critical
Publication of CN108809322B publication Critical patent/CN108809322B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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)
  • Input From Keyboards Or The Like (AREA)

Abstract

A kind of independent keyboard scanner uni coding method includes the independent keyboard output N bit keyboard status signals of N number of button;Scanning pulse carries out data to N bit keyboard status signals and latches and select, and obtains existing state key assignments and preceding state key assignments;Clock pulses carries out state latch to existing state key assignments and preceding state key assignments, obtains 2 × N conditional codes;Encode simultaneously run-out key number to conditional code, is realized by the circuit that independent keyboard, the first buffer register, the second buffer register, state Code memory, encoder, data selection unit form.The method need not change circuit structure if necessary to which increase and decrease button operation function either adjusts button operation function, and the encoded content of encoder need to be only changed according to the conditional code after increase and decrease and the correspondence between key number.The method does not have to write and run program, reliable operation.

Description

A kind of independent keyboard scanner uni coding method
Present patent application is divisional application, and application No. is 201610003246.3, the applying date is in January, 2016 for original bill 5 days, entitled independent keyboard scanner uni coding circuit.
Technical field
The present invention relates to a kind of Scan orientation method of keyboard, especially a kind of independent keyboard scanner uni coding method.
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 stand alone types Keyboard scan and coding method include the independent keyboard output N bit keyboard status signals of N number of button;Scanning pulse is to N The data that keyboard state signal carry out latch and selection, obtain existing state key assignments and preceding state key assignments;Clock pulses is to existing state key assignments with before State key assignments carries out state latch, obtains 2 × N conditional codes;Encode simultaneously run-out key number to conditional code.The N bit keyboards Meet one-to-one relationship between status signal and N number of button.The N bit keyboards status signal is level signal.
The scanning pulse carries out data to N bit keyboard status signals and latches and select, and obtains existing state key assignments and preceding state key The method of value is that the high and low level of scanning pulse controls the existing state key assignments of output end alternating output of 2 buffer registers and preceding state Key assignments;The output end of 2 buffer registers of high and low level pair of scanning pulse alternately exports existing state key assignments and is carried out with preceding state key assignments Data selected and sorted with combine, making existing state key assignments, preceding state key assignments is rear preceding;Either, the high and low level pair 2 of scanning pulse The output end of a buffer register alternately exports existing state key assignments and carries out data selected and sorted with preceding state key assignments and combine, and makes existing state key Value is rear, and preceding state key assignments is preceding.
The conditional 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.
Effective keyboard operation includes singly-bound push, singly-bound release operates, singly-bound presses maintenance operation, Macintosh Operation;The combination key operation refers to after singly-bound is pressed, then presses the operation of other buttons;The invalid keyboard operation is effective Operation except keyboard operation.The key number is M, and the selection of M values should meet 2MMore than or equal to effective key number and invalid key number The sum of quantity.
It is described conditional 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 changing read-only memory increases and decreases button operation function and either adjusts button operation function.
The scanning pulse carries out data to N bit keyboard status signals and latches and select, and obtains existing state key assignments and preceding state key Value is realized by the first buffer register, the second buffer register, data selection unit.First buffer register and second delays It is N binary registers to rush register;The positions the N data input pin of first buffer register is sequentially connected to N keys The positions the N data input pin of disk status signal output, the second buffer register is sequentially connected to the output of N bit keyboard status signals The reception pulse input end of end, the first buffer register and the second buffer register is connected to scanning pulse;Scanning pulse High and low level controls the first buffer register, the positions the N data output end of the second buffer register alternately exports existing state key assignments with before State key assignments.The data selection unit is equipped with N data input pins of the first via, the second road N data input pin and 2 × N digits According to output end;The first via N data input pins are sequentially connected to the positions the N data output end of the first buffer register, and second Road N data input pin is sequentially connected to the positions the N data output end of the second buffer register.The data selection unit is additionally provided with Data select signal end;The data select signal end is connected to scanning pulse;The positions the 2 × N data output of data selection unit In, when the scanning pulse is low level, N data of the first via are preceding, and second road N data is rear;The scanning pulse is When high level, N data of the first via are rear, and second road N data is preceding;Either, the positions the 2 × N data of data selection unit In output, when the scanning pulse is low level, N data of the first via are rear, and second road N data is preceding;The scanning arteries and veins When punching is high level, N data of the first via are preceding, and second road N data is rear.The output of data selection unit can be maintained at Existing state key assignments immobilizes in preceding, the preceding posterior sequence of state key assignments, or is held in existing state key assignments in rear, preceding state key assignments preceding Sequence immobilize.
The clock pulses carries out state latch to existing state key assignments and preceding state key assignments, obtains 2 × N conditional codes by state Code memory is realized.The state Code memory is 2 × N binary registers;The positions the 2 × N data of state Code memory are defeated Enter the positions the 2 × N data output end that end is connected to data selection unit, receives pulse input end and be connected to clock pulses;Conditional code Register carries out data latch on the state latch edge of clock pulses.The state latch edge of the clock pulses is clock pulses Rising edge;The state latch edge of the clock pulses or the failing edge for clock pulses.Scanning pulse is the two of clock pulses Fractional frequency signal;In clock pulses, effective triggering edge of control scanning pulse overturning is known as status scan edge, another edge For state latch edge.
First buffer register, the second buffer register, state Code memory by edging trigger d type flip flop group At.The period of the clock pulses is 20~100ms.The positions N, 2 × N, M refer both to binary digit data.
The coding method of independent keyboard scanner uni is realized by independent keyboard scanner uni coding circuit.The stand alone type key Disk, the first buffer register, the second buffer register, data selection unit, encoder composition independent keyboard scanner uni coding Circuit.
Further, when the key number of output changes, keyboard state change pulse is exported.The independent keyboard is swept Retouch and coding circuit further include keyboard state change pulse generate unit, the keyboard state change pulse by or door, M postpone The keyboard state change pulse of buffer and M XOR gate composition generates unit output;M delay buffers are used for stand alone type The positions the M key number of keyboard output carries out signal delay respectively;The input of M XOR gate is respectively inputting, being defeated for M delay buffers Go out 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 changes arteries and veins Punching.
The independent keyboard scanner uni coding circuit further includes oscillator;The oscillator output clock pulses and scanning Pulse.
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, scanning pulse control are converted into the conditional code of same binary length, are handled 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 behaviour Make function and either adjust button operation function, circuit structure need not be changed, it only need to be according to the conditional code and key number after increase and decrease Between correspondence change encoder encoded content, i.e. remodify be written read-only memory storage content.Institute It states method and does not use the microcontrollers such as microcontroller, ARM, do not have to operation program, reliable operation.
Description of the drawings
Fig. 1 is independent keyboard scanner uni coding circuit functional block diagram;
Fig. 2 is the independent 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 the data selection unit circuit diagram of the embodiment of the present invention;
Fig. 5 is the clock pulses and scanning pulse oscillogram of the embodiment of the present invention;
Fig. 6 is that the keyboard state change pulse of the embodiment of the present invention generates the circuit diagram of unit;
Fig. 7 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 independent keyboard scanner uni coding circuit functional block diagram, by independent keyboard 400, the first buffer register 101, the second buffer register 102, state Code memory 200, encoder 300, data selection unit 500 form.
Fig. 2 is the circuit diagram of the independent keyboard 400 of the embodiment of the present invention, shares 4 buttons, by button S1, button S2, Button S3, button S4 and it is connected to the pull-up resistor R1 of power supply+VCC, pull-up resistor R2, pull-up resistor R3, pull-up resistor R4 groups At.4 output ends of independent keyboard 400 correspond the state of output key S1, button S2, button S3, button 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 button is not pressed The status signal at end is high level.
The first buffer register 101, the second buffer register 102, state Code memory 200, encoder 300 in Fig. 1, Data selection unit 500 forms Scan orientation circuit, and embodiment circuit diagram is as shown in Figure 3.Independent keyboard circuit output Status signal has 4, and therefore, the first buffer register 101, the second buffer register 102 require 4 bits of deposit According to 4 data input pin D10~D13 of the first buffer register 101 are sequentially connected to I1, I2, I3, I4, the second buffer stock 4 data input pin D14~D17 of device 102 are also sequentially connected to I1, I2, I3, I4.
Data selection unit 500 for realizing two-way input data selected and sorted with combine.In embodiment, two-way input 1 tunnel in data is that 4 data J, J include J3, J2, J1, J0;Other 1 tunnel be 4 data K, K include K3, K2, K1, K0;The output data on 18, tunnel is L.The function of data selection unit 500 is that there are two types of sequences to combine by 8 output data L, one Kind of sequence combination is 4 data J preceding, 4 data K rear, that is, export L7~L0 be followed successively by J3, J2, J1, J0, K3, K2, K1, K0;Another sequence combination is 4 data K preceding, 4 data J rear, that is, export L7~L0 be followed successively by K3, K2, K1, K0, J3,J2,J1,J0;Two kinds of sequence combinations are controlled by data select signal S.
Data selection unit 500 may be used data selector, three state buffer or other modes and realize.Fig. 4 is 500 embodiment schematic diagram of data selection unit selects 1 data selector 501,502 to form by 242,501,502 data choosing It selects signal S and is connected to scanning pulse CP2.When CP2 is low level, 42 select 1 data selector 501,502 selector channels 0, That is L7~L0 is equal to K3, K2, K1, K0, J3, J2, J1, J0;When CP2 is high level, 42 select 1 data selector 501,502 to select Channel 1 is selected, i.e. L7~L0 is equal to J3, J2, J1, J0, K3, K2, K1, K0.
State Code memory 200 requires 8 bit binary datas of deposit, 8 data input pin D27~D20 to be connected to number According to 8 data output end L7~L0 of selecting unit 500;8 input terminal A7~A0 of encoder 300 are connected to conditional code deposit 8 data output end Q27~Q20 of device 200.Encoder 300, which exports, is scanned through 4 determining binary system keys number of positioning.
In Fig. 3 embodiments, the first buffer register 101, the second buffer register 102, state Code memory 200 are by side It forms, is preferably made of the d type flip flop of edging trigger, for example, by double D trigger 74HC74,4D trigger along trigger 74HC175,8D trigger 74HC273 compositions.The triggering input terminal of 4 edge triggered flip flops in first buffer register 101 connects The composition that is connected together receives pulse input end, is connected to scanning pulse CP2, and failing edge carries out data latch;Second buffer stock The triggering input terminal of 4 edge triggered flip flops in device 102, which links together to form, receives pulse input end, is connected to scanning pulse CP2, rising edge carry out data latch;The triggering input terminal of 8 edge triggered flip flops of state Code memory 200 links together group At pulse input end is received, it is connected to Clock pulse CP 1, rising edge carries out data latch.
In Fig. 3 embodiments, the first buffer register 101, the second buffer register 102, state Code memory 200 are by upper The 8D trigger 74HC273 along triggering are risen, since the first buffer register 101 requires failing edge to carry out data latch, sweep It retouches pulse CP2 to need after a NOT gate reverse phase, is then connected to the reception pulse input end of the first buffer register 101;Separately Outside, so that the Protection Counter Functions of the 74HC273 is in invalid state, ensure the first buffer register 101, the second buffer register 102, state Code memory 200 has Trigger Function.
In Fig. 3 embodiments, encoder 300 is read-only memory.Address input end A7~A0 of read-only memory is coding The input terminal of device 300, data output end D3~D0 of read-only memory are coding output end C3~C0 of encoder 300.
Embodiment is not drawn into the oscillator for generating Clock pulse CP 1 and scanning pulse CP2, and oscillator is multivibrator, Clock pulse CP 1 and scanning pulse CP2 are exported, the period of Clock pulse CP 1 is 20~100ms, and scanning pulse CP2 is clock arteries and veins The two divided-frequency signal of CP1 is rushed, the waveform of CP1, CP2 are as shown in Figure 5.Clock pulse CP 1 and scanning pulse CP2 can also be by independences Circuit or device except formula keyboard scan and coding circuit provide.
Independent keyboard scanner uni coding method principle is as follows:
First buffer register 101, the second buffer register 102 are under scanning pulse CP2 controls, alternately to free-standing key Status signal I1, I2, I3, I4 of disk output carry out data latch;The output of the buffer register of newest latch data is known as Existing state key assignments, state key assignments before the output of the buffer register of latch data is known as slightly before, therefore, the first buffer register 101, the Two buffer registers 102 alternately export existing state key assignments and preceding state key assignments under scanning pulse CP2 controls.
Fig. 3 in conjunction with the embodiments and Fig. 5, after scanning pulse CP2 failing edges, in the low level state of scanning pulse CP2, The existing state key assignments of first buffer register 101 output is connected to input terminal J3, J2, J1, J0 of data selection unit 500, and second The preceding state key assignments that buffer register 102 exports is connected to input terminal K3, K2, K1, K0 of data selection unit 500, and counts at this time Be connected to scanning pulse CP2 according to selection signal S, be low level, output L7~L0 of data selection unit 500 be equal to K3, K2, K1, K0, J3, J2, J1, J0, i.e., before state key assignments preceding, existing state key assignments is rear;After scanning pulse CP2 rising edges, in scanning arteries and veins The high level state of CP2 is rushed, the preceding state key assignments of the first buffer register 101 output is connected to the input of data selection unit 500 Hold J3, J2, J1, J0, the second buffer register 102 output existing state key assignments be connected to data selection unit 500 input terminal K3, K2, K1, K0, and data select signal S is connected to scanning pulse CP2 at this time, is high level, the output of data selection unit 500 L7~L0 is equal to J3, J2, J1, J0, K3, K2, K1, K0, is equally preceding state key assignments preceding, and existing state key assignments is rear.
Scanning pulse CP2 states before controlling the first buffer register 101, the second buffer register 102 and alternately latching output At the time of key assignments, existing state key assignments and data selection unit 500 carry out data selected and sorted with combining, what can be formed is of short duration Nondeterministic statement.The effect of state Code memory 200 is to eliminate the influence of the nondeterministic statement.
The input of state Code memory 200 is that the preceding state key assignments that data selection unit 500 exports and existing state key assignments, output are same Sample is preceding state key assignments and existing state key assignments.State Code memory 200 is carried out to the edge of the Clock pulse CP 1 at the time of data latch Referred to as state latch edge is the rising edge of CP1 in embodiment;Scanning pulse CP2 is the two divided-frequency signal of Clock pulse CP 1, will Effective triggering edge of the Clock pulse CP 1 of control scanning pulse CP2 overturnings is known as status scan edge;In embodiment, state is swept It retouches along the failing edge for being Clock pulse CP 1, i.e. the first buffer register 101, the second buffer register 102, data selection unit 500 latch the failing edge in Clock pulse CP 1 at the time of exporting preceding state key assignments, existing state key assignments, therefore, in Clock pulse CP 1 Rising edge, the preceding state key assignments of the output of data selection unit 500, existing state key assignments come into stable state, eliminate above-mentioned uncertain The influence of state.
If effective triggering edge that Clock pulse CP 1 controls scanning pulse CP2 overturnings is failing edge, clock pulses The invalid triggering edge that CP1 controls scanning pulse CP2 overturnings is rising edge;If Clock pulse CP 1 controls scanning pulse CP2 and turns over The effective triggering edge turned is rising edge, then the invalid triggering edge that Clock pulse CP 1 controls scanning pulse CP2 overturnings is to decline Edge.The invalid triggering edge that Clock pulse CP 1 is controlled to scanning pulse CP2 overturnings is known as state latch edge;In embodiment, state Scanning is along the failing edge for being Clock pulse CP 1, and state latch is along the rising edge for being Clock pulse CP 1.
The 4 existing state key assignments and 4 preceding state key assignments of 200 data output end of state Code memory output collectively constitute 8 shapes State code.The current state and mode of operation of 8 conditional codes independent keyboard for identification.For example, in the present embodiment, nothing The conditional code of key pressing is 11111111;The conditional code of S1 key singly-bound pushes is 11111110;S1 key singly-bounds are pressed and are tieed up The conditional code held is 11101110;The conditional code of S1 key singly-bounds release operation is 11101111;The shape of S2 key singly-bound pushes State code is 11111101;The conditional code of S4 key singly-bound pushes is 11110111;The S1 pushes of S2+S1 combination operations, After expression first presses S2, the state pressed is maintained to press the operation of S1 again in S2, the conditional code of the operation is 11011100.
Encoder 300 is used to conditional code being converted to key number.In embodiment, it is equipped with 7 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 S1 is pushed button, key number is 0100;
Operation 5:After button S4 singly-bounds are pressed, then the combination key operation of S2 is pushed button, key number is 0101;
Operation 6:The singly-bound release operation of button S1, key number is 0110.
The conditional code and key number obtained according to above-mentioned regulation is shown in coding schedule 1.
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.Read-only memory has 8 bit address, and totally 28A 4 two System storage unit.7 effective keyboard operations have 7 effective status codes, corresponding 7 effective keys number with state;By state Address A7~A0 of the code as read-only memory, in storage unit corresponding with 7 effective status codes, by corresponding key number As storage data write-in.The conditional code generated except 7 effective keyboard operations and state is invalid state code, i.e., in table 1 Other operation or state caused by be invalid state code;In other storage units, invalid key number, invalid key is all written Number for a value except 7 effective keys number, in embodiment, invalid key number is 1111.
1 coding schedule of table
Keyboard operation Conditional code (address) Key number (storage data)
S1 singly-bounds are pressed 11111110 0000
S2 singly-bounds are pressed 11111101 0001
S3 singly-bounds are pressed 11111011 0010
S3 singly-bounds press maintenance 10111011 0011
S4+S1 combination operations 01110110 0100
S4+S2 combination operations 01110101 0101
S1 singly-bounds discharge 11101111 0110
Other operations or state ******** 1111
Read-only memory always works at data output state.When read-only memory has piece selected control system, data output slow When rushing 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 to match with this.If the number of bits of key number is M, the selection of M values is answered Meet 2MMore than or equal to the sum of effective key number and the quantity of invalid key number.When independent keyboard has the output of N bit keyboard status signals When, read-only memory 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.
In embodiment, when independent keyboard S1 singly-bounds are pressed, clock pulses of the encoder 300 after S1 singly-bounds are pressed The state latch edge of CP1 starts, until the state latch edge of next Clock pulse CP 1, the C3~C0 outputs of coding output end Key number 0000;When independent keyboard S2 singly-bounds are pressed, the state of Clock pulse CP 1 of the encoder 300 after S2 singly-bounds are pressed Edge is latched to start, until the state latch edge of next Clock pulse CP 1, run-out key number 0001;When independent keyboard is first pressed After lower S4, then S1 is pressed, the state latch edge that encoder 300 combines the Clock pulse CP 1 after key pressing in S1 starts, until next Until the state latch edge of a Clock pulse CP 1, run-out key number 0100;When independent keyboard S1 singly-bounds discharge, encoder 300 The state latch edge of Clock pulse CP 1 after the release of S1 singly-bounds starts, until the state latch edge of next Clock pulse CP 1 is Only, run-out key number 0110;It can therefore be seen that when identification be effective button operation of independent keyboard when, encoder 300 exists The state latch edge of Clock pulse CP 1 after effective button operation starts, until the state latch edge of next Clock pulse CP 1 Until, output duration is effective key number of 1 periodic width of Clock pulse CP.
In embodiment, when independent keyboard S3 singly-bounds are pressed, clock pulses of the encoder 300 after S3 singly-bounds are pressed The state latch edge of CP1 starts, until the state latch edge of next Clock pulse CP 1, run-out key number 0010;Following Clock pulse CP 1 state latch along starting, until next Clock pulse CP 1 after S3 singly-bounds press maintenance state Until state latch edge, 300 run-out key number 0011 of encoder;It can therefore be seen that work as identification is the maintenance of independent keyboard When state, 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 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 Clock pulse CP 1 state latch edge;In embodiment, encoder 300 is clock arteries and veins at the time of changing output content Rush the rising edge of CP1.
The period of Clock pulse CP 1 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 Clock pulse CP 1 should control in 20~100ms.
Fig. 6 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, the state latch edge of Clock pulse CP 1 of the encoder 300 after effective button operation is opened Begin, until the state latch edge of next Clock pulse CP 1, output duration is 1 periodic width of Clock pulse CP Effective key number.The device for receiving the independent keyboard output, needs the output for inquiring independent keyboard constantly, obtains key Number.The period distances of inquiry are necessarily less than the period of Clock pulse CP 1.
Circuit shown in Fig. 6 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. 6 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, 1 output end of Clock pulse CP of oscillator 500 is connected to; Delay buffer 601 carries out data latch on the state latch edge of Clock pulse CP 1.
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 1 period of Clock pulse CP, and Fig. 7 show the embodiment of the present invention The waveform correlation schematic diagram that effectively operates of keyboard.The sections T1 of Clock pulse CP 1 are located at, independent 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 S1 of S4+S1 combination operations It presses, the S2 of S4+S2 combination operations is pressed, the release of S1 singly-bounds.On the next state latch edge once effectively operated, i.e. Fig. 7 Rising edge after the sections middle Clock pulse CP 1T1, coding C3~C0 that encoder 300 exports change;In the sections 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 and enters maintenance state again, which may be that such as S1 singly-bounds press subsequent maintenance state, output Invalid key number, it is also possible to which S3 singly-bounds press subsequent maintenance state, export effective key number, until effectively operation next time.
Coding C3~C0 that D6 pulses in Fig. 7 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 fig. 7, 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. 7 reflected is the situation of change of C31~C01, it is clear that Q6 ratios D6 postpones 1 period of Clock pulse CP.Equally, the Q6 pulses are not present in actual circuit.
In Fig. 7, 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 postpone 1 period of Clock pulse CP, and therefore, when C0 changes, XOR gate 602 exports 1 clock arteries and veins Rush the positive pulse of CP1 periodic widths;When C0 is a 1 periodic width variable signal of Clock pulse CP, the output of XOR gate 602 2 The positive pulse of 1 periodic width of a Clock pulse CP.Whether XOR gate 603, XOR gate 604, XOR gate 605 judge C1~C3 respectively Change, principle with judge it is identical whether C0 changes.XOR gate 602, XOR gate 603, XOR gate 604, XOR gate 605 Output end be 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 1 period of Clock pulse CP, encoder 300 exports one When the efficient coding C3~C0 in period, starts and export efficient coding C3~C0 in output efficient coding C3~C0 and terminate all to generate The width of one keyboard state change pulse, keyboard state change pulse is equal to RC circuit delay times;If RC circuits prolong The slow time is more than or equal to 1 period of Clock pulse CP, then when encoder 300 exports efficient coding C3~C0 of a cycle, A keyboard state change pulse is generated when exporting efficient coding C3~C0 and starting, pulse width is more than or equal to 2 clock arteries and veins Rush the CP1 periods.It is required that the delay time of RC circuits is no more than 21 periods of Clock pulse CP, failed to report in order to avoid generating.
In embodiment, the first buffer register 101 carries out data latch, the second buffering in the failing edge of scanning pulse CP2 Rising edge of the register 102 in scanning pulse CP2 carries out data latch.It can also scanned using the first buffer register 101 The rising edge of pulse CP2 carries out data latch, and failing edge of second buffer register 102 in scanning pulse CP2 carries out data lock The mode deposited, at this point, the output of data selection unit 500 forms state with existing state key assignments in preceding, the preceding posterior mode of state key assignments Code.The conditional code that existing state key assignments is formed in preceding, the preceding posterior mode of state key assignments is equally applicable to the present invention.
In embodiment, the input connection type of change data selecting unit 500 equally can be with existing state key assignments preceding, preceding The posterior mode of state key assignments forms conditional code.
In the invention circuit, will to single key stroke, combination key operation, keyboard maintain state operation positioning, by when Clock CP1, scanning pulse CP2 controls are converted into the conditional code of same binary length, are carried out by the way of Unified coding Processing, 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 adjust button operation function, keyboard scanning circuit structure need not be changed, only need to be according to increase and decrease after State code table update encoder 300 encoded content, i.e. re-write update read-only memory storage content.It is described Invention circuit does not use the microcontrollers such as microcontroller, ARM, does not have to operation program, reliable operation.

Claims (10)

1. a kind of independent keyboard scanner uni coding method, it is characterised in that:Include the independent keyboard output N of N number of button Bit keyboard status signal;Scanning pulse carries out data to N bit keyboard status signals and latches and select, and obtains existing state key assignments and preceding state Key assignments;Clock pulses carries out state latch to existing state key assignments and preceding state key assignments, obtains 2 × N conditional codes;Conditional code is carried out Encode simultaneously run-out key number;Institute's rheme is binary digit.
2. independent keyboard scanner uni coding method according to claim 1, it is characterised in that:The scanning pulse is to N The data that bit keyboard status signal carry out latch and selection, and obtaining existing state key assignments and the method for preceding state key assignments is, the height of scanning pulse, The output end of 2 buffer registers of low level control alternately exports existing state key assignments and preceding state key assignments.
3. independent keyboard scanner uni coding method according to claim 1, it is characterised in that:The conditional code is by effective Conditional code and invalid state code form, for identification the current state and mode of operation of independent keyboard;The key number is 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 scanner uni coding method according to claim 3, it is characterised in that:Effective keyboard operation Maintenance operation, combination key operation are pressed including singly-bound push, singly-bound release operation, singly-bound;The combination key operation refers to After singly-bound is pressed, then press the operation of other buttons;The invalid keyboard operation is the operation except effective keyboard operation.
5. independent keyboard scanner uni coding method according to claim 3, it is characterised in that:The key number is M, M The selection of value should meet 2MMore than or equal to the sum of effective key number and the quantity of invalid key number.
6. independent keyboard scanner uni coding method according to claim 5, it is characterised in that:It is described that conditional code is carried out It encodes and run-out key number is realized by encoder.
7. the independent keyboard scanner uni coding method according to any one of claim 2-6, it is characterised in that:It is described to sweep It retouches pulse and data latch and selection is carried out to N bit keyboard status signals, obtain existing state key assignments and posted by the first buffering with preceding state key assignments Storage, the second buffer register, data selection unit are realized.
8. independent keyboard scanner uni coding method according to claim 7, it is characterised in that:First buffer stock Device and the second buffer register are N binary registers;The positions the N data input pin of first buffer register connects successively N bit keyboard status signal outputs are connected to, the positions the N data input pin of the second buffer register is sequentially connected to N bit keyboard states The reception pulse input end of signal output end, the first buffer register and the second buffer register is connected to scanning pulse;
It is defeated that the data selection unit is equipped with N data input pins of the first via, the second road N data input pin and 2 × N data Outlet;The first via N data input pins are sequentially connected to the positions the N data output end of the first buffer register, second road N Data input pin is sequentially connected to the positions the N data output end of the second buffer register;
The data selection unit is additionally provided with data select signal end;The data select signal end is connected to scanning pulse.
9. independent keyboard scanner uni coding method according to claim 8, it is characterised in that:The 2 of data selection unit In the output of × N data, when the scanning pulse is low level, N data of the first via are preceding, and second road N data is rear;Institute When to state scanning pulse be high level, N data of the first via are rear, and second road N data is preceding;Either, data selection unit The output of the positions 2 × N data in, when the scanning pulse is low level, rear, second road N data exists N data of the first via Before;When the scanning pulse is high level, N data of the first via are preceding, and second road N data is rear.
10. the independent keyboard scanner uni coding method according to any one of claim 2-6, it is characterised in that:It is described Clock pulses carries out state latch to existing state key assignments and preceding state key assignments, and it is real by state Code memory to obtain 2 × N conditional codes It is existing;
The state Code memory is 2 × N binary registers;The positions the 2 × N data input pin of state Code memory is connected to The positions the 2 × N data output end of data selection unit receives pulse input end and is connected to clock pulses;State Code memory when The state latch of clock is along progress data latch.
CN201810591960.8A 2016-01-05 2016-01-05 Independent keyboard scanning and coding method Expired - Fee Related CN108809322B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810591960.8A CN108809322B (en) 2016-01-05 2016-01-05 Independent keyboard scanning and coding method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810591960.8A CN108809322B (en) 2016-01-05 2016-01-05 Independent keyboard scanning and coding method
CN201610003246.3A CN105471439B (en) 2016-01-05 2016-01-05 Independent keyboard scanner uni coding circuit

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201610003246.3A Division CN105471439B (en) 2016-01-05 2016-01-05 Independent keyboard scanner uni coding circuit

Publications (2)

Publication Number Publication Date
CN108809322A true CN108809322A (en) 2018-11-13
CN108809322B CN108809322B (en) 2022-01-21

Family

ID=55608807

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201610003246.3A Active CN105471439B (en) 2016-01-05 2016-01-05 Independent keyboard scanner uni coding circuit
CN201810591960.8A Expired - Fee Related CN108809322B (en) 2016-01-05 2016-01-05 Independent keyboard scanning and coding method

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201610003246.3A Active CN105471439B (en) 2016-01-05 2016-01-05 Independent keyboard scanner uni coding circuit

Country Status (1)

Country Link
CN (2) CN105471439B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS54157448A (en) * 1978-06-02 1979-12-12 Hitachi Ltd Data entry device
JPS5611583A (en) * 1979-07-09 1981-02-04 Sharp Corp Word processor for japanese sentence
JPS57166628A (en) * 1981-04-06 1982-10-14 Nippon Telegr & Teleph Corp <Ntt> "kana"-"kanji" converting input device
CN85103803A (en) * 1985-05-11 1986-11-05 数字设备公司 The signals path control circuitry of data terminal
CN1412650A (en) * 2002-11-20 2003-04-23 威盛电子股份有限公司 Keyboard control circuit of universal serial bus interface
CN2919362Y (en) * 2005-12-01 2007-07-04 华中科技大学 Embedded type mouse keyboard
CN101464484A (en) * 2007-12-21 2009-06-24 虹光精密工业(苏州)有限公司 Circuit for detecting key-press status
CN202059394U (en) * 2011-05-09 2011-11-30 广州励丰声光科技有限公司 Matrix keyboard scanning device based on programmable element
CN103226391A (en) * 2013-05-22 2013-07-31 湖南工业大学 Scan locating method for independent keyboard

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8203348B1 (en) * 2009-05-01 2012-06-19 Christos Tsironis Autonomous impedance tuner with human control interface
CN101840268B (en) * 2010-04-23 2012-02-15 中国电子科技集团公司第五十四研究所 Method for fast scanning and positioning of matrix keyboard
CN101958717B (en) * 2010-09-29 2013-04-03 惠州Tcl移动通信有限公司 Key scanning method and key scanning device
CN102637075A (en) * 2011-02-14 2012-08-15 苏州巴米特信息科技有限公司 Design method of special matrix keyboard

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS54157448A (en) * 1978-06-02 1979-12-12 Hitachi Ltd Data entry device
JPS5611583A (en) * 1979-07-09 1981-02-04 Sharp Corp Word processor for japanese sentence
JPS57166628A (en) * 1981-04-06 1982-10-14 Nippon Telegr & Teleph Corp <Ntt> "kana"-"kanji" converting input device
CN85103803A (en) * 1985-05-11 1986-11-05 数字设备公司 The signals path control circuitry of data terminal
CN1412650A (en) * 2002-11-20 2003-04-23 威盛电子股份有限公司 Keyboard control circuit of universal serial bus interface
CN2919362Y (en) * 2005-12-01 2007-07-04 华中科技大学 Embedded type mouse keyboard
CN101464484A (en) * 2007-12-21 2009-06-24 虹光精密工业(苏州)有限公司 Circuit for detecting key-press status
CN202059394U (en) * 2011-05-09 2011-11-30 广州励丰声光科技有限公司 Matrix keyboard scanning device based on programmable element
CN103226391A (en) * 2013-05-22 2013-07-31 湖南工业大学 Scan locating method for independent keyboard

Also Published As

Publication number Publication date
CN108809322B (en) 2022-01-21
CN105471439B (en) 2018-07-24
CN105471439A (en) 2016-04-06

Similar Documents

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

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

Granted publication date: 20220121

CF01 Termination of patent right due to non-payment of annual fee