CN110147055A - A kind of automatic expansion structure of key and its method - Google Patents
A kind of automatic expansion structure of key and its method Download PDFInfo
- Publication number
- CN110147055A CN110147055A CN201910389310.XA CN201910389310A CN110147055A CN 110147055 A CN110147055 A CN 110147055A CN 201910389310 A CN201910389310 A CN 201910389310A CN 110147055 A CN110147055 A CN 110147055A
- Authority
- CN
- China
- Prior art keywords
- key
- parallel
- serial conversion
- conversion chip
- expansion board
- 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
Links
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
- G05B19/0423—Input/output
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M11/00—Coding in connection with keyboards or like devices, i.e. coding of the position of operated keys
- H03M11/20—Dynamic coding, i.e. by key scanning
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/24—Pc safety
- G05B2219/24215—Scada supervisory control and data acquisition
Abstract
The invention discloses a kind of automatic expansion structure of key and its method, the automatic expansion structure of key includes single-chip microcontroller, key mainboard and at least one key expansion board, and the parallel-serial conversion chip of key mainboard and multiple key expansion board is sequentially connected in series;Single-chip microcontroller connects the parallel-serial conversion chip of key mainboard by 555 timers, and is equipped with detection program.This method is compared by going 1 quantity of end frame and 0 position to judge number of keys and key position in one scanning frame of detection, and with the scanning record of detection program, reminds user when abnormal.The present invention just can realize the automatic extension of key by simple circuit, it is low in cost due to key expansion board, pass through the cascade mode of key expansion board, realize modular key extension, simultaneously, when increasing key expansion board, do not need modification program just can detect quantity and the position of key automatically, to reduce the workload and cost when key extension.
Description
Technical field
The present invention relates to key field, a kind of automatic expansion structure of key and its method are particularly related to.
Background technique
Existing key extension process mode is as follows: determining that product needs the tool of several keys and each key first
Body position (determines what function each key corresponds to), writes corresponding program later.When occur number of keys change or
When person's key position adjusts, need to rewrite program, therefore the mode is only applicable to product stabilization, changes the case where very little,
Once frequently change occurs for product, existing key extension process mode will lead to a large amount of workload, reduce development efficiency, and
And the process for changing program may introduce new BUG, need to retest, lead to the increase of expense.
Summary of the invention
The purpose of the present invention is to provide a kind of automatic expansion structure of key and its methods, when key expansion board is added,
Do not need modification program just can detect quantity and the position of key automatically, to reduce the workload and cost when key extension.
In order to achieve the above objectives, solution of the invention is:
A kind of automatic expansion structure of key, including single-chip microcontroller, key mainboard and at least one key expansion board;The key mainboard
With parallel-serial conversion chip is equipped in key expansion board;Key mainboard is additionally provided with 555 timers, and 555 timers are connected to
The parallel-serial conversion chip of single-chip microcontroller clk/enable foot and key mainboard;The data foot of the single-chip microcontroller is connected to key mainboard
The Q7 pin of parallel-serial conversion chip, the DS pin of the parallel-serial conversion chip of key mainboard be connected to first key expansion board and
The Q7 pin of string conversion chip, the Q7 pin of the parallel-serial conversion chip of second key expansion board are connected to first key extension
The DS pin of the parallel-serial conversion chip of plate, the Q7 pin of the parallel-serial conversion chip of third key expansion board be connected to second by
The DS pin of the parallel-serial conversion chip of key expansion board, and so on;Last pin of each parallel-serial conversion chip is grounded;Institute
It states single-chip microcontroller and is equipped with detection program, detection program is to scan number of keys and key position and writing scan result.
A kind of automatic extended method of key, comprising the following steps:
When step 1, single-chip microcontroller starting up, the clk/enable foot of single-chip microcontroller is set as inputting by detection program, and in setting
It is disconnected enabled;555 timers generate reference clock, and single-chip microcontroller receives the signal of data foot in interrupt routine;
Step 2, detection number of keys: the number of pins of key can be connected as M by setting parallel-serial conversion chip, the received scanning frame of single-chip microcontroller
In, the end frame of a scanning frame is indicated with continuous N+1 1, the number of removal end frame outer 1 is to press bond number in the scanning frame
The number of keys of scanning and scanning record are compared, deposit and remind user to manually adjust when abnormal by amount;
Step 3, detection key position: according in frame each in single-chip microcontroller received signal 0 position, position when comparing initial
Value if being originally 1 be 0 now, so that it may judge that the key of the position is pressed;
The clk/enable foot of single-chip microcontroller is set as exporting, and dragged down by step 4, and the clock for generating 555 timers is forced
It is invalid to drag down, the end of scan;Detect the number of keys of program writing scan and the result of key position;
Step 5, user manually adjust according to abnormal conditions.
In the step 2, when receiving continuous N+1 1 end frame, indicate that a frame scan frame has been swept, restarting is swept
It retouches, the scanning result of continuous several times is compared, if scanning result is consistent, then it represents that the scanning result of the frame is effective.
Using the above structure and after method, the present invention just can realize the automatic expansion of key by simple circuit
Exhibition, it is low in cost due to key expansion board, by the cascade mode of key expansion board, realize modular key extension, together
When, when increasing key expansion board, do not need modification program just can detect quantity and the position of key automatically, to reduce key
Workload and cost when extension.
Detailed description of the invention
Fig. 1 is the schematic diagram of the automatic expansion structure of key of the present invention.
Specific embodiment
In order to further explain the technical solution of the present invention, being explained in detail below by specific embodiment the present invention
It states.
As shown in Figure 1, the present invention be a kind of automatic expansion structure of key, including single-chip microcontroller, key mainboard and at least one
Key expansion board.Parallel-serial conversion chip is equipped in above-mentioned key mainboard and key expansion board;Key mainboard is additionally provided with 555 timings
Device, 555 timers are connected to the parallel-serial conversion chip of single-chip microcontroller clk/enable foot and key mainboard.Above-mentioned single-chip microcontroller
Data foot is connected to the Q7 pin of the parallel-serial conversion chip of key mainboard, the DS pin connection of the parallel-serial conversion chip of key mainboard
Draw in the Q7 of the Q7 pin of the parallel-serial conversion chip of first key expansion board, the parallel-serial conversion chip of second key expansion board
Foot is connected to the DS pin of the parallel-serial conversion chip of first key expansion board, the parallel-serial conversion chip of third key expansion board
Q7 pin be connected to second key expansion board parallel-serial conversion chip DS pin, and so on, realize key mainboard and N
The series connection of a key expansion board, and last pin ground connection of all parallel-serial conversion chips.Above-mentioned single-chip microcontroller is equipped with detection journey
Sequence, detection program is to scan number of keys and key position and writing scan result.
A kind of automatic extended method of key, using the above-mentioned automatic expansion structure of key, comprising the following steps:
When step 1, single-chip microcontroller starting up, the clk/enable foot of single-chip microcontroller is set as inputting by detection program, and in setting
It is disconnected enabled;555 timers generate reference clock, and single-chip microcontroller receives the signal of data foot in interrupt routine;
Step 2, detection number of keys: the number of pins of key can be connected as M by setting parallel-serial conversion chip, the received scanning frame of single-chip microcontroller
In, the end frame of a scanning frame is indicated with continuous N+1 1, the number of removal end frame outer 1 is to press bond number in the scanning frame
The number of keys of scanning and scanning record are compared, deposit and remind user to manually adjust when abnormal by amount;Due to each and go here and there
Last pin of conversion chip is grounded, then continuous 1 number does not exceed M in scanning frame, sets M+1 for end frame
1, it will not obscure with the normal frame of scanning frame;
Example: if starting up is scanned, 11,110,000 01,110,000 00110000 111111111..111 are read, this is swept
It retouches before receiving continuous 81 end frames in frame, there is 91, mean that entire concatenated key mainboard and N number of key expansion board
On be connected with 9 keys.
In above-mentioned steps 2, when receiving continuous N+1 1 end frame, indicate that a frame scan frame has been swept, restarting is swept
It retouches, the scanning result of continuous several times is compared, if scanning result is consistent, then it represents that the scanning result of the frame is effective, to realize
The processing of key stabilization.
Step 3, detection key position:, should when comparing initial according in frame each in single-chip microcontroller received signal 0 position
The value of position is 0 now if being originally 1, so that it may judge that the key of the position is pressed;
The clk/enable foot of single-chip microcontroller is set as exporting, and dragged down by step 4, and the clock for generating 555 timers is forced
It is invalid to drag down, the end of scan;Detect the number of keys of program writing scan and the result of key position;
Step 5, user manually adjust according to abnormal conditions.
By above structure and method, the present invention just can realize the automatic extension of key by simple circuit, by
Modular key extension is realized by the cascade mode of key expansion board in the low in cost of key expansion board, meanwhile,
When increasing key expansion board, do not need modification program just can detect quantity and the position of key automatically, to reduce key extension
When workload and cost.
Above-described embodiment and schema and non-limiting product form and style of the invention, any technical field it is common
The appropriate changes or modifications that technical staff does it all should be regarded as not departing from patent category of the invention.
Claims (3)
1. a kind of automatic expansion structure of key, it is characterised in that: extended including single-chip microcontroller, key mainboard and at least one key
Plate;Parallel-serial conversion chip is equipped in the key mainboard and key expansion board;Key mainboard is additionally provided with 555 timers, and 555 is fixed
When device be connected to the parallel-serial conversion chip of single-chip microcontroller clk/enable foot and key mainboard;The data foot of the single-chip microcontroller connects
It is connected to the Q7 pin of the parallel-serial conversion chip of key mainboard, the DS pin of the parallel-serial conversion chip of key mainboard is connected to first
The Q7 pin of the Q7 pin of the parallel-serial conversion chip of key expansion board, the parallel-serial conversion chip of second key expansion board is connected to
The DS pin of the parallel-serial conversion chip of first key expansion board, the Q7 pin of the parallel-serial conversion chip of third key expansion board
It is connected to the DS pin of the parallel-serial conversion chip of second key expansion board, and so on;Each parallel-serial conversion chip it is last
One pin ground connection;The single-chip microcontroller is equipped with detection program, detects program to scan number of keys and key position and record
Scanning result.
2. a kind of automatic extended method of key, using a kind of automatic expansion structure of key as described in claim 1, feature exists
In the following steps are included:
When step 1, single-chip microcontroller starting up, the clk/enable foot of single-chip microcontroller is set as inputting by detection program, and in setting
It is disconnected enabled;555 timers generate reference clock, and single-chip microcontroller receives the signal of data foot in interrupt routine;
Step 2, detection number of keys: the number of pins of key can be connected as M by setting parallel-serial conversion chip, the received scanning frame of single-chip microcontroller
In, the end frame of a scanning frame is indicated with continuous N+1 1, the number of removal end frame outer 1 is to press bond number in the scanning frame
The number of keys of scanning and scanning record are compared, deposit and remind user to manually adjust when abnormal by amount;
Step 3, detection key position: according in frame each in single-chip microcontroller received signal 0 position, position when comparing initial
Value if being originally 1 be 0 now, so that it may judge that the key of the position is pressed;
The clk/enable foot of single-chip microcontroller is set as exporting, and dragged down by step 4, and the clock for generating 555 timers is forced
It is invalid to drag down, the end of scan;Detect the number of keys of program writing scan and the result of key position;
Step 5, user manually adjust according to abnormal conditions.
3. a kind of automatic extended method of key as claimed in claim 2, it is characterised in that: in the step 2, receive continuous
When M+1 1 end frame, indicating that a frame scan frame has been swept, restarting scanning compares the scanning result of continuous several times, if
Scanning result is consistent, then it represents that the scanning result of the frame is effective.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910389310.XA CN110147055A (en) | 2019-05-10 | 2019-05-10 | A kind of automatic expansion structure of key and its method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910389310.XA CN110147055A (en) | 2019-05-10 | 2019-05-10 | A kind of automatic expansion structure of key and its method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110147055A true CN110147055A (en) | 2019-08-20 |
Family
ID=67595073
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910389310.XA Pending CN110147055A (en) | 2019-05-10 | 2019-05-10 | A kind of automatic expansion structure of key and its method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110147055A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100257034B1 (en) * | 1988-04-18 | 2000-06-01 | 윌리엄 헐 찰스 | Cad/cam stereolithographic data conversion |
CN202364197U (en) * | 2011-11-24 | 2012-08-01 | 深圳市康美特科技有限公司 | Button detection and LED control circuit |
CN206236018U (en) * | 2016-11-04 | 2017-06-09 | 广州邵安电子科技有限公司 | One kind string turns and interrupts keyboard |
-
2019
- 2019-05-10 CN CN201910389310.XA patent/CN110147055A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100257034B1 (en) * | 1988-04-18 | 2000-06-01 | 윌리엄 헐 찰스 | Cad/cam stereolithographic data conversion |
CN202364197U (en) * | 2011-11-24 | 2012-08-01 | 深圳市康美特科技有限公司 | Button detection and LED control circuit |
CN206236018U (en) * | 2016-11-04 | 2017-06-09 | 广州邵安电子科技有限公司 | One kind string turns and interrupts keyboard |
Non-Patent Citations (2)
Title |
---|
王怀瑞,顼庆坤: "单片机I/O口键盘扩展方法", 《冶金自动化 2004年增刊》 * |
芯片引脚图: "74hc165使用方法", 《HTTP://M.ELECFANS.COM/ARTICLE/628718.HTML》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7689847B2 (en) | Method for increasing the data processing capability of a computer system | |
CN102023912B (en) | Dormancy wake-up testing system and method | |
CN102866322A (en) | Touch device detection method | |
CN103389845B (en) | A kind of capacitance touch screen burn test system | |
CN110020518A (en) | A kind of terminal control method based on fingerprint recognition key, device and terminal | |
CN104597790B (en) | A kind of awakening method of serial ports controller and micro controller system based on it | |
CN101089838A (en) | Method for implementing 12C read-write sequence | |
US20040268169A1 (en) | Method and apparatus of automatic power management control for native command queuing Serial ATA device | |
US7330989B2 (en) | Method and apparatus of automatic power management control for Serial ATA interface utilizing a combination of IOP control and specialized hardware control | |
CN101951263A (en) | Key scanning method and system | |
CN106875966A (en) | Data strobe signal processing system and processing method | |
CN109002412A (en) | System and method based on I2C bus hold time positioning and communicating failure | |
CN116860096B (en) | RSTN reset pin function multiplexing control method and circuit of MCU chip | |
CN110147055A (en) | A kind of automatic expansion structure of key and its method | |
US11442575B2 (en) | Touch display driving apparatus and operation method thereof | |
WO2024067042A1 (en) | Method and apparatus for determining drop depth of screen light leakage and electronic device | |
CN112542210A (en) | High-speed flash limit read-write speed testing device | |
TW200502975A (en) | Memory card and format setting method thereof | |
CN101272149A (en) | Key scanning circuit | |
CN201035573Y (en) | Flash memory microcontroller | |
CN102323914A (en) | Controller interface capable of automatically detecting WGIN input and control method | |
CN101916305A (en) | Method for verifying complex pin chip | |
CN104391817A (en) | Electronic system synchronous with peripheral equipment | |
CN106584862B (en) | A kind of the 3D printing WIFI control system and its control method of built-in Web service | |
CN114280456A (en) | Method, device and system for ELFR test of chip |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190820 |