CN101738952A - Method for realizing keys of single chip microcomputer - Google Patents

Method for realizing keys of single chip microcomputer Download PDF

Info

Publication number
CN101738952A
CN101738952A CN200910200413A CN200910200413A CN101738952A CN 101738952 A CN101738952 A CN 101738952A CN 200910200413 A CN200910200413 A CN 200910200413A CN 200910200413 A CN200910200413 A CN 200910200413A CN 101738952 A CN101738952 A CN 101738952A
Authority
CN
China
Prior art keywords
button
key
keys
judgement
chip microcomputer
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.)
Pending
Application number
CN200910200413A
Other languages
Chinese (zh)
Inventor
杨凤生
陈公伦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHANGHAI CO Ltd OF FINE SCIENTIFIC INSTRUMENTS
Original Assignee
SHANGHAI CO Ltd OF FINE SCIENTIFIC INSTRUMENTS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHANGHAI CO Ltd OF FINE SCIENTIFIC INSTRUMENTS filed Critical SHANGHAI CO Ltd OF FINE SCIENTIFIC INSTRUMENTS
Priority to CN200910200413A priority Critical patent/CN101738952A/en
Publication of CN101738952A publication Critical patent/CN101738952A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to a method for realizing keys of a single chip microcomputer, comprising the following steps of: integrating keys, i.e. integrating I/O ports of more keys into a register; deciding a new key when a key is judged to be pressed according to the keying condition; and using the former key as an old key relative to a new key to carry out old key lookup shunt procedure which comprises the following three conditions: judgment of no keying, judgment of common, continuous key and long-pressing repeatedly-used keying and judgment of more ineffective keying. The invention realizes the method for processing keys of a single chip microcomputer, which can avoid system halting and ineffective keying.

Description

A kind of keys of single chip microcomputer implementation method
Technical field
The invention belongs to the single-chip microcomputer applied technical field, relate in particular to a kind of implementation method of keys of single chip microcomputer.
Background technology
In the single chip circuit design of equipment such as instrument and meter, because the resource of single-chip microcomputer is very limited, design for dedicated button is to carry out the simplest design according to the needs that use on the one hand, owing to can not use special-purpose button treatment circuit, all can directly use the system resource of single-chip microcomputer itself to award the button processing usually on the one hand.Wherein adopting system scan is mode wherein commonly used.And this mode is often handled owing to the simplification on designing, because user's problem can cause the situation of system in case of system halt, for example the easy appearance under the situation of quick button continuously of equipment or machine is crashed, the button invalid situation.
Summary of the invention
The purpose of this invention is to provide and a kind ofly can avoid crashing and the invalid keys of single chip microcomputer implementation method of button.
Technical scheme of the present invention is that a kind of keys of single chip microcomputer implementation method is characterized in that, comprising:
The I/O mouth of a plurality of buttons is incorporated into an integrating keys step in the register;
When judgement has a button to press, be and confirm new key, confirm new key step according to the button situation simultaneously;
With respect to new key last time button as old key, according to the old key branch program step of tabling look-up;
The described old key branch program of tabling look-up comprises the judgement that do not have button or common, interlock and long judgement or the invalid three kinds of situations of judgement of a plurality of button by multiplexing button.
For the judgement that does not have button,, then remove common key-press, long button, interlock button sign and sign and handle if judge that new key is arranged.
For common, interlock and long judgement, if judge there is not new key, if longly then withdraw from this step, if not common key-press and be that the interlock sign then enters the interlock handling procedure by button by multiplexing button.
The present invention has realized a kind of problem of avoiding misoperation to crash for the button processing of the single-chip microcomputer of resource-constrained.
Description of drawings
Fig. 1 is a processing flow chart total in one embodiment of the invention
Fig. 2 is for the processing flow chart of no button in one embodiment of the invention
Fig. 3 is for the processing flow chart of tabling look-up according to old key and shunting in one embodiment of the invention
Fig. 4 is the process flow diagram of handling for multikey in one embodiment of the invention
Embodiment
As Fig. 1, Fig. 2, Fig. 3 and Fig. 4, the specific embodiment of the present invention is a kind of keys of single chip microcomputer implementation method, comprising: the I/O mouth of a plurality of buttons is incorporated into an integrating keys step in the register; When judgement has a button to press, be and confirm new key, confirm new key step according to the button situation simultaneously; With respect to new key last time button as old key, according to the old key branch program step of tabling look-up; The described old key branch program of tabling look-up comprises the judgement that do not have button or common, interlock and long judgement or the invalid three kinds of situations of judgement of a plurality of button by multiplexing button.For the judgement that does not have button,, then remove common key-press, long button, interlock button sign and sign and handle if judge that new key is arranged.For common, interlock and long judgement, if judge there is not new key, if longly then withdraw from this step, if not common key-press and be that the interlock sign then enters the interlock handling procedure by button by multiplexing button.
This button handling procedure is a modularized program, wherein its dependent variable in the variable discord program is related, and this modularized program comprised all patterns (button, common single keys presses, button, long) continuously of button by button thus fundamentally solved a lot of before this equipment, machine occur easily crashing in the absence of button continuously fast, the button invalid situation.Because modular design, the present invention can both be suitable for the button program of all devices.

