Patent Publication Number: US-2013249714-A1

Title: Keypad module and detecting method for keypad matrix

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The invention relates to a keypad module, and more particularly to a keypad module capable of performing trigger-driven key scanning operation. 
     2. Description of the Related Art 
     Keypad modules are widely used in portable devices, such as mobile phones. One keypad scanning technique uses a processor to periodically poll (typically every 20-30 milliseconds) the state of a keypad matrix of a keypad module, so as to determine when a key is pressed or released. However, polling more frequently may result in power consumption and excess keypad strobe noise, while polling less frequently may result in the missing of keypresses and keyreleases. 
     Another keypad scanning technique uses interrupts to a controller, to indicate whether any key of a keypad module has been pressed. The interrupts may be a specific event for waking up the controller when the controller is operated in an idle mode or sleep mode. In general, actual number of interrupt/wake-up IO pins (or ports) of the controller depend on the number of columns or rows in a keypad matrix of the keypad module. In the controller, the number of interrupt sources and corresponding connections are increased when the number of rows or columns of the keypad matrix is increased, thus occupying interrupt/wake-up resources of the controller. However, the interrupt/wake-up resources are limited for the controller. If the interrupt/wake-up resources of the controller are not enough to support the keypad matrix, an additional controller is needed for performing key scanning operations. 
     Less interrupt sources are desired for a keypad matrix in a keypad module, so as to decrease costs and board space of the keypad module. 
     BRIEF SUMMARY OF THE INVENTION 
     Keypad module and a detecting method for a keypad matrix are provided. An embodiment of a keypad module is provided. The keypad module comprises a keypad matrix, a plurality of resistors, a pull-up resistor and a controller coupled to the keypad matrix. The keypad matrix comprises a plurality of keys disposed in intersections of a plurality of first lines and a plurality of second lines. Each of the resistors is coupled between an individual line of the second lines and a common node. The pull-up resistor is coupled to the common node. The controller provides a low logic level signal to the first lines of the keypad matrix and obtains a trigger event via the common node when one of the keys is pressed in the keypad matrix. 
     Furthermore, an embodiment of a detecting method for a keypad matrix is provided. The keypad matrix comprises a plurality of keys disposed in intersections of a plurality of first lines and a plurality of second lines, and each of the second lines is coupled to a common node via an individual resistor. A low logic level signal is provided to the first lines of the keypad matrix. A trigger event is obtained via the common node when one of the keys is pressed in the keypad matrix. A pull-up resistor is coupled to the common node. 
     A detailed description is given in the following embodiments with reference to the accompanying drawings. 
    
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
       The invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein: 
         FIG. 1  shows a keypad module according to an embodiment of the invention; 
         FIG. 2  shows a detecting method for a keypad matrix according to an embodiment of the invention; and 
         FIG. 3  shows an example illustrating a waveform diagram of the keypad module of  FIG. 1 . 
     
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims. 
       FIG. 1  shows a keypad module  100  according to an embodiment of the invention. The keypad module  100  comprises a keypad matrix  110 , a controller  120  and the resistors  130 ,  140 ,  150  and  160 . The keypad matrix  110  comprises the keys K 11 , K 12 , K 13 , K 21 , K 22 , K 23 , K 31 , K 32  and K 33  disposed in intersections of the row lines R 1 -R 3  and the column lines C 1 -C 3 . For example, the key K 11  is arranged in the intersection of the row line R 1  and the column line C 1 , and the key K 33  is arranged in the intersection of the row line R 3  and the column line C 3 . In the embodiment, the keypad matrix  110  comprising 3×3 keys is used as an example for description, and does not limit the invention. The output pins OUT 1 -OUT 3  of the controller  120  are coupled to the row lines R 1 -R 3  of the keypad matrix  110 , respectively. The input pins  1 N 1 - 1 N 3  of the controller  120  are coupled to the column lines C 1 -C 3  of the keypad matrix  110 , respectively. The connections of the input and output pins of the controller  120  are used as an example, and do not limit the invention. In one embodiment, the input pins IN 1 -IN 3  and the output pins OUT 1 -OUT 3  of the controller  120  are coupled to the column lines C 1 -C 3  and the row lines R 1 -R 3  of a keypad matrix, respectively. Furthermore, a bi-directional pin INT of the controller  120  is coupled to a common node N com . In the embodiment, the bi-directional pin INT is an interrupt/wake-up resource of the controller  120 . The resistor  130  is coupled between the input pin IN 1  of the controller  120  and the common node N com . The resistor  140  is coupled between the input pin IN 2  of the controller  120  and the common node N com . The resistor  150  is coupled between the input pin IN 3  of the controller  120  and the common node N com . The resistor  160  is a pull-up resistor coupled between the common node N com  and a power supply VCC. In the embodiment, the resistors  130 ,  140  and  150  have the same resistances smaller than that of the resistor  160 . Furthermore, the keypad module  100  can be implemented in a portable device, wherein the controller  120  can be implemented in an integrated circuit of the portable device, and the bi-directional pin INT is used to receive a wake up event or an interrupt event for the integrated circuit. 
       FIG. 2  shows a detecting method for a keypad matrix according to an embodiment of the invention. Referring to  FIG. 1  and  FIG. 2  together, in step S 210 , the controller  120  simultaneously provides a low logic level signal to the row lines R 1 -R 3  via the output pins OUT 1 -OUTS and configures the bi-directional pin INT as an input mode for detecting a voltage of the common node N com . If no key of the keypad matrix  110  is pressed, the voltage of the common node N com  is pulled up to a high logic level ‘H’ via the resistor  160 . Once any key of the keypad matrix  110  is pressed, the voltage of the common node N com  is changed from a high logic level ‘H’ to a low logic level ‘L’, and the controller  120  obtains a trigger event via the bi-directional pin INT (step S 220 ). The trigger event may be an interrupt event or a wake-up event. Next, in step S 230 , the controller  120  configures the bi-directional pin INT as an output mode for providing a high logic level signal ‘H’ to the common node N com . Next, in step S 240 , the controller  120  performs a key scanning operation via the output pins OUT 1 -OUT 3  and the input pins IN 1 -IN 3 , to determine the pressed key. For example, the controller  120  may select one of the row lines to toggle and obtain the variations of the column lines in response to the toggle of the selected row line. After the pressed key is determined, the controller  120  further detects whether the pressed key has been released. When the pressed key has been released or no key is pressed, the controller  120  completes the key scanning operation, and configures the bi-directional pin INT as an input mode to wait for a next trigger event (step S 250 ). In the embodiment, only one interrupt/wake-up resource (e.g. the bi-directional pin INT) is needed for the controller  120 , thus decreasing cost and board space of the keypad module  100 . 
       FIG. 3  shows an example illustrating a waveform diagram of the keypad module  100  of  FIG. 1 . Referring to  FIG. 1  and  FIG. 3  together, the controller  120  provides a low logic level signal to the row lines R 1 -R 3  via the output pins OUT 1 -OUT 3  during a time period TP 1 . Simultaneously, the controller  120  configures the bi-directional pin INT as an input mode for receiving the voltage of the common node N com . Because no key is pressed during the time period TP 1 , the voltage of the common node N com  and the voltages of the column lines C 1 -C 3  are pulled to a low logic level ‘H’ by the power supply VCC and the pull-up resistor  160 . Assuming that the key K 22  is pressed during a time period TP 2  in  FIG. 3 , the key K 22  is arranged in the intersection of the row line R 2  and the column line C 2  of the keypad matrix  110 , thereby the row line R 2  is connected to the column line C 2  via the pressed key K 22  at time t 1 . Thus, the column line C 2  is pulled down by the row line R 2 , and then the voltage of the common node N com  is also pulled down, i.e. the voltage of the common node N eon , is changed from a high logic level ‘H’ to a low logic level ‘L’. In response to the voltage variation at the common node N com , the controller  120  obtains a trigger event at time t 1 . Furthermore, the controller  120  further detects that one of the column lines (i.e. C 2 ) is pulled down. Next, the controller  120  starts to perform a key scanning operation at time t 2 . The controller  120  may periodically toggle the row lines R 1 -R 3  via the output pins OUT 1 -OUT 3  in the key scanning operation. When the row line R 2  is toggled, the controller  120  detects a voltage variation corresponding to the toggle in the column line C 2 . Therefore, it is determined that the key K 22  has been pressed. Next, the pressed key K 22  is released at time t 3 , thereby the column line C 2  is changed from a low logic level ‘L’ to a high logic level ‘H’. When detecting that all of the column lines are pulled up to a high logic level ‘H’, i.e. no key is pressed, the controller  120  completes the key scanning operation and configures the bi-directional pin INT as an input mode, so as to obtain a next trigger event. 
     While the invention has been described by way of example and in terms of the preferred embodiments, it is to be understood that the invention is not limited to the disclosed embodiments. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.