Matrix keyboard circuit design method for eliminating key ghosting
Patent Information
- Application Number
- CN202610497295.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-15
- Publication Date
- 2026-08-18
AI Technical Summary
1、增加了二极管,导致成本增加;
[0010] Compared with the prior art, the present invention has obvious advantages and beneficial effects. Specifically, its main features are: simple design method, elimination of key ghosting without the need for additional diodes, low cost, and because no diodes are required, the row and column scanning method is not affected by the forward voltage drop, thus ensuring the reliability and stability of the row and column scanning method.
Smart Images

Figure CN122595957A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of matrix keyboard circuit design methods for eliminating key ghosting, and in particular to a matrix keyboard circuit design method for eliminating key ghosting. Background Technology
[0002] Keyboards are the primary human-computer interaction devices in electronic products such as computers, PDAs (Personal Digital Assistants), and mobile phones. The keyboard's logic circuitry provides the matrix arrangement of the keys. Most existing matrix keyboard circuits use microcontroller I / O ports for keyboard scanning to control the key presses.
[0003] Matrix keyboard circuits typically use a row-column scanning method to determine the row and column position of a pressed key. This method involves setting the I / O ports corresponding to the row lines as output ports and the I / O ports corresponding to the column lines as input ports. During scanning, the output ports are alternately set to low level, while the other input ports are set to high level. The level states of the input ports are then read, and the pressed key is determined based on the level changes observed at the input ports.
[0004] Existing matrix keypad circuits suffer from ghosting key phenomenon, which manifests as follows: Figure 1 As shown, in an existing 2×2 matrix keypad circuit, there are four keys arranged in 2 rows and 2 columns (keys SW1, SW2, SW3, and SW4), I / O ports Rm, Rn, Cx, and Cy. When keys SW1, SW2, and SW3 are all pressed and in a conducting state, the row and column scanning method will mistakenly identify key SW4 as also being pressed and in a conducting state.
[0005] The reason for the misconception that button SW4 is also pressed and conducting is that when buttons SW1, SW2, and SW3 are all conducting, the current loop formed by these three buttons is actually equivalent to the two ends of button SW4 being connected. Assuming the system detects button SW4 and I / O port Cy is high, current flows through... Figure 2 The circuit shown indicates that the high level sequentially enters the I / O port Rn through buttons SW3, SW1, and SW2, which in turn makes Rn high, the same as when SW4 is pressed.
[0006] Later, to solve the ghosting button phenomenon, a common practice was to insert a diode in series with the button on the diagonal side of the button that was not pressed, such as... Figure 3As shown. When buttons SW1, SW2, and SW3 are all conducting, diode D can prevent the current from scanning button SW4 from forming a loop, thus preventing button SW4 from being considered conducting. To completely eliminate the possibility of shadow buttons, diodes need to be connected in series with all buttons. The above method of adding diodes has the following drawbacks: 1. The addition of diodes increased costs; 2. Diodes can generate a forward voltage drop, which can affect row and column scanning methods.
[0007] Therefore, in this patent application, the applicant has carefully researched a matrix keyboard circuit design method to eliminate key ghosting in order to solve the above problems. Summary of the Invention
[0008] The present invention addresses the shortcomings of the prior art by providing a matrix keyboard circuit design method for eliminating key ghosting. The design method is simple, eliminates key ghosting without the need for additional diodes, and has a low cost. Furthermore, since no diodes are required, the forward voltage drop of the diodes is avoided, thus ensuring the reliability and stability of the row and column scanning method.
[0009] To achieve the above objectives, the present invention adopts the following technical solution: A matrix keyboard circuit design method for eliminating key ghosting includes: Obtain the number of keys in the target matrix keyboard circuit, and design the matrix keyboard circuit according to twice the number of keys to obtain the pre-designed matrix keyboard circuit. The target matrix keyboard circuit can be obtained by deleting the odd-even alternating keys in adjacent columns of the pre-designed matrix keyboard circuit.
[0010] Compared with the prior art, the present invention has obvious advantages and beneficial effects. Specifically, its main features are: simple design method, elimination of key ghosting without the need for additional diodes, low cost, and because no diodes are required, the row and column scanning method is not affected by the forward voltage drop, thus ensuring the reliability and stability of the row and column scanning method.
[0011] To more clearly illustrate the structural features and effects of the present invention, a detailed description is provided below in conjunction with the accompanying drawings and specific embodiments. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of a 2×2 matrix keyboard circuit in the existing technology.
[0013] Figure 2 yes Figure 1 The diagram shows the signal level flow (mainly showing what happens when buttons SW1, SW2, and SW3 are pressed).
[0014] Figure 3 yes Figure 2 A schematic diagram showing the signal level after adding a diode.
[0015] Figure 4 This is a schematic diagram of a pre-designed matrix keyboard circuit according to a preferred embodiment of the present invention.
[0016] Figure 5 This is a schematic diagram of the target matrix keyboard circuit according to a preferred embodiment of the present invention. Detailed Implementation
[0017] The present invention will now be further described with reference to the accompanying drawings and specific embodiments.
[0018] like Figure 4 and Figure 5 As shown, a matrix keyboard circuit design method for eliminating key ghosting includes: obtaining the number of keys in the target matrix keyboard circuit, designing the matrix keyboard circuit according to twice the number of keys, and obtaining the pre-designed matrix keyboard circuit. The target matrix keyboard circuit can be obtained by deleting the odd-even alternating keys in adjacent columns of the pre-designed matrix keyboard circuit.
[0019] In this embodiment, it is assumed that the target matrix keyboard circuit has 8 keys. The following is a brief description using a target matrix keyboard circuit with 8 keys as an example: Design a matrix keyboard circuit with twice the number of keys as 8 (i.e., 16 keys). For example... Figure 3 As shown, the 16 buttons are labeled S6, S7, S8, S9, S10, S11, S12, S13, S14, S15, S16, S17, S18, S19, S20, and S21. Among them... The first row, from left to right, consists of buttons S6, S7, S8, and S9. The first column, from top to bottom, consists of buttons S6, S10, S14, and S18.
[0020] The second row, from left to right, consists of buttons S10, S11, S12, and S13; the second column, from top to bottom, consists of buttons S7, S11, S15, and S19.
[0021] The third row, from left to right, consists of buttons S14, S15, S16, and S17; the third column, from top to bottom, consists of buttons S8, S12, S16, and S20.
[0022] The fourth row, from left to right, consists of buttons S18, S19, S20, and S21. The fourth column, from top to bottom, consists of buttons S9, S13, S17, and S21.
[0023] Based on the description of deleting alternating odd and even keys in adjacent columns, keys S6 and S14 in the first column, S11 and S19 in the second column, S8 and S16 in the third column, and S13 and S21 in the fourth column are deleted, resulting in the appendix. Figure 5 As attached Figure 5 As shown, in a 2x2 grid containing a square with keys S6 and S11, if keys S6 and S11 are pressed simultaneously, a third key will not be mistakenly identified as being pressed, thus eliminating ghosting. In this embodiment, since no diodes are present, no forward voltage drop is generated, thereby reducing the reliability of the keyboard scanning circuit in this embodiment.
[0024] The key design features of this invention are its simple design method, which eliminates button ghosting without the need for additional diodes, resulting in lower costs. Furthermore, because no diodes are required, the forward voltage drop of the diodes avoids affecting the row and column scanning method, thus ensuring the reliability and stability of the row and column scanning method.
[0025] The above description is merely a preferred embodiment of the present invention and does not constitute any limitation on the technical scope of the present invention. Therefore, any minor modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention shall still fall within the scope of the technical solution of the present invention.
Claims
1. A matrix keyboard circuit design method for eliminating key ghosting, characterized in that, include: Obtain the number of keys in the target matrix keyboard circuit, and design the matrix keyboard circuit according to twice the number of keys to obtain the pre-designed matrix keyboard circuit. The target matrix keyboard circuit can be obtained by deleting the odd-even alternating keys in adjacent columns of the pre-designed matrix keyboard circuit.