CN100390712C - Method for realizing programmable special keyboard - Google Patents
Method for realizing programmable special keyboard Download PDFInfo
- Publication number
- CN100390712C CN100390712C CNB2006100454300A CN200610045430A CN100390712C CN 100390712 C CN100390712 C CN 100390712C CN B2006100454300 A CNB2006100454300 A CN B2006100454300A CN 200610045430 A CN200610045430 A CN 200610045430A CN 100390712 C CN100390712 C CN 100390712C
- Authority
- CN
- China
- Prior art keywords
- keyboard
- data
- main frame
- information
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Input From Keyboards Or The Like (AREA)
- Communication Control (AREA)
Abstract
The present invention discloses a method for realizing a programmable special keyboard. Through a PS/2 standard interface of a common computer and under the precondition that the driving of a system is not changed, through a self-defining communication protocol, data are encoded and decoded to realize the data communication between a computer and the special keyboard. A user can edit any self-defining keyboard information in upper layer editing software to make the self-defining keyboard information become the data allowed by a main machine operating system. Through the PS/2 standard interface of the common computer, the data is downloaded in the flash of the keyboard to realize the programmability of keyboard and keystroke information and on-line upgrade of new version program. Simultaneously, the current keystroke information of the keyboard can be passed in an upper layer editting interface of the common computer through the PS/2 standard interface and is displayed to realize that the bidirectional interaction of the information, and the reliability and the stability of system communication are enhanced.
Description
Technical field
The present invention relates to a kind of implementation method of programmable keyboard, specifically, relate to a kind of PS/2 standard interface by common computer, realize the data communication between computing machine and the keyboard special, with the upgrading of the able to programme and redaction of finishing keyboard information.
Background technology
In commercial cash collecting system, the used terminal keyboard of salesman is not common PC keyboard, but satisfies the keyboard special of cash collecting system requirement.This keyboard will define the content of each button according to the requirement of system software, so just needs a programmable keyboard to satisfy this demand.When main frame and keyboard carry out data transmission by the PS/2 interface, because operating system (DOS, WINDOWS, LINUX) predetermined restricted to main frame, data by the PS/2 interface must be the data that system allows, and the data that nonsystematic allows will be filtered, and cause the imperfect of data transmission.In order to solve this limitation, general programmable keyboard all adopts the filtration drive method when communicating by the PS/2 interface, be the driving in the rewriting operation system,, any data can be transmitted by standard P S/2 interface changes that adjust of the place of shadow data in driving.Adopt this transmission method can cause some unpredictable Bug, therefore, bigger risk is arranged all on reliability and compatibility system.
Summary of the invention
The present invention realizes communicating by letter of data between main frame and the keyboard in order to solve available technology adopting filtration drive method, to finish coding to keyboard information, the problem that on system reliability and compatibility, has greater risk, a kind of implementation method able to programme of brand-new keyboard special is provided, adopt the method for self-defining communication protocol, system is not being had under the situation of any change, realizing the communication of data, thereby effectively strengthening the reliability and stability of system by encoding and decoding technique.
For solving the problems of the technologies described above, the present invention is achieved by the following technical solutions:
A kind of programmable method of keyboard special may further comprise the steps:
1-1, host code key information data make it become the data that host computer system allows;
Data after 1-2, main frame will be encoded are transferred to keyboard by the standard interface between main frame and the keyboard;
1-3, keyboard are decoded to the data that receive, and revert to original key information data and are saved in the storer, and the key information in the storer is made amendment.
Wherein, in described key information data, comprise the data that non-host computer system allows.
As the further qualification to technique scheme, the specific implementation method of described step 1-2 is:
1, main frame output command word, and empty counter, promptly put count=0;
2, main frame sends count data to keyboard, and waits for the answer signal that the reception keyboard sends;
3, in official hour, if main frame receives the answer signal that sends from keyboard, then counter adds 1, and whether judgment data send and finish, and does not finish if data send as yet, returns 2-2; If main frame is not received the answer signal that keyboard is sent in official hour, then resend these data; If after retransmitting the number of times of these data and reaching setting value, still do not receive the answer signal that sends from keyboard, then withdraw from communication pattern, prompting communication is overtime.The setting value of described retransmission data number of times is defined according to actual conditions in advance voluntarily by the user.
As the further qualification again to technique scheme, the addressing mode of button adopts by the fixing address offset amount of key information comes the deposit position of inquiry button information in the keyboard storer, and then output key information.
Compared with prior art, advantage of the present invention and good effect are: the implementation method able to programme of keyboard special of the present invention adopts self-defining communication protocol, system is not being had under the situation of any change, by the communication of encoding and decoding technique realization data, the reliability and stability of system have effectively been strengthened.Programmable keyboard all has greatly improved than original OEM keyboard in unitarity, system compatibility and the fault-tolerance of version, also can be accustomed to convenient the adjustment according to the user aspect keyboard applications, and is convenient autonomous with system upgrade etc. after sale.
Description of drawings
Fig. 1 is an overview flow chart of realizing data communication among the present invention between main frame and the keyboard;
Fig. 2-the 1st is from the specific procedure process flow diagram of main frame main frame when the keyboard data download;
Fig. 2-the 2nd is from the specific procedure process flow diagram of main frame keyboard when the keyboard data download;
Fig. 3-the 1st is from the specific procedure process flow diagram of keyboard keyboard when main frame is uploaded data;
Fig. 3-the 2nd is from the specific procedure process flow diagram of keyboard main frame when main frame is uploaded data.
Embodiment
The present invention will be further described in detail below in conjunction with the drawings and specific embodiments.
The present invention under the prerequisite of not changing system drive, comes codec data by self-defining communication protocol by the PS/2 standard interface of common computer, realizes the data communication between computing machine and the keyboard special.The user can be at the self-defining any keypad information of upper strata software for editing inediting, make it become the data that host operating system allows, PS/2 standard interface by common computer downloads among the Flash of keyboard, realizes the online upgrading of the able to programme and redaction program of keyboard information.Simultaneously, the current key information of keyboard also can upload to by the PS/2 interface of standard in the upper strata editing interface of common computer and show, thereby has realized the two-way interactive of information.
The addressing mode of button has a variety of, and implementation method is of all kinds.The present invention adopts is that fixing address offset amount by key information inquires the storage address of key information in Flash, thereby realizes the output of key information.This mode addressing is simple, speed is fast, can in time inquire the deposit position of its information according to key position, the promptness of guarantee information output.
For ensureing accuracy and the fault-tolerance of data the time by the transmission of PS/2 interface, avoid in communication, having the generation of bottom pour ladle, Cuo Bao, duplicate packages and host/device fortuitous event such as improper power down in communicating by letter, communication protocol adopts replys the formula interactive mode, be that main frame is when sending data to keyboard, if keyboard is received this data, send an ACK to main frame and respond; In the certain hour scope, if receiving the ACK of keyboard, main frame responds, just send next data, otherwise just resend current data, wait for that then the ACK of keyboard responds; If main frame is sending P does not receive keyboard all over (P is by User Defined) current data ACK response, just withdraw from data-transmission mode, abandon the transmission of this secondary data, point out present keyboard hardware to be connected with problem, perhaps connecting line disconnects, the perhaps unexpected power down of keyboard.In like manner, when keyboard sends data to main frame, also adopt said method to guarantee the stability of communicating by letter.
The formal definition of PS/2 interface standard Frame is as shown in table 1:
1 start bit | Logical zero always | |
8 data bit | (LSB) low level is preceding | |
1 parity | Odd | |
1 position of rest | Logical one always | |
1 response bits | Only be used in the communication of main frame to equipment |
Self-defining communication protocol is:
1) main frame is downloaded the communication format of keyboard configuration information to keyboard:
The self-defined configuration information of the command word of 1 byte+several bytes;
2) main frame is downloaded the communication format of keyboard-coding information to keyboard:
The command word of 1 byte
The button address offset amount of+2 * key number * 2 * N byte
The key coded system of+2 bytes
The key length information of+2 bytes
The concrete key scan code of+several bytes;
Wherein, N represents the number of plies, and each button be to should there being multilayer, the key code information difference of each layer, and promptly same button is in the different function of different layers representative, and different users have the authorization privilege of different layers;
3) main frame is to the communication format of keyboard download and upgrade redaction program:
The version binary code of the command word of 1 byte+several bytes;
4) keyboard is uploaded the communication format of key information to main frame:
The command word of 1 byte
The self-defined configuration information of+several bytes
The button address offset amount of+2 * key number * 2 * N byte
The key coded system of+2 bytes
The key length information of+2 bytes
The concrete key scan code of+several bytes;
Wherein, N represents the number of plies.
Fig. 1 is an overview flow chart of realizing data communication between main frame and the keyboard, and its concrete steps are:
1-1, transmitting terminal output command word, and empty counter, promptly put count=0;
1-2, transmitting terminal send count data to receiving end, and wait for the answer signal that the reception receiving end sends;
If 1-3 receives answer signal, then counter adds 1, and whether judgment data send and finish, and does not finish if data send as yet, returns 1-2; Finish if data send, jump to 1-4; If do not receive answer signal within a certain period of time, judge whether communication is overtime, overtime as if not having, return 1-2; If communication is overtime, jump to 1-4;
1-4, withdraw from communication pattern.
Fig. 2 is that its concrete steps are from the specific procedure process flow diagram (no matter being the download or the upgrading redaction of key information) of main frame to the keyboard data download:
2-1, main frame empty counter according to the communication protocol coding raw data that defines, and promptly put count=0;
2-2, count byte packing data become to meet the standard format of PS/2 interface transmission requirement, send to keyboard according to the form of table 1;
The data that 2-3, keyboard receive behind the coding reply for host A CK, are decoded into raw data and store among the Flash;
2-4, main frame are waited within a certain period of time and are received the ACK answer that keyboard sends, and do not receive the ACK answer that keyboard sends if surpass this time, then repeat to send current data once; Otherwise, jump to 2-6;
Whether the number of times that current data is retransmitted in 2-5, judgement reaches setting value P; If reach setting value P, then expression communication is overtime, jumps to 2-7; Otherwise, jump to 2-4;
2-6, counter count+1, whether judgment data sends finishes, and does not finish if send, and jumps to 2-2; Otherwise, jump to 2-8;
2-7, main frame are abandoned the transmission of this secondary data, point out present keyboard hardware to be connected with problem; Keyboard does not still receive the data that main frame sends after exceeding call duration time, then abandon the storage of this secondary data, empties the data that receive among the Flash;
2-8, withdraw from communication pattern.
Fig. 3 uploads the specific procedure process flow diagram of data from keyboard to main frame, and its concrete steps are:
3-1, keyboard empty counter according to the communication protocol coding raw data that defines, and promptly put count=0;
3-2, count byte packing data become to meet the standard format of PS/2 interface transmission requirement, send to main frame according to the form of table 1;
The data that 3-3, main frame receive behind the coding reply for keyboard ACK, are decoded into raw data and store among the RAM;
3-4, keyboard are waited within a certain period of time and are received the ACK answer that main frame sends, and do not receive the ACK answer that main frame sends if surpass this time, then repeat to send current data once; Otherwise, jump to 3-6;
Whether the number of times that current data is retransmitted in 3-5, judgement reaches setting value P; If reach setting value P, then expression communication is overtime, jumps to 3-7; Otherwise, jump to 3-4;
3-6, counter count+1, whether judgment data sends finishes, and does not finish if send, and jumps to 3-2; Otherwise, jump to 3-8;
3-7, keyboard are abandoned the transmission of this secondary data; Main frame does not still receive the data that keyboard sends after exceeding call duration time, then abandon the storage of this secondary data, empties the data among the RAM, points out present keyboard hardware to be connected with problem, and jumps to 3-9;
3-8, main frame show true form information according to the addressing mode resolution data in editing interface;
3-9, withdraw from communication pattern.
The present invention comes codec data by adopting above-mentioned self-defining communication protocol, realizes the data communication between computing machine and the keyboard special, has effectively strengthened the reliability and stability of system.Certainly; above-mentioned explanation is not to be limitation of the present invention; the present invention also is not limited in above-mentioned giving an example, and variation, remodeling, interpolation or replacement that those skilled in the art are made in essential scope of the present invention also should belong to protection scope of the present invention.
Claims (9)
1. the programmable method of a keyboard special may further comprise the steps:
1-1, host code key information data make it become the data that host computer system allows;
Data after 1-2, main frame will be encoded are transferred to keyboard by the standard interface between main frame and the keyboard;
1-3, keyboard are decoded to the data that receive, and revert to original key information data and are saved in the storer, and the key information in the storer is made amendment.
Wherein, in described key information data, comprise the data that non-host computer system allows.
2. the programmable method of keyboard special according to claim 1, it is characterized in that: the specific implementation method of described step 1-2 is:
2-1, main frame output command word, and empty counter, promptly put count=0;
2-2, main frame send count data to keyboard, and wait for the answer signal that the reception keyboard sends;
2-3, in official hour, if main frame receives the answer signal that sends from keyboard, then counter adds 1, and whether judgment data send and finish, and does not finish if data send as yet, returns 2-2; If main frame is not received the answer signal that keyboard is sent in official hour, then resend these data; If after retransmitting the number of times of these data and reaching setting value, still do not receive the answer signal that sends from keyboard, then withdraw from communication pattern, prompting communication is overtime.
3. the programmable method of keyboard special according to claim 2 is characterized in that: the setting value of described retransmission data number of times is by user's definition voluntarily in advance.
4. the programmable method of keyboard special according to claim 3 is characterized in that: the addressing mode of button adopts by the fixing address offset amount of key information comes the deposit position of inquiry button information in the keyboard storer, and then output key information.
5. the programmable method of keyboard special according to claim 4 is characterized in that: carry out data communication by the PS/2 interface between main frame and the keyboard; The formal definition of described PS/2 interface data frame is: 1 start bit, 8 data bit, 1 parity check bit, 1 position of rest and 1 response bits.
6. the programmable method of keyboard special according to claim 5 is characterized in that: the communication format that main frame is downloaded the keyboard configuration information to keyboard is: the self-defined configuration information of the command word of 1 byte+several bytes.
7. the programmable method of keyboard special according to claim 6 is characterized in that: main frame is downloaded the communication format of keyboard-coding information to keyboard:
The command word of 1 byte
The button address offset amount of+2 * key number * 2 * N byte
The key coded system of+2 bytes
The key length information of+2 bytes
The concrete key scan code of+several bytes;
Wherein, N represents the number of plies.
8. the programmable method of keyboard special according to claim 7 is characterized in that: main frame is to the communication format of keyboard download and upgrade redaction program: the version binary code of the command word of 1 byte+several bytes.
9. the programmable method of keyboard special according to claim 8, it is characterized in that: the communication format that keyboard is uploaded key information to main frame is:
The command word of 1 byte
The self-defined configuration information of+several bytes
The button address offset amount of+2 * key number * 2 * N byte
The key coded system of+2 bytes
The key length information of+2 bytes
The concrete key scan code of+several bytes;
Wherein, N represents the number of plies.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100454300A CN100390712C (en) | 2006-07-10 | 2006-07-10 | Method for realizing programmable special keyboard |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100454300A CN100390712C (en) | 2006-07-10 | 2006-07-10 | Method for realizing programmable special keyboard |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1885244A CN1885244A (en) | 2006-12-27 |
CN100390712C true CN100390712C (en) | 2008-05-28 |
Family
ID=37583411
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100454300A Expired - Fee Related CN100390712C (en) | 2006-07-10 | 2006-07-10 | Method for realizing programmable special keyboard |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100390712C (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106201014B (en) * | 2016-07-07 | 2018-08-31 | 西北工业大学 | A kind of programmable PS2 interface UAV system button decoders of multichannel |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2313243Y (en) * | 1997-11-25 | 1999-04-07 | 四川鼎天微电有限公司 | Keyboard input process for domestic multi-media system |
JP2005196339A (en) * | 2004-01-05 | 2005-07-21 | Kye Systems Corp | Wireless peripheral device adapting to wireless network |
-
2006
- 2006-07-10 CN CNB2006100454300A patent/CN100390712C/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2313243Y (en) * | 1997-11-25 | 1999-04-07 | 四川鼎天微电有限公司 | Keyboard input process for domestic multi-media system |
JP2005196339A (en) * | 2004-01-05 | 2005-07-21 | Kye Systems Corp | Wireless peripheral device adapting to wireless network |
Also Published As
Publication number | Publication date |
---|---|
CN1885244A (en) | 2006-12-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100366029C (en) | Communication controller, host-side controller, communication equipment, communication system and method | |
CN101309436B (en) | Matching authentication method, apparatus and system for radio communication apparatus | |
US6031867A (en) | Modem with firmware upgrade feature | |
CN102075741B (en) | Image transmission method, terminal and system | |
AU598917B2 (en) | Improvements in or relating to data transmission systems and methods of transmitting data | |
CN1287567C (en) | Multimedium communication method and apparatus on grouped channels | |
CN105683933B (en) | Camera control interface is communicated from equipment to from equipment | |
CN102902653A (en) | Serial communication protocol for controller | |
JPS62169537A (en) | Method for detecting and restoring transmission error | |
WO2001020892A2 (en) | A method for transmitting data between respective first and second modems in a telecommunications system, and a telecommunications system | |
CN104620564A (en) | Transmission of multiple protocol data elements via an interface utilizing a data tunnel | |
CN103000008A (en) | Method and apparatus for responding remote signals of remote receiving equipment | |
CN100390712C (en) | Method for realizing programmable special keyboard | |
CN101052938B (en) | Low latency data packet reception and processing | |
US20020114000A1 (en) | Data control apparatus, data control method thereof and image forming apparatus | |
CN101409727B (en) | Document transmission method and apparatus | |
CN103229444A (en) | Coding/decoding method, device and system | |
CN110329861B (en) | Intelligent elevator gateway, elevator control system and elevator control method | |
CN102998994B (en) | Embedded blood analyzer control system and control method thereof | |
CN101179798B (en) | Operation method and device for transmitting data between mobile phones | |
WO2002039592A1 (en) | Method and apparatus for sending and receiving a data structure in a constituting element occurence frequency based compressed form | |
CN101887403B (en) | Data transmission method and device for saving space of memory used for accessing packet in universal serial bus protocol | |
GB2328344A (en) | Detachable or remote input reading and display module that operates independently and with telephone | |
CN102023957A (en) | Method for stimulating multiple serial ports by a USB interface for transmitting data and USB compound device | |
US5056113A (en) | Data communication system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20080528 Termination date: 20190710 |