Claims (3)

1. a keys of single chip microcomputer implementation method is characterized in that, comprising:
The I/O mouth of a plurality of buttons is incorporated into an integrating keys step in the register;
When judgement has a button to press, be and confirm new key, confirm new key step according to the button situation simultaneously;
With respect to new key last time button as old key, according to the old key branch program step of tabling look-up;
The described old key branch program of tabling look-up comprises the judgement that do not have button or common, interlock and long judgement or the invalid three kinds of situations of judgement of a plurality of button by multiplexing button.
2. keys of single chip microcomputer implementation method as claimed in claim 1 is characterized in that, for the judgement that does not have button, if judge that new key is arranged, then removes common key-press, long button, interlock button sign and sign and handles.
3. keys of single chip microcomputer implementation method as claimed in claim 1, it is characterized in that, not having new key if judge for common, interlock and long judgement by multiplexing button, if long then withdraw from this step, if not common key-press and be that the interlock sign then enters the interlock handling procedure by button.
CN200910200413A 2009-12-22 2009-12-22 Method for realizing keys of single chip microcomputer Pending CN101738952A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910200413A CN101738952A (en) 2009-12-22 2009-12-22 Method for realizing keys of single chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910200413A CN101738952A (en) 2009-12-22 2009-12-22 Method for realizing keys of single chip microcomputer

Publications (1)

Publication Number Publication Date
CN101738952A true CN101738952A (en) 2010-06-16

Family

ID=42462526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910200413A Pending CN101738952A (en) 2009-12-22 2009-12-22 Method for realizing keys of single chip microcomputer

Country Status (1)

Country Link
CN (1) CN101738952A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104807130A (en) * 2014-01-23 2015-07-29 广东美的制冷设备有限公司 Virtual key method and system for self-defined parameters of air conditioner
CN109189242A (en) * 2018-09-30 2019-01-11 天津市英贝特航天科技有限公司 A kind of key board unit and working method based on PS2 agreement

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104807130A (en) * 2014-01-23 2015-07-29 广东美的制冷设备有限公司 Virtual key method and system for self-defined parameters of air conditioner
CN104807130B (en) * 2014-01-23 2017-12-22 广东美的制冷设备有限公司 The virtual key generation method and system of air conditioner custom parameter
CN109189242A (en) * 2018-09-30 2019-01-11 天津市英贝特航天科技有限公司 A kind of key board unit and working method based on PS2 agreement

Similar Documents

Publication Publication Date Title
CN103699454B (en) Emergency processing method of broken touch screen of computer system and application of emergency processing method
CN101398732B (en) Implementing method of sliding control in terminal human-computer interaction
WO2003067409A3 (en) Device for inputting text by actuating keys of a numeric keypad for electronic devices and method for processing input impulses during text input
BRPI0702002A8 (en) Mobile communication terminal with touch screen and information input method using the same
CN101644960A (en) Mistaken touch prevention method of combined keys and electronic device using same
WO2003088011A2 (en) Mobile arithmetic unit and extension device for industrial machine control
EP1469371A3 (en) Microprocessor apparatus and method for performing block cipher cryptographic functions
GB2440683A (en) Method and apparatus for data entry input
MX2016002701A (en) Multi-touch keyless entry pad.
WO2013155823A1 (en) Method and mobile terminal for lifting mobile terminal screen lock
WO2005008412A8 (en) Shared input key method and apparatus
EP2574507A3 (en) Operation control apparatus and operation control method for external apparatus connected to vehicle-mounted apparatus
CN103576879A (en) Method using double thumbs to operate keys of widescreen virtual keyboard
CN101738952A (en) Method for realizing keys of single chip microcomputer
CN101288040A (en) Keypad for an electronic equipment and method for operating a keypad for electronic equipment
CN201242684Y (en) Electronic operational ticket hand-held set
CN101204606A (en) Defibrillation monitor high-risk function guarding method and equipment therefor
CN104346551B (en) A kind of method and electronic equipment for locking input unit
CN202472565U (en) Keyboard circuit, keyboard and input device
JP2008065177A5 (en)
CN211015131U (en) Handheld operation device for numerical control system and numerical control equipment
EP1139273A3 (en) Multidirectional input device
CN102218183A (en) Medical oxygen uptake timing and nurse calling device and working method thereof
CN103885828B (en) A kind of changing method of hardware resource
WO2009064077A3 (en) Method and apparatus for processing character-input

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20100616