TW202339444A - Electronic device and key scan method thereof - Google Patents
Electronic device and key scan method thereof Download PDFInfo
- Publication number
- TW202339444A TW202339444A TW111111212A TW111111212A TW202339444A TW 202339444 A TW202339444 A TW 202339444A TW 111111212 A TW111111212 A TW 111111212A TW 111111212 A TW111111212 A TW 111111212A TW 202339444 A TW202339444 A TW 202339444A
- Authority
- TW
- Taiwan
- Prior art keywords
- retrace
- key
- voltage threshold
- column
- processing module
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000001514 detection method Methods 0.000 claims abstract description 35
- 230000004044 response Effects 0.000 claims abstract description 7
- 230000007704 transition Effects 0.000 claims description 4
- 230000008859 change Effects 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 19
- 239000011159 matrix material Substances 0.000 description 5
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 239000012528 membrane Substances 0.000 description 1
- 239000010409 thin film Substances 0.000 description 1
Images
Landscapes
- Electrophonic Musical Instruments (AREA)
- Input From Keyboards Or The Like (AREA)
Abstract
Description
本揭示內容係有關於一種電子裝置,特別是指一種具有鍵盤的電子裝置及其按鍵掃描方法。The present disclosure relates to an electronic device, and in particular, to an electronic device with a keyboard and a key scanning method thereof.
市售電子裝置的鍵盤通常採用按鍵矩陣的方式設計。以4x4的按鍵矩陣來說,當同時按壓其中三個按鍵時,鍵盤理論上應產生對應的三個訊號。然而,鍵盤通常會因為矩陣迴路相通而產生四個訊號,導致電子裝置誤認為有四個按鍵被按壓,其中實際上未被按壓但被誤認為有被按壓的按鍵即為鬼鍵(ghost key)。因此,有必要對現有電子裝置的鍵盤進行改善。Keyboards of commercially available electronic devices are usually designed in a key matrix manner. Taking a 4x4 key matrix as an example, when three of the keys are pressed at the same time, the keyboard should theoretically generate three corresponding signals. However, keyboards usually generate four signals due to the interconnected matrix circuits, causing the electronic device to mistakenly believe that four keys are pressed. Among them, the key that is not actually pressed but is mistakenly thought to be pressed is a ghost key. . Therefore, it is necessary to improve the keyboard of the existing electronic device.
本揭示內容的一態樣為一電子裝置。該電子裝置包含一輸入模組以及一處理模組。該輸入模組包含複數個參考電阻以及以陣列排列的複數個按鍵電路,其中每個參考電阻耦接於該些按鍵電路中的一對應列,每個按鍵電路包含串聯連接的一開關以及一電阻,且每個開關用以響應於一使用者輸入而從斷開狀態轉變為導通狀態。該處理模組藉由複數條掃描線以及複數條回掃線耦接至該些按鍵電路,且用以執行下列步驟:於一偵測期間,計算出每一列的該些按鍵電路的一輸出數量;根據每一列的該些按鍵電路的該輸出數量,計算至少一電壓門檻值;以及於該偵測期間之後的一掃描期間,將透過該些回掃線輸出的複數個回掃訊號與該至少一電壓門檻值進行比對,以確認接收到該使用者輸入的該些按鍵電路的位置。One aspect of the present disclosure is an electronic device. The electronic device includes an input module and a processing module. The input module includes a plurality of reference resistors and a plurality of key circuits arranged in an array. Each reference resistor is coupled to a corresponding column of the key circuits. Each key circuit includes a switch and a resistor connected in series. , and each switch is configured to transition from an off state to an on state in response to a user input. The processing module is coupled to the key circuits through a plurality of scan lines and a plurality of retrace lines, and is used to perform the following steps: during a detection period, calculate an output number of the key circuits in each column. ; Calculate at least one voltage threshold based on the output number of the key circuits in each column; and during a scanning period after the detection period, combine a plurality of retrace signals output through the retrace lines with the at least A voltage threshold is compared to confirm the positions of the key circuits that receive input from the user.
本揭示內容的另一態樣為一按鍵掃描方法。該按鍵掃描方法適用於一電子裝置,其中該電子裝置包含一處理模組以及一輸入模組,該輸入模組包含複數個參考電阻以及以陣列排列的複數個按鍵電路,每個參考電阻耦接於該些按鍵電路中的一對應列,每個按鍵電路包含串聯連接的一開關以及一電阻,每個開關用以響應於一使用者輸入而從斷開狀態轉變為導通狀態,該處理模組藉由複數條掃描線以及複數條回掃線耦接至該些按鍵電路,且該按鍵掃描方法包含:於一偵測期間,藉由該處理模組,計算出每一列的該些按鍵電路的一輸出數量;藉由該處理模組,根據每一列的該些按鍵電路的該輸出數量,計算至少一電壓門檻值;以及於該偵測期間之後的一掃描期間,藉由該處理模組,將透過該些回掃線輸出的複數個回掃訊號與該至少一電壓門檻值進行比對,以確認接收到該使用者輸入的該些按鍵電路的位置。Another aspect of this disclosure is a button scanning method. The key scanning method is suitable for an electronic device, wherein the electronic device includes a processing module and an input module. The input module includes a plurality of reference resistors and a plurality of key circuits arranged in an array. Each reference resistor is coupled to In a corresponding column of the key circuits, each key circuit includes a switch and a resistor connected in series. Each switch is used to change from an off state to an on state in response to a user input. The processing module The key circuits are coupled to the key circuits by a plurality of scan lines and a plurality of retrace lines, and the key scanning method includes: during a detection period, using the processing module to calculate the key circuits of each column. an output quantity; through the processing module, calculate at least one voltage threshold value according to the output quantity of the key circuits in each column; and during a scanning period after the detection period, through the processing module, A plurality of retrace signals output through the retrace lines are compared with the at least one voltage threshold to confirm the positions of the key circuits that receive input from the user.
藉由在輸入模組中設置參考電阻及電阻,本揭示內容的電子裝置可基於使用者每次按壓的按鍵數量(此影響產生輸出訊號的按鍵電路的數量)針對每一列的按鍵電路計算出合適的電壓門檻值,以濾除實際上未被按壓的按鍵電路所輸出的訊號。如此一來,本揭示內容的電子裝置可避免發生鬼鍵。By setting the reference resistor and resistance in the input module, the electronic device of the present disclosure can calculate the appropriate key circuit for each column based on the number of keys pressed by the user each time (which affects the number of key circuits that generate output signals). The voltage threshold is used to filter out the signals output by the button circuit that are not actually pressed. In this way, the electronic device of the disclosure can avoid ghost keys.
下文係舉實施例配合所附圖式作詳細說明,但所描述的具體實施例僅用以解釋本案,並不用來限定本案,而結構操作之描述非用以限制其執行之順序,任何由元件重新組合之結構,所產生具有均等功效的裝置,皆為本揭示內容所涵蓋的範圍。The following is a detailed description of the embodiments together with the accompanying drawings. However, the specific embodiments described are only used to explain the present case and are not used to limit the present case. The description of the structural operations is not intended to limit the order of execution. Any components Recombining the structure to produce a device with equal functions is within the scope of this disclosure.
在全篇說明書與申請專利範圍所使用之用詞(terms),除有特別註明外,通常具有每個用詞使用在此領域中、在此揭示之內容中與特殊內容中的平常意義。Unless otherwise noted, the terms used throughout the specification and patent application generally have their ordinary meanings as used in the field, in the disclosure and in the specific content.
關於本文中所使用之「耦接」或「連接」,均可指二或多個元件相互直接作實體或電性接觸,或是相互間接作實體或電性接觸,亦可指二或多個元件相互操作或動作。As used herein, “coupling” or “connection” may refer to two or more components that are in direct physical or electrical contact with each other, or that are in indirect physical or electrical contact with each other. It may also refer to two or more components that are in direct physical or electrical contact with each other. Components interact or act with each other.
為了方便說明起見,本案說明書和圖式中使用的元件編號中的大寫英文索引1~N,只是為了方便指稱個別的元件,並非有意將前述元件的數量侷限在特定數目。在本案說明書和圖式中,若使用某一元件編號時沒有指明該元件編號的索引,則代表該元件編號是指稱所屬元件群組中不特定的任一元件。例如,元件編號CL[0]指稱的對象是掃描線CL[0],而元件編號CL指稱的對象則是掃描線CL [0]~CL[N]中不特定的任意掃描線。For the convenience of explanation, the uppercase
請參閱第1圖,第1圖為根據本揭示內容的一些實施例繪示的一種電子裝置100的示意圖。於一些實施例中,電子裝置100包含一處理模組110以及一輸入模組120。如第1圖所示,電子裝置100可為具有鍵盤的計算機裝置(例如:第1圖中的筆記型電腦、行動裝置、遙控器、電話等)。應當理解,處理模組110可藉由微處理器來實現,而輸入模組120可藉由鍵盤來實現。於其他實施例中,處理模組110配置於輸入模組120(即,鍵盤)內。也就是說,輸入模組120包含處理模組110。Please refer to FIG. 1 , which is a schematic diagram of an
請參閱第2圖,第2圖為根據本揭示內容的一些實施例繪示的電子裝置100的電路示意圖。於一些實施例中,輸入模組120包含以陣列排列的複數個按鍵電路K,以組成電子裝置100上的多個按鍵。為簡化說明,在第2圖中僅標示出第7列第(N+1)行的按鍵電路K[6,N]作為代表,其中N為大於0的正整數,且按鍵電路K的行數為(N+1)個。在本實施例中,第2圖的輸入模組120具有7*(N+1)個按鍵開關K,但本揭示並不以此為限。如第2圖所示,每個按鍵電路K包含串聯連接的一電阻R以及一開關SW。舉例來說,按鍵電路K[6,N]包含電阻R[6,N]以及開關SW[6,N],且電阻R[6,N]與開關SW[6,N]串聯連接。具體來說,電阻R可藉由薄膜電阻來實現,而開關SW可藉由機械式切換開關或薄膜開關來實現。Please refer to FIG. 2 , which is a schematic circuit diagram of an
於一些實施例中,如第2圖所示,電子裝置100還包含彼此垂直交錯排列的複數條回掃線RL與複數條掃描線CL。處理模組110藉由對應的一條回掃線RL耦接於同一列的按鍵電路K的多個第一端(即,直接耦接電阻R的一端),且藉由多條掃描線CL耦接於同一列的按鍵電路K的多個第二端(即,直接耦接開關SW的一端)。舉例來說,回掃線RL[0]耦接於第1列的(N+1)個按鍵電路K的(N+1)個第一端,而多條掃描線CL[0]~CL[N]分別耦接於第1列的(N+1)個按鍵電路K的(N+1)個第二端。其餘列的按鍵電路K的設置可依此類推,故不在此贅述。由此可知,每個按鍵電路K耦接於對應的回掃線RL與對應的掃描線CL之間。In some embodiments, as shown in FIG. 2 , the
於一些實施例中,如第2圖所示,輸入模組120還包含複數個參考電阻Rfb。每個參考電阻Rfb的一端耦接於同一列的按鍵電路K的多個第一端,且每個參考電阻Rfb的另一端則耦接於一接地端。舉例來說,參考電阻Rfb[0]的一端耦接於第1列的(N+1)個按鍵電路K的(N+1)個第一端,而參考電阻Rfb[0]的另一端則耦接於接地端。其餘參考電阻Rfb[1]~Rfb[6]的設置可依此類推,故不在此贅述。由此可知,每個參考電阻Rfb耦接於多個按鍵電路K中的一對應列。In some embodiments, as shown in FIG. 2 , the
於一些實施例中,每個開關SW(或每個按鍵電路K)用以響應於一使用者輸入(例如:使用者執行的按壓動作)的接收而從一斷開狀態轉變為一導通狀態。舉例來說,當使用者按壓電子裝置100上對應於開關SW[0,0]及SW[0,1]的按鍵時,開關SW[0,0]及SW[0,1]將從斷開狀態轉變為導通狀態,進而藉由對應的回掃線RL[0]和掃描線CL[0]~CL[1]與處理模組110形成至少一迴路。具體來說,當開關SW[0,0]導通,訊號可自處理模組110輸出,依序通過掃描線CL[0]、開關SW[0,0]、電阻R[0,0]與回掃線RL[0],並輸入至處理模組110。當開關SW[0,1]導通,訊號可自處理模組110輸出,依序通過掃描線CL[1]、開關SW[0,1]、電阻R[0,1]與回掃線RL[0],並輸入至處理模組110。也就是說,此時處理模組110可藉由回掃線RL[0]與掃描線CL[0]~CL[1]來收發訊號。此外,其餘對應於未被按壓按鍵的開關SW則依然維持斷開狀態,且無法將處理模組110透過掃描線CL所輸出的訊號傳輸回處理模組110。In some embodiments, each switch SW (or each key circuit K) is configured to transition from an off state to an on state in response to receiving a user input (eg, a pressing action performed by the user). For example, when the user presses the keys corresponding to the switches SW[0,0] and SW[0,1] on the
於一些實施例中,如第2圖所示,處理模組110還包含一類比數位轉換器(ADC)112。類比數位轉換器112耦接於多條回掃線RL,並用以接收多個按鍵電路K透過回掃線RL所輸出的訊號,以進行後續處理。類比數位轉換器112的操作將於後續段落中詳細說明。In some embodiments, as shown in FIG. 2 , the
請參閱第3圖,第3圖為根據本揭示內容的一些實施例繪示的電子裝置100的按鍵掃描方法200的流程圖。按鍵掃描方法200可藉由第1或2圖中的處理模組110來執行,使得處理模組110能判斷電子裝置100上的多個按鍵實際上是否有被按壓且能找出有被按壓按鍵的確切位置。應當理解,本揭示內容的按鍵掃描方法200也適用於一般的鍵盤裝置,並不限於電子裝置100。於一些實施例中,按鍵掃描方法200包含多個步驟S201~S203。為方便及清楚說明,以下將搭配第4~8圖來詳細說明按鍵掃描方法200。Please refer to FIG. 3 , which is a flow chart of a
請參閱第4圖,第4圖為根據本揭示內容的一些實施例繪示的電子裝置100的按鍵掃描時序圖。於一些實施例中,如第4圖所示,為避免處理模組110將實際上未被按壓的按鍵誤判為有被按壓(即,鬼鍵),電子裝置100的一個完整按鍵掃描週期包含一偵測期間P1、一掃描期間P2以及一非掃描期間P3。Please refer to FIG. 4 , which is a key scanning timing diagram of the
於步驟S201中,處理模組110於偵測期間P1計算出每一列的按鍵電路K的一輸出數量。以下將搭配第5、6及7A~7B圖來詳細說明步驟S201。In step S201, the
請先參閱第5、6及7A圖,第5圖為根據本揭示內容的一些實施例繪示的電子裝置100於偵測期間P1的操作示意圖,第6圖為根據本揭示內容的一些實施例繪示的電子裝置100於偵測期間P1中一時間點t1的電路示意圖,而第7A圖為根據本揭示內容的一些實施例繪示的電子裝置100於偵測期間P1中一時間點t2的電路示意圖。為方便說明,於第6及7圖的實施例中,多個按鍵電路K以3x3陣列排列(即,包含9個按鍵電路K),但本揭示內容的多個按鍵電路K的設置並不以圖式所示為限。此外,為簡化說明,第5圖中僅示岀2條掃描線CL[0]~CL[1]及2條回掃線RL[0]~RL[1](即,掃描線CL[2]與回掃線RL[2]經省略)。Please refer to Figures 5, 6 and 7A first. Figure 5 is a schematic diagram of the operation of the
於電子裝置100的其中一掃描週期,如第6圖所示,使用者按壓對應於3個按鍵電路K[0,0]、K[1,0]及K[1,1]的3個按鍵,使得3個按鍵電路K[0,0]、K[1,0]及K[1,1](或3個開關SW[0,0]、SW[1,0]及SW[1,1])響應於使用者輸入而從斷開狀態轉變為導通狀態。In one of the scanning cycles of the
於一些實施例中,處理模組110於偵測期間P1依序對多條掃描線CL輸出對應的掃描訊號,並透過多條回掃線RL接收對應的回掃訊號。舉例來說,如第5及6圖所示,處理模組110於時間點t1藉由掃描線CL[0]輸出一掃描訊號Vscan[0]至第1行的按鍵電路K。此時,如第6圖所示,由於第1行的按鍵電路K中僅有開關SW[0,0]及SW[1,0]導通,掃描訊號Vscan[0]之電壓值除了根據參考電阻Rfb[0]與電阻R[0,0]之阻值分配於參考電阻Rfb[0]與電阻R[0,0]上,使得一電壓值Vr0(t1)產生於參考電阻Rfb[0]與電阻R[0,0]之間的節點,還根據參考電阻Rfb[1]與電阻R[1,0]之阻值分配於參考電阻Rfb[1]與電阻R[1,0]上,使得另一電壓值Vr1(t1)產生於參考電阻Rfb[1]與電阻R[1,0]之間的節點。據此,如第5圖所示,於時間點t1,處理模組110藉由回掃線RL[0]接收具有電壓值Vr0(t1)的回掃訊號Vread[0],並藉由回掃線RL[1]接收具有電壓值Vr1(t1)的回掃訊號Vread[1]。此外,由於第3列第1行的開關SW[2,0]維持斷開,處理模組110於時間點t1藉由回掃線RL[2]可能接收到約為0伏特之回掃訊號(圖中未示)。In some embodiments, the
於本實施例中,參考電阻Rfb[0]~Rfb[1]與電阻R[0,0]及R[1,0]之阻值皆為1歐姆(ohm),而掃描訊號Vscan[0]於時間點t1之電壓值為3.3伏特(volt)。據此,電壓值Vr0(t1)為1.65伏特,且電壓值Vr1(t1)亦為1.65伏特。應當理解,上述數值僅用以示例,本揭示內容並不以此為限。In this embodiment, the resistance values of the reference resistors Rfb[0]~Rfb[1] and the resistors R[0,0] and R[1,0] are all 1 ohm, and the scan signal Vscan[0] The voltage value at time point t1 is 3.3 volts (volt). Accordingly, the voltage value Vr0(t1) is 1.65 volts, and the voltage value Vr1(t1) is also 1.65 volts. It should be understood that the above numerical values are only used as examples and the present disclosure is not limited thereto.
如第5及7A圖所示,處理模組110於時間點t2藉由掃描線CL[1]輸出另一掃描訊號Vscan[1]至第2行的按鍵電路K。此時,如第7A圖所示,雖然第2行的按鍵電路K中僅有開關SW[1,1]導通,但因為第1行中導通的2個開關SW[0,0]及SW[1,0]的影響,導致處理模組110於時間點t2分別藉由2條回掃線RL[0]及RL[1]接收具有電壓值Vr0(t2)的回掃訊號Vread[0]以及具有電壓值Vr1(t2)的回掃訊號Vread[1]。此外,處理模組110於時間點t2藉由回掃線RL[2]亦可能接收到約為0伏特之回掃訊號(圖中未示)。以下將搭配第7B圖詳細說明電壓值Vr0(t2)及Vr1(t2)的產生。As shown in Figures 5 and 7A, the
請參閱第7B圖,第7B圖為根據本揭示內容的一些實施例繪示的第7A圖的輸入模組120的等效電路示意圖。如第7B圖所示,掃描訊號Vscan[1]之電壓值將根據電阻R[1,1]與一等效電阻Req(其等效於參考電阻Rfb[0]及Rfb[1]與電阻R[1,0]及R[0,0]的串並聯連接)之阻值分配,使得電壓值Vr1(t2)產生於參考電阻Rfb[1]與電阻R[1,1]及R[1,0]之間的節點。接著,電壓值Vr1(t2)將根據參考電阻Rfb[0]與電阻R[1,0]及R[0,0]之阻值分配,使得電壓值Vr0(t2)產生於參考電阻Rfb[0]與電阻R[0,0]之間的節點。Please refer to FIG. 7B , which is a schematic equivalent circuit diagram of the
於本實施例中,參考電阻Rfb[0]~Rfb[1]與電阻R[0,0]、R[1,0]及R[1,1]之阻值皆為1歐姆,而掃描訊號Vscan[1]於時間點t2之電壓值為3.3伏特。據此,電壓值Vr0(t2)為0.47伏特,且電壓值Vr1(t2)為1.41伏特。應當理解,上述數值僅用以示例,本揭示內容並不以此為限。In this embodiment, the resistance values of the reference resistors Rfb[0]~Rfb[1] and the resistors R[0,0], R[1,0] and R[1,1] are all 1 ohm, and the scanning signal The voltage value of Vscan[1] at time point t2 is 3.3 volts. Accordingly, the voltage value Vr0(t2) is 0.47 volts, and the voltage value Vr1(t2) is 1.41 volts. It should be understood that the above numerical values are only used as examples and the present disclosure is not limited thereto.
於時間點t1及t2之後的另一時間點(圖中未示),處理模組110還藉由掃描線CL[2]輸出對應的掃描訊號(圖中未示)至第3行的按鍵電路K[0,2]、K[1,2]及K[2,2]。此時,由於第3行的開關SW[0,2]、SW[1,2]及SW[2,2]均維持斷開,處理模組110藉由回掃線RL[0]~RL[2]可能接收到約為0伏特之回掃訊號(圖中未示)。At another time point (not shown in the figure) after time points t1 and t2, the
在處理模組110接收每一列的回掃訊號Vread後,處理模組110中的類比數位轉換器112會將每一列的回掃訊號Vread於各個時間點之電壓值與一初始電壓門檻值Vinit進行比對,並基於比對結果輸出一第一邏輯值或一第二邏輯值。應當理解,第一邏輯值與第二邏輯值可互不相同(例如,第一邏輯值為“1”,而第二邏輯值為“0”)。應當理解,初始電壓門檻值Vinit可預先儲存於處理模組110或電子裝置100所包含的一儲存器(圖中未示)中,其中儲存器可藉由暫存器或記憶體來實現。After the
以下將以前述所舉數值為例說明類比數位轉換器112的操作。假設初始電壓門檻值Vinit的範圍為0.1~0.37伏特。於時間點t1,回掃訊號Vread[0]之電壓值為1.65伏特(即,Vr0(t1))且高於或等於初始電壓門檻值Vinit,回掃訊號Vread[1]之電壓值為1.65伏特(即,Vr1(t1))且高於或等於初始電壓門檻值Vinit,而回掃線RL[2]所輸出之回掃訊號之電壓值約為0伏特且低於初始電壓門檻值Vinit。據此,類比數位轉換器112於時間點t1將輸出“1”、“1”及“0”之結果。處理模組110可根據此結果判斷第1行的按鍵電路K中僅有按鍵電路K[0,0]及K[1,0]有產生輸出訊號,而按鍵電路K[2,0]則沒有產生輸出訊號。The operation of the analog-to-
於時間點t2,回掃訊號Vread[0]之電壓值為0.47伏特(即,Vr0(t2))且高於或等於初始電壓門檻值Vinit,而回掃訊號Vread[1]之電壓值為1.41伏特(即,Vr1(t2))且高於或等於初始電壓門檻值Vinit,而回掃線RL[2]所輸出之回掃訊號之電壓值約為0伏特且低於初始電壓門檻值Vinit。據此,類比數位轉換器112於時間點t2將輸出“1”、“1”及“0”之結果。處理模組110可根據此結果判斷第2行的按鍵電路K中僅有按鍵電路K[0,1]及K[1,1]有產生輸出訊號,而按鍵電路K[2,1]則沒有產生輸出訊號。At time point t2, the voltage value of the retrace signal Vread[0] is 0.47 volts (ie, Vr0(t2)) and is higher than or equal to the initial voltage threshold Vinit, and the voltage value of the retrace signal Vread[1] is 1.41 Volts (i.e., Vr1(t2)) and is higher than or equal to the initial voltage threshold Vinit, and the voltage value of the retrace signal output by the retrace line RL[2] is approximately 0 volts and lower than the initial voltage threshold Vinit. Accordingly, the analog-to-
於時間點t1及t2之後的另一時間點(圖中未示),多條回掃線RL[0]~RL[2]所輸出之回掃訊號之電壓值均約為0伏特且低於初始電壓門檻值Vinit。據此,類比數位轉換器112於時間點t1及t2之後的另一時間點將輸出“0”、“0”及“0”之結果。處理模組110可根據此結果判斷第3行的按鍵電路K[0,2]、K[1,2]及K[2,2]均沒有產生輸出訊號。At another time point after time points t1 and t2 (not shown in the figure), the voltage values of the retrace signals output by the multiple retrace lines RL[0]~RL[2] are all about 0 volts and lower than Initial voltage threshold Vinit. Accordingly, the analog-to-
由上述說明可知,在依序對每一行的按鍵電路K進行掃描後,處理模組110藉由類比數位轉換器112可產生每一列的按鍵電路K中的每一者是否產生輸出訊號的一偵測結果(例如:第5圖所示的3x3矩陣)。雖然第1列第2行的按鍵電路K[0,1]於偵測期間P1被判斷為有輸出訊號(因其對應的邏輯值為“1”),但實際上使用者並未按壓對應於第2行第1列的按鍵電路K[0,1]的按鍵(即,鬼鍵)。具體來說,於偵測期間P1,處理模組110僅判斷按鍵電路K是否產生輸出訊號,而沒有判斷按鍵電路K所產生的輸出訊號是否為鬼鍵訊號。It can be seen from the above description that after sequentially scanning the key circuits K of each row, the
接著,處理模組110將偵測結果中對應於同一列的多個按鍵電路K的多個邏輯值相加,以計算出每一列的按鍵電路K的輸出數量。舉例來說,如第5圖所示,第1列的按鍵電路K的輸出數量Nr[0]為2,第2列的按鍵電路K的輸出數量Nr[1]為2,而第3列的按鍵電路K的輸出數量Nr[2]為0。應當理解,偵測結果與每一列的按鍵電路K的輸出數量在計算出來後可儲存於處理模組110或電子裝置100的儲存器。在計算出每一列的按鍵電路K的輸出數量後,處理模組110可執行步驟S202。Then, the
於步驟S202,處理模組110根據每一列的按鍵電路K的輸出數量,計算每一列的按鍵電路K所對應的電壓門檻值Vth[M]。於一些實施例中,處理模組110藉由一計算公式計算每一列的按鍵電路K所對應的電壓門檻值Vth[M]。舉例來說,計算公式可以下列公式(1)表示:
…(1)
其中,Vth[M]為每一列的按鍵電路K所對應的電壓門檻值,Vsc為掃描訊號Vscan之電壓值,Rk為按鍵電路K中電阻R的阻值,而P[M]為關聯於每一列的按鍵電路K的輸出數量的參數。
In step S202, the
於一些實施例中,參數P[M]可以下列公式(2)表示: …(2) 其中,Nr[M]為每一列的按鍵電路K的輸出數量,而Rref為參考電阻Rfb的阻值。 In some embodiments, the parameter P[M] can be expressed by the following formula (2): ...(2) Among them, Nr[M] is the output number of the key circuit K in each column, and Rref is the resistance of the reference resistor Rfb.
於一些實施例中,M為大於0的正整數,且M的最大值即為按鍵電路K的列數減去1。舉例來說,於第6或7圖的實施例中,公式(1)及(2)中的M可為0、1或2。In some embodiments, M is a positive integer greater than 0, and the maximum value of M is the number of columns of the key
以下將以前述所舉數值以及第5圖所示的輸出數量Nr[0]~Nr[2]為例說明。掃描訊號Vscan之電壓值Vsc為3.3伏特,第1列的按鍵電路K的輸出數量Nr[0]為2,按鍵電路K中電阻R的阻值Rk為1歐姆,且參考電阻Rfb的阻值Rref亦為1歐姆。透過上述公式(2),處理模組110可計算出關聯於第1列的按鍵電路K的輸出數量Nr[0]的參數P[0]為0.5。接著,透過上述公式(1),處理模組110可計算出第1列的按鍵電路K所對應的電壓門檻值Vth[0]為1.1伏特(此即第一電壓門檻值)。依此類推,處理模組110亦可計算出第2列的按鍵電路K所對應的電壓門檻值Vth[1]為1.1伏特(此即第二電壓門檻值)。此外,由於第3列的按鍵電路K的輸出數量Nr[2]為0,處理模組110可將初始電壓門檻值Vinit作為第3列的按鍵電路K所對應的電壓門檻值Vth。The following will take the above-mentioned values and the output quantities Nr[0]~Nr[2] shown in Figure 5 as examples for explanation. The voltage value Vsc of the scan signal Vscan is 3.3 volts, the output number Nr[0] of the key circuit K in the first column is 2, the resistance Rk of the resistor R in the key circuit K is 1 ohm, and the resistance Rref of the reference resistor Rfb Also 1 ohm. Through the above formula (2), the
於偵測期間P1,每一列的按鍵電路K均對應至初始電壓門檻值Vinit,因此類比數位轉換器112會將回掃訊號Vread於各個時間點之電壓值與初始電壓門檻值Vinit進行比對。在計算出每一列的按鍵電路K所對應的電壓門檻值Vth[M]後,處理模組110可對類比數位轉換器112進行設定,使得每一列的按鍵電路K對應至一個電壓門檻值Vth[M]。應當理解,每一列的按鍵電路K所對應的電壓門檻值Vth[M]在計算出來後可儲存於處理模組110或電子裝置100的儲存器。During the detection period P1, the key circuit K of each column corresponds to the initial voltage threshold Vinit, so the analog-to-
接著,步驟S203被執行。於步驟S203,處理模組110於掃描期間P2將每一列的回掃訊號Vread與對應的電壓門檻值Vth[M]進行比對,以確認接收到使用者輸入的按鍵電路K的位置。以下將搭配第8圖來詳細說明步驟S203。Next, step S203 is executed. In step S203, the
請參閱第8圖,第8圖為根據本揭示內容的一些實施例繪示的電子裝置100於掃描期間P2的操作示意圖。類似於偵測期間P1的操作,處理模組110於掃描期間P2依序對多條掃描線CL輸出對應的掃描訊號,並透過多條回掃線RL接收對應的回掃訊號。如第8圖所示,於掃描期間P2中一時間點t3,處理模組110藉由掃描線CL[0]輸出掃描訊號Vscan[0](其電壓值可為例如3.3伏特)至第1行的按鍵電路K,並分別藉由2條回掃線RL[0]及RL[1]接收2個回掃訊號Vread[0]及Vread[1](其電壓值可分別為例如1.65伏特)。於掃描期間P2中一時間點t4,處理模組110藉由掃描線CL[1]輸出掃描訊號Vscan[1](其電壓值可為例如3.3伏特)至第2行的按鍵電路K,並分別藉由2條回掃線RL[0]及RL[1]接收到2個回掃訊號Vread[0]及Vread[1](其電壓值可分別為例如0.47及1.41伏特)。Please refer to FIG. 8 , which is a schematic diagram of the operation of the
接著,處理模組110中的類比數位轉換器112將同一列的回掃訊號Vread於各個時間點之電壓值與對應的電壓門檻值Vth[M]進行比對,並基於比對結果輸出第一邏輯值(例如:“1”)或第二邏輯值(例如:“0”)。如前述說明,第1列的按鍵電路K所對應的電壓門檻值Vth[0]為1.1伏特,因此類比數位轉換器112於時間點t3將1.65伏特的回掃訊號Vread[0]與1.1伏特的電壓門檻值Vth[0]進行比對而輸出“1”(因為回掃訊號Vread[0]於時間點t3的電壓值高於或等於電壓門檻值Vth[0]),並於時間點t4將0.47伏特的回掃訊號Vread[0]與1.1伏特的電壓門檻值Vth[0]進行比對而輸出“0”(因為回掃訊號Vread[0]於時間點t4的電壓值低於電壓門檻值Vth[0])。Then, the analog-to-
又,第2列的按鍵電路K所對應的電壓門檻值Vth[1]為1.1伏特,因此類比數位轉換器112於時間點t3將1.65伏特的回掃訊號Vread[1]與1.1伏特的電壓門檻值Vth[1]進行比對而輸出“1”(因為回掃訊號Vread[1]於時間點t3的電壓值高於或等於電壓門檻值Vth[1]),並於時間點t4將1.41伏特的回掃訊號Vread[1]與1.1伏特的電壓門檻值Vth[1]進行比對而輸出“1”(因為回掃訊號Vread[1]於時間點t4的電壓值高於或等於電壓門檻值Vth[1])。其他列的操作可依此類推,故不在此贅述。據此,處理模組110可得到一掃描結果(例如:第8圖所示的3x3矩陣)。應當理解,本揭示內容並不以上述數值為限,對應於每一列的按鍵電路K的多個電壓門檻值Vth[M]可能全部相同或全部不相同,亦可部分相同且部分不相同。In addition, the voltage threshold Vth[1] corresponding to the key circuit K in the second column is 1.1 volts. Therefore, the analog-to-
由上述說明可知,於偵測期間P1,處理模組110判斷第1列第2行的按鍵電路K[0,1]有輸出訊號,但第1列第2行的按鍵電路K[0,1]實際上並未接收到使用者輸入。值得注意的是,於掃描期間P2,藉由將初始電壓門檻值Vinit替換或更新為對應於第1列的按鍵電路K[0,1]的電壓門檻值Vth[0],處理模組110判斷第1列第2行的按鍵電路K[0,1]沒有輸出訊號(因其對應的邏輯值為“0”),從而確認實際上僅有3個按鍵電路K[0,0]、K[1,0]及K[1,1]接收到使用者輸入。應當理解,此判斷結果與使用者的實際操作相符。也就是說,處理模組110於掃描期間P2產生的掃描結果可反映出實際上有被按壓的按鍵及其位置。It can be seen from the above description that during the detection period P1, the
如第4圖所示,在處理模組110產生掃描結果後,處理模組110可於非掃描期間P3將掃描結果傳送至電子裝置100的一主機單元(圖中未示),使得主機單元能根據使用者按壓的按鍵進行相關操作。於一些實施例中,主機單元可藉由一或多個中央處理單元(CPU)來實現。此外,如第3圖所示,當使用者再次改變其所按壓的按鍵時,處理模組可進入下一個掃描週期(即,再次由步驟S201開始執行)。As shown in FIG. 4 , after the
於一些實施例中,為了避免因為按鍵被按壓而產生的物理性跳動(bounce)影響到掃描結果,當於掃描期間P2中連續得到數個相同的掃描結果時,處理模組110才確認掃描結果。應當理解,每次產生的掃描結果均可儲存於處理模組110或電子裝置100的儲存器,以供處理模組110比對及確認掃描結果。此外,若前後兩次掃描結果不同,則處理模組110可結束當前掃描週期,並進入下一個掃描週期(即,再次由步驟S201開始執行)。In some embodiments, in order to avoid the physical bounce (bounce) caused by the button being pressed from affecting the scanning results, the
由上述本揭示內容的實施方式可知,藉由在輸入模組110中設置參考電阻Rfb及電阻R,本揭示內容的電子裝置100可基於使用者每次按壓的按鍵數量(此影響產生輸出訊號的按鍵電路的數量)針對每一列的按鍵電路計算出合適的電壓門檻值,以濾除實際上未被按壓的按鍵電路所輸出的訊號。如此一來,本揭示內容的電子裝置100可避免發生鬼鍵。It can be seen from the above embodiments of the present disclosure that by setting the reference resistor Rfb and the resistor R in the
雖然本揭示內容已以實施方式揭露如上,然其並非用以限定本揭示內容,所屬技術領域具有通常知識者在不脫離本揭示內容之精神和範圍內,當可作各種更動與潤飾,因此本揭示內容之保護範圍當視後附之申請專利範圍所界定者為準。Although the present disclosure has been disclosed in the above embodiments, it is not intended to limit the present disclosure. Those with ordinary skill in the technical field can make various modifications and modifications without departing from the spirit and scope of the present disclosure. Therefore, this disclosure The scope of protection of the disclosed content shall be determined by the scope of the patent application attached.
100:電子裝置 110:處理模組 112:類比數位轉換器 120:輸入模組 200:按鍵掃描方法 CL:掃描線 K:按鍵電路 RL:回掃線 Rfb:參考電阻 Req:等效電阻 R:電阻 SW:開關 P1:偵測期間 P2:掃描期間 P3:非掃描期間 t1,t2,t3,t4:時間點 Nr:輸出數量 Vscan:掃描訊號 Vread:回掃訊號 Vinit:初始電壓門檻值 Vth:電壓門檻值 Vr0(t1),Vr1(t1),Vr0(t2),Vr1(t2):電壓值 S201~S203:步驟 100: Electronic devices 110: Processing module 112:Analog-to-digital converter 120:Input module 200:Key scanning method CL: scan line K: Button circuit RL: retrace line Rfb: reference resistor Req: equivalent resistance R: Resistor SW: switch P1: During detection P2: During scanning P3: During non-scanning period t1,t2,t3,t4: time points Nr: output quantity Vscan: scan signal Vread: retrace signal Vinit: initial voltage threshold Vth: voltage threshold Vr0(t1),Vr1(t1),Vr0(t2),Vr1(t2): voltage value S201~S203: steps
第1圖為根據本揭示內容的一些實施例繪示的一種電子裝置的示意圖。 第2圖為根據本揭示內容的一些實施例繪示的一種電子裝置的電路示意圖。 第3圖為根據本揭示內容的一些實施例繪示的一種電子裝置的按鍵掃描方法的流程圖。 第4圖為根據本揭示內容的一些實施例繪示的一種電子裝置的按鍵掃描時序圖。 第5圖為根據本揭示內容的一些實施例繪示的一種電子裝置於偵測期間的操作示意圖。 第6圖為根據本揭示內容的一些實施例繪示的一種輸入模組於偵測期間中一時間點的電路示意圖。 第7A圖為根據本揭示內容的一些實施例繪示的一種輸入模組於偵測期間中另一時間點的電路示意圖。 第7B圖為根據本揭示內容的一些實施例繪示的第7A圖的輸入模組的等效電路示意圖。 第8圖為根據本揭示內容的一些實施例繪示的一種電子裝置於掃描期間的操作示意圖。 Figure 1 is a schematic diagram of an electronic device according to some embodiments of the present disclosure. FIG. 2 is a schematic circuit diagram of an electronic device according to some embodiments of the present disclosure. FIG. 3 is a flow chart of a key scanning method of an electronic device according to some embodiments of the present disclosure. FIG. 4 is a key scanning timing diagram of an electronic device according to some embodiments of the present disclosure. FIG. 5 is a schematic diagram illustrating the operation of an electronic device during detection according to some embodiments of the present disclosure. FIG. 6 is a circuit schematic diagram of an input module at a time point during the detection period according to some embodiments of the present disclosure. FIG. 7A is a circuit schematic diagram of an input module at another time point during the detection period according to some embodiments of the present disclosure. Figure 7B is a schematic equivalent circuit diagram of the input module of Figure 7A according to some embodiments of the present disclosure. FIG. 8 is a schematic diagram illustrating the operation of an electronic device during scanning according to some embodiments of the present disclosure.
國內寄存資訊(請依寄存機構、日期、號碼順序註記) 無 國外寄存資訊(請依寄存國家、機構、日期、號碼順序註記) 無 Domestic storage information (please note in order of storage institution, date and number) without Overseas storage information (please note in order of storage country, institution, date, and number) without
200:按鍵掃描方法 200:Key scanning method
S201~S203:操作 S201~S203: Operation
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW111111212A TWI806519B (en) | 2022-03-24 | 2022-03-24 | Electronic device and key scan method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW111111212A TWI806519B (en) | 2022-03-24 | 2022-03-24 | Electronic device and key scan method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI806519B TWI806519B (en) | 2023-06-21 |
TW202339444A true TW202339444A (en) | 2023-10-01 |
Family
ID=87803176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW111111212A TWI806519B (en) | 2022-03-24 | 2022-03-24 | Electronic device and key scan method thereof |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI806519B (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI487279B (en) * | 2009-12-21 | 2015-06-01 | Hon Hai Prec Ind Co Ltd | Scanning circuit for keyboard and method and electronic device using the same |
KR101391670B1 (en) * | 2013-04-30 | 2014-05-28 | 한상현 | Key input device and keyboard having the same |
US9921664B2 (en) * | 2015-11-25 | 2018-03-20 | Darfon Electronics Corp. | Keyboard device |
TWI581569B (en) * | 2015-12-14 | 2017-05-01 | 聯陽半導體股份有限公司 | Electronic apparatus and detection method for status of keys thereof |
TWI567590B (en) * | 2016-07-01 | 2017-01-21 | 達方電子股份有限公司 | Keyboard |
-
2022
- 2022-03-24 TW TW111111212A patent/TWI806519B/en active
Also Published As
Publication number | Publication date |
---|---|
TWI806519B (en) | 2023-06-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102023768B (en) | A touch contact positioning method, system and video display terminal | |
CN102075194B (en) | Circuit and method for scanning keyboard and electronic equipment | |
US20110316725A1 (en) | Scanning circuit and method for keyboard | |
CN100592637C (en) | Keyboard scanning circuit and method | |
US8780048B2 (en) | Membrane keyboard scan circuit, scan method and keyboard having the same | |
CN101686060B (en) | Control circuit and configuration method | |
CN101995956B (en) | Keyboard, keyboard scanning circuit and method | |
CN102111159B (en) | Keyboard scanning circuit and scanning method thereof | |
CN102594362A (en) | Key circuit based on analog-digital conversion | |
CN103543892A (en) | Sensing circuit, touch module, electronic device and control method | |
TWI493869B (en) | Keypad module and detecting method for keypad matrix | |
JP3168389U (en) | Input device with suppressed ghost keys | |
TWI806519B (en) | Electronic device and key scan method thereof | |
CN104423616B (en) | Input device and control unit | |
TW200820636A (en) | Keyboard scanning circuit and method | |
TWI487279B (en) | Scanning circuit for keyboard and method and electronic device using the same | |
CN102857231A (en) | Key testing circuit | |
US10817075B2 (en) | Keyboard control system and computer input system allowing a single pin to correspond to a single key when pressed on the keyboard key | |
US11720183B2 (en) | Method for operating an active input element and corresponding input element, input arrangement and computer program product | |
CN216649663U (en) | Key circuit | |
CN111897450A (en) | Capacitive touch module, control method thereof and touch display screen | |
CN102857232A (en) | Key detection circuit and key detection method | |
CN202798679U (en) | Key detection circuit | |
CN202383602U (en) | Touch-tone input device | |
US20230152905A1 (en) | Key control device and key control method |