CN212206335U - Matrix keyboard simulator of digital electronic scale - Google Patents

Matrix keyboard simulator of digital electronic scale Download PDF

Info

Publication number
CN212206335U
CN212206335U CN202020745137.0U CN202020745137U CN212206335U CN 212206335 U CN212206335 U CN 212206335U CN 202020745137 U CN202020745137 U CN 202020745137U CN 212206335 U CN212206335 U CN 212206335U
Authority
CN
China
Prior art keywords
matrix keyboard
electronic scale
mcu
key
simulator
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN202020745137.0U
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.)
XI'AN INSTITUTE OF METROLOGY
Xian University of Technology
Original Assignee
XI'AN INSTITUTE OF METROLOGY
Xian 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 XI'AN INSTITUTE OF METROLOGY, Xian University of Technology filed Critical XI'AN INSTITUTE OF METROLOGY
Priority to CN202020745137.0U priority Critical patent/CN212206335U/en
Application granted granted Critical
Publication of CN212206335U publication Critical patent/CN212206335U/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Input From Keyboards Or The Like (AREA)

Abstract

The utility model discloses a matrix keyboard simulator of a digital electronic scale, which comprises a simulation module connected with a matrix keyboard of the electronic scale, wherein a PC is connected on the simulation module; the simulation module comprises an MCU (microprogrammed control unit), four simulation switch chips and an external clock are connected to the MCU, the MCU is connected with the PC, and the electronic scale matrix keyboard is connected with the MCU; a digital electronic scale matrix keyboard simulator is adopted to simulate an electronic scale matrix keyboard, and the simulation comprises two processes of key learning and key input. The utility model discloses a digit electronic scale matrix keyboard simulator can effectively improve the efficiency of typing of cheating code sequence.

Description

Matrix keyboard simulator of digital electronic scale
Technical Field
The utility model belongs to the technical field of the computer, concretely relates to digital electronic scale matrix keyboard simulator.
Background
The existing electronic scale is easy to be modified into a cheating scale due to the characteristics of low cost, simple structure and the like, and is frequently used in a trade market, and a relevant metering unit needs to continuously input a possible cheating code sequence for detecting and determining whether cheating is needed, so that manual input is time-consuming and labor-consuming. Therefore, the utility model designs a can simulate the equipment of input through the computer, can effectively improve the efficiency of typing of cheating code sequence.
SUMMERY OF THE UTILITY MODEL
The utility model aims at providing a digit electronic scale matrix keyboard simulator can effectively improve the efficiency of typing of cheating code sequence.
The utility model adopts the technical proposal that the matrix keyboard simulator of the digital electronic scale comprises a simulation module connected with a matrix keyboard of the electronic scale, and a PC is connected on the simulation module;
the simulation module comprises an MCU (microprogrammed control unit), four simulation switch chips are connected to the MCU, the MCU is connected with the PC, and the electronic scale matrix keyboard is connected with the MCU;
the method adopts a digital electronic scale matrix keyboard simulator to simulate an electronic scale matrix keyboard, and comprises two processes of key learning and key input:
when key-press learning is carried out:
determining to press each key of an electronic scale matrix keyboard, carrying out row-column scanning on the electronic scale matrix keyboard by an MCU (microprogrammed control unit), scanning the electronic scale matrix keyboard to the time sequence, sending a corresponding key command to a PC (personal computer) through a serial port, naming the key on the PC, and forming a table of level values-key names;
and when key input is carried out:
the MCU controls the four analog switch chips to simulate corresponding time sequences and sends time sequence signals to the electronic scale SOC through the flat cables, and therefore analog input is completed.
The utility model is also characterized in that,
the MCU model is STC15WK 16S.
The four analog switch chips are all CD4051B in model.
The MCU is connected with an external clock.
The utility model has the advantages that: in the process of cheating detection of the electronic scale, a key sequence suspected of being a cheating code needs to be continuously input into the electronic scale to determine whether the real number of a screen of the electronic scale changes, and if the real number of the screen of the electronic scale changes, the electronic scale has the cheating function. The personage is consuming time hard to the key sequence of these cheating codes of electronic scale input, and detection efficiency is extremely low, and uses the utility model discloses an electronic scale matrix keyboard simulator cooperation electronic scale matrix keyboard simulation method replaces artificial input with the computer, and improvement input speed that can be very big improves detection efficiency.
Drawings
FIG. 1 is a schematic diagram of a keyboard layout of a matrix keyboard of an electronic scale according to the present invention;
in fig. 1, the names of keys corresponding to the 6 keys in the first row from left to right are "7", "8", "9", "clear", "unit price 1" and "unit price 5" in turn;
the key names of the keys corresponding to the 6 keys in the second row from left to right are '4', '5', '6', 'cumulative', 'unit price 2' and 'unit price 6';
the keys corresponding to the 6 keys in the third row from left to right are named as '1', '2', '3', 'peeling', 'unit price 3' and 'unit price 7';
the key names of the keys corresponding to the 6 keys in the fourth row from left to right are '0', 'store', 'zero', 'unit price 4' and 'lamplight';
FIG. 2 is a schematic diagram showing the relationship between the keys and the flat cable of the matrix keyboard of the electronic scale of the present invention;
FIG. 3 is a flow chart of the key learning process in the simulator simulation method of the present invention;
fig. 4 is a flowchart of a key input process in the simulator simulation method of the present invention;
FIG. 5 is a pin diagram of MCU of model STC15W1K16S in the simulator of the present invention;
fig. 6 is a pin diagram of a first analog switch chip of the simulator of the present invention, model No. CD4051 BE;
fig. 7 is a pin diagram of a second analog switch chip of the simulator of the present invention, model No. CD4051 BE;
fig. 8 is a pin diagram of a third analog switch chip of the simulator of the present invention, model No. CD4051 BE;
fig. 9 is a pin diagram of a fourth analog switch chip of the simulator of the present invention, model No. CD4051 BE.
Detailed Description
The present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
The utility model provides a matrix keyboard simulator of a digital electronic scale, which comprises a simulation module connected with a matrix keyboard of the electronic scale, wherein a PC is connected on the simulation module;
the simulation module comprises an MCU (microprogrammed control unit), four simulation switch chips and an external clock are connected to the MCU, the MCU is connected with the PC, and the electronic scale matrix keyboard is connected with the MCU;
the method adopts a digital electronic scale matrix keyboard simulator to simulate an electronic scale matrix keyboard, and comprises two processes of key learning and key input:
when key-press learning is carried out:
determining to press each key of an electronic scale matrix keyboard, carrying out row-column scanning on the electronic scale matrix keyboard by an MCU (microprogrammed control unit), scanning the electronic scale matrix keyboard to the time sequence, sending a corresponding key command to a PC (personal computer) through a serial port, naming the key on the PC, and forming a table of level values-key names;
and when key input is carried out:
the MCU controls the four analog switch chips to simulate corresponding time sequences and sends time sequence signals to the electronic scale SOC through the flat cables, and therefore analog input is completed.
The MCU has model STC15WK16S, and pin diagram is shown in FIG. 5.
The model of the four analog switch chips is CD 4051B.
Four pin ports P0.3, P0.4, P0.5 and P0.6 of the MCU are respectively connected with an INH pin port of a four-piece analog switch chip with the same number as CD4051BE, a CD4051BE connected with the P0.3 pin port of the MCU is named as a first analog switch, a CD4051BE connected with the P0.4 of the MCU is named as a second analog switch, a CD40 4051BE connected with the P0.5 pin port of the MCU is named as a third analog switch, a CD4051BE connected with the P0.6 pin port of the MCU is named as a fourth analog switch, a P0.2 pin port of the MCU is simultaneously connected with a C pin port of the four analog switch chips, a P0.1 pin port is simultaneously connected with a B pin port of the four analog switch chips, and a P0.0 pin port is simultaneously connected with an A pin port of the four analog switch chips.
As shown in fig. 2, the 24-key electronic scale matrix keyboard flat cable has 10 flat cables, the 10 flat cables are named respectively, the 10 flat cables include 4 row lines and 6 column lines, each row line is used for connecting in series one port of 6 keys of each row, each column line is used for connecting in series another port of 4 keys of each column, and according to fig. 2, from top to bottom, four row lines are named as L1, L2, L3 and L4; from left to right, the six column lines are named L5, L6, L7, L8, L9, L10. The ten flat cables from L1 to L10 are connected with pins of the MCU through a digital circuit, and the wiring rule is as follows: l1 connects P2.0 pin mouth, L2 connects P2.1 pin mouth, L3 connects P2.2 pin mouth, L4 connects P2.3 pin mouth, L5 connects P2.4 pin mouth, L6 connects P2.5 pin mouth, L7 connects P2.6 pin mouth, L8 connects P1.1 pin mouth, L9 connects P1.2 pin mouth, L10 connects P1.3 pin mouth. The three pin ports of the MCU, namely a P0.2 pin port, a P0.1 pin port and a P0.0 pin port, are used for controlling which port on a certain chip selection analog switch chip is selected to output.
As shown in fig. 6-9, the X0 pin ports on the four analog switch chips are simultaneously connected with the L1 of the matrix keyboard;
x0 pin ports on the four analog switch chips are simultaneously connected with a flat cable LINE 0;
x1 pin ports on the four analog switch chips are simultaneously connected with a flat cable LINE 1;
x2 pin ports on the four analog switch chips are simultaneously connected with a flat cable LINE 2;
x3 pin ports on the four analog switch chips are simultaneously connected with a flat cable LINE 3;
x4 pin ports on the four analog switch chips are simultaneously connected with a flat cable LINE 4;
x5 pin ports on the four analog switch chips are simultaneously connected with a flat cable LINE 5;
the com pin port on the first analog switch chip is connected with a flat cable ROW 6;
the com pin port on the second analog switch chip is connected with a flat cable ROW 7;
a com pin port on the third analog switch chip is connected with a flat cable ROW 8;
a com pin port on the fourth analog switch chip is connected with a flat cable ROW 9;
ten flat cables including a LINE0, a LINE1, a LINE2, a LINE3, a LINE4, a LINE5, a ROW6, a ROW7, a ROW/8 to a ROW9 are used as analog output ports and are connected to the SOC of the electronic scale.
An external clock module input of 11.0592MHZ is connected between a P1.6 pin port and a P1.7 pin port of the MCU with the model of STC15WK16S, and the P3.0 pin port and the P3.1 pin port are used as serial port communication interfaces to communicate with an external PC; connecting a 5V VCC power supply to L1 to L4 of the matrix keyboard for supplying power to the matrix keyboard;
a simulation method for a matrix keyboard of a digital electronic scale, as shown in figures 1-9, adopts the simulator, and specifically comprises the following steps:
step 1, key learning
As shown in fig. 1-3, each key of the electronic scale matrix keyboard is determined to be pressed, the MCU performs row-column scanning on the electronic scale matrix keyboard, scans the electronic scale matrix keyboard time sequence, sends a corresponding key command to the PC through the serial port, and names the key on the PC to form a level value-key name table;
the step 1 is implemented according to the following steps:
the method specifically comprises the following steps: the 24-key electronic scale matrix keyboard flat cable is provided with 10 flat cables, the 10 flat cables are named respectively, the 10 flat cables comprise 4 row lines and 6 column lines, each row line is used for connecting one port of 6 keys of each row in series, each column line is used for connecting the other port of 4 keys of each column in series, and according to the diagram shown in figure 2, from top to bottom, the four flat cables are named as L1, L2, L3 and L4; from left to right, the six column lines are named L5, L6, L7, L8, L9, L10; setting L1-L4 as high four bits, setting L5-L10 as low six bits, determining that a key is pressed down, and utilizing the MCU to perform row and column scanning on the matrix keyboard through 10 flat cables; as shown in fig. 3, the MCU first sets four lines L1 to L4 as an input mode, sets six lines L5 to L10 as a low level, reads the levels of four lines L1 to L4 and stores them in a variable tmp, inverts the four-high bit and six-low bit modes, outputs a low level in the four-high bit output mode, and outputs a six-low bit input mode, reads the six-low bit values of the six lines, adds a value to tmp, where tmp is a 10-bit binary value, and if this value is 1111111111, it indicates no key press, and if there is a 0 in both the four-high bit and six-low bits, it indicates a key press;
the corresponding key values of the corresponding positions on the matrix keyboard are as follows:
the key values of the 6 keys in the first row from left to right on the matrix keyboard are "01110000", "01110001", "01110010", "01110011", "01110100" and "01110101" in sequence;
key values of the 6 keys on the second row from left to right on the matrix keyboard are respectively '01101000', '01101001', '01101010', '01101011', '01101100' and '01101101' in sequence;
key values corresponding to the 6 keys on the third row from left to right on the matrix keyboard are "01011000", "01011001", "01011010", "01011011", "01011100" and "01011101" in sequence;
the key values of the four rows of the matrix keyboard sequentially corresponding to the 6 keys from left to right are sequentially '00111000', '00111001', '00111010', '00111011', '00111100' and '00111101'.
When a certain key on the matrix keyboard is pressed down, the MCU confirms that the key is pressed down, the high and low levels of the flat cable L1 to the flat cable L10 on ten flat cables are specifically as follows:
the levels corresponding to the key values sequentially corresponding to the 6 keys in the first row from left to right on the matrix keyboard are sequentially '0111011111', '0111101111', '0111110111', '0111111011', '0111111101' and '0111111110';
the levels corresponding to the key values sequentially corresponding to the 6 keys from left to right on the second row of the matrix keyboard are sequentially '1011011111', '1011101111', '1011110111', '1011111011', '1011111101' and '1011111110';
the levels corresponding to the key values sequentially corresponding to the 6 keys from left to right on the third row of the matrix keyboard are sequentially '1101011111', '1101101111', '1101110111', '1101111011', '1101111101' and '1101111110';
the levels corresponding to the key values sequentially corresponding to the 6 keys from left to right in the fourth row on the matrix keyboard are sequentially '1110011111', '1110101111', '1110110111', '1110111011', '1110111101' and '1110111110'.
Step 2, key input
As shown in fig. 4, the PC calls a corresponding function, transmits key value information to the MCU through a serial port, the MCU controls four analog switch chips to simulate a corresponding timing sequence, and sends a timing signal to the electronic scale SOC through a flat cable, thereby completing analog input;
the step 2 is implemented according to the following steps:
when a computer prepares to simulate and key a certain key, a keyPress () function is called, the keyPress () function parameter is the key name, the keyPress () function finds the corresponding key value through the key name and sends the key value to an MCU (microprogrammed control unit) in a simulation module through a serial port, and the MCU analyzes the key value after receiving the key value, and the principle is that the hexadecimal key value is converted into the eight-digit binary value, the first bit of the eight-digit binary key value is not used, and the second bit is used for controlling the enabling of a fourth simulation switch chip; the third bit is used for controlling the enabling of a third analog switch chip; the fourth bit is used for controlling the enabling of the second analog switch chip; the fifth bit is used for controlling the enabling of the first analog switch chip, the enabling signal is low level, and the sixth bit, the seventh bit and the eight bits are used for controlling an eight-out-of-one switch on the enabled analog switch chip, so that a level signal when the matrix keyboard signal is output is simulated, and the purpose of simulating manual input keys is achieved.
When the key value is analyzed, the key value in hexadecimal is converted into an eight-bit binary value, the sixth bit, the seventh bit and the eight bits are used for controlling an one-out-of-eight switch on the enabled analog switch chip, and the specific rule is as follows:
three pin ports of a P0.2 pin port, a P0.1 pin port and a P0.0 pin port of the MCU are used for controlling which port is selected to output on a chip selection analog switch chip;
when C, B, A three pin ports of an analog switch chip (the model is CD4051BE) respectively receive 0, 0 and 0, the output of an X0 port is output;
when C, B, A three pin ports of an analog switch chip (the model is CD4051BE) respectively receive 0, 0 and 1, the output of an X1 port is output;
when C, B, A three pin ports of an analog switch chip (the model is CD4051BE) respectively receive 0, 1 and 0, the output of an X2 port is output;
when C, B, A three pin ports of an analog switch chip (the model is CD4051BE) respectively receive 0, 1 and 1, the output of an X3 port is output;
when C, B, A three pin ports of an analog switch chip (the model is CD4051BE) respectively receive 1, 0 and 0, the output of an X4 port is output;
when C, B, A three pin ports of an analog switch chip (the model is CD4051BE) respectively receive 1, 0 and 1, the output of an X5 port is output;
the pin ports of X6 and X7 of four analog switch chips (the model is CD4051BE) are not suspended, the pin ports of VDD, VEE and VSS are connected with corresponding power supplies, the pin port of INH is a chip selection enable, and when the interface is in a low level, the enable of the analog switch chip is indicated.

Claims (4)

1. A simulator of a matrix keyboard of a digital electronic scale is characterized by comprising a simulation module connected with the matrix keyboard of the electronic scale, wherein a PC (personal computer) is connected to the simulation module;
the simulation module comprises an MCU (microprogrammed control unit), four simulation switch chips are connected to the MCU, the MCU is connected with the PC, and the electronic scale matrix keyboard is connected with the MCU;
the method adopts a digital electronic scale matrix keyboard simulator to simulate an electronic scale matrix keyboard, and comprises two processes of key learning and key input:
when key-press learning is carried out:
determining to press each key of an electronic scale matrix keyboard, wherein the MCU can perform row-column scanning on the electronic scale matrix keyboard, scan the electronic scale matrix keyboard time sequence, send a corresponding key command to a PC (personal computer) through a serial port, and name the key on the PC to form a table of level values-key names;
and when key input is carried out:
the MCU can control the four analog switch chips to simulate corresponding time sequences and send time sequence signals to the electronic scale SOC through the flat cable, and therefore analog input is completed.
2. The matrix keyboard simulator of claim 1, wherein the MCU has a model of STC15WK 16S.
3. The matrix keyboard simulator of claim 2, wherein each of the four analog switch chips is of a type of CD 4051B.
4. The matrix keyboard simulator of claim 2, wherein an external clock is connected to said MCU.
CN202020745137.0U 2020-05-08 2020-05-08 Matrix keyboard simulator of digital electronic scale Expired - Fee Related CN212206335U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202020745137.0U CN212206335U (en) 2020-05-08 2020-05-08 Matrix keyboard simulator of digital electronic scale

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202020745137.0U CN212206335U (en) 2020-05-08 2020-05-08 Matrix keyboard simulator of digital electronic scale

Publications (1)

Publication Number Publication Date
CN212206335U true CN212206335U (en) 2020-12-22

Family

ID=73814700

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202020745137.0U Expired - Fee Related CN212206335U (en) 2020-05-08 2020-05-08 Matrix keyboard simulator of digital electronic scale

Country Status (1)

Country Link
CN (1) CN212206335U (en)

Similar Documents

Publication Publication Date Title
CN212206335U (en) Matrix keyboard simulator of digital electronic scale
CN102750840B (en) System and method helpful for reciting words
CN103135049A (en) Test pattern generation device, test program generation device, generation method, and test device
CN104793756B (en) multi-key input method and input device thereof
CN101229432A (en) Method of controlling action emulation and system thereof
CN111426370A (en) Matrix keyboard simulator and method for digital electronic scale
CN208902840U (en) A kind of programmable control circuit for automatically switching precision resistance
CN104423616B (en) Input device and control unit
CN106291337A (en) A kind of device and method adjusting chip mode in testing scanning chain
KR20020095619A (en) ASIC design trainer
CN104064091A (en) Electronic building block type simulation device
CN1333349C (en) System and method for loading on-site programmable gate array
CN2327004Y (en) Keyboard capable of self defining
CN112598970A (en) Graphic programming block suite system
CN112382142A (en) Graphic programming block suite system
CN112073070B (en) Time-sharing dynamic transformation key position scanning method and system
CN2218959Y (en) Electronic organ regulator
CN109407857B (en) Keyboard system, embedded controller and method for sending scanning code in keyboard system
Ali A strategical approach for implementing digital games on fpga
CN112749231B (en) Memory ink jet system using block chain storage
CN113608822B (en) Double-layer decoupling terminal simulator
CN102087548A (en) Keyboard analogue interface circuit
CN2153092Y (en) Computer input training apparatus
CN201438343U (en) CNC analog system and signal transferring circuit board
JP3028562B2 (en) Display device

Legal Events

Date Code Title Description
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201222

Termination date: 20210508

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