1. Technical Field
The present disclosure relates to an electronic device having a key circuit.
2. Description of Related Art
An electronic device, such as a DVD player or a computer, includes a number of keys/buttons and a processor for executing different functions corresponding to different pressed keys. Each of the pressed keys generates different voltages. However, when two or more than two keys are simultaneously pressed, the generated voltage may be equal to a voltage corresponding to another key, which results in the processor thinking that a third key is pressed and executing an unexpected function.
Therefore, there is room for improvement in the art.
Many aspects of the embodiments can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the embodiments. Moreover, in the drawings, like reference numerals designate corresponding parts throughout two views.
The disclosure is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at “least one.”
The electronic device 100 includes a first voltage module 10, a second voltage module 20, a key circuit 30, and a processor 40.
The first voltage module 10 provides voltage to the processor 40.
The second voltage module 20 is electronically connected to the first voltage module 10 through the key module 30, and provides a second voltage to the key circuit 30. In the embodiment, the second voltage is 0 volts (V).
The key circuit 30 is electronically connected to the first voltage module 10, the second voltage module 20, and the processor module 40. The key circuit 30 controls the first voltage module 10 to output different voltages to the processor 40 when different keys are pressed by a user. The key circuit 30 includes a first key module 31, a second key module 32, and a third key module 34. The first key module 31, the second key module 32, and the third key module 34 are connected in parallel between the first voltage module 10 and the second voltage module 20. The second key module 32 and the third key module 34 are also electronically connected to the processor 40.
The processor 40 detects whether or not the voltage provided by the first voltage module 10 is changed by one of the first, second, or third key modules 31, 32, 34. The processor 40 includes a first port P1, a second port P2, and a third port P3. The first port P1 is electrically connected to the first voltage module 10, the first key module 31, the second key module 32, and the third key module 34. The second port P2 is electrically connected to the second key module 32 and the first voltage module 10. The third port P3 is electrically connected to the third key module 34 and the first voltage module 10. The processor 40 detects voltages of the first port P1, the second port P2, and the third port P3. When only the voltage of the first port P1 is changed, the processor 40 determines that a key from the first key module 31 is pressed. When any two voltages of the first, second, and third ports P1, P2, P3 are changed simultaneously, the processor 40 determines that a key from either of the second key module 32 or third key module 34 is pressed. When the voltages of the first, second, and third ports P1, P2, P3 are changed simultaneously, the processor 40 determines that two or more keys from the first, second, and third key modules 31, 32, 34 are pressed simultaneously. When the voltage of the first port P1 is changed but the voltages of the second port P2 and the third port P3 are not changed, the processor 40 determines that only the first key module 31 is pressed. When the voltages of the first port P1 and the second port P2 are changed simultaneously but the voltage of the third port P3 is not changed, the processor 40 determines that only the second key module 32 is pressed. When the voltages of the first port P1 and the third port P3 are changed simultaneously but the voltage of the second port P2 is not changed, the processor 40 determines that only the third key module 34 is pressed. When the voltages of the first port P1, the second port P2, and the third port P3 are changed simultaneously, the processor 40 determines that two or more keys from the first, second, and third key modules 31, 32, 34 are pressed simultaneously.
When the voltage provided by the first voltage module 10 is changed by one of the first, second, or third key modules 31, 32, 34, the processor 40 further compares the voltage provided by the first voltage module 10 to standard voltages and executes a corresponding function according to the standard voltage matched to the voltage provided by the first voltage module 10.
When any combination of the first, second, and third key modules 31, 32, 34 is being pressed simultaneously, the processor 40 does not compare the voltage provided by the first module 10 to the standard voltages and does not to execute any function.
The second voltage module 20 includes a ground port 21.
The first key module 31 includes a key Ka. Opposite terminals of the key Ka are respectively connected to the power source Vcc, through the first resistor R1, and the ground port 21.
In one embodiment, the second key module 32 includes three keys Kb1-Kb3 and three pull-down resistors Rb1-Rb3 corresponding to the three keys Kb1-Kb3. A terminal of each of the keys Kb1-Kb3 is connected to the first resistor R1 through the corresponding pull-down resistors Rb1-Rb3. Opposite terminals of each of the keys Kb1-Kb3 are connected to the ground port 21. The resistances of the keys Kb1-Kb3 are different from each other. A resistance of any combination of the keys Kb1-Kb3 when pressed simultaneously is different from a resistance of the key Kb1, Kb2, or Kb3 when pressed individually.
The third key module 34 includes three keys Kc1-Kc3 and three pull-down resistors Rc1-Rc3 corresponding to the three keys Kc1-Kc3. A terminal of each of the keys Kc1-Kc3 is connected to the first resistor R1 through the corresponding pull-down resistors Rc1-Rc3. Opposite terminals of each of the keys Kc1-Kc3 are connected to the ground port 21. The resistances of the keys Kc1-Kc3 are different from each other. A resistance of any combination of the keys Kc1-Kc3 when pressed simultaneously is different from the resistance of the key Kc1, Kc2, or Kc3 when pressed individually.
The first port P1 is connected to the first resistor R1. The second port P2 is connected between the keys Kb1-Kb3 and the corresponding resistors Rb1-Rb3. The third port P3 is connected between the keys Kc1-Kc3 and the corresponding resistors Rc1-Rc3.
When the key Ka is pressed, the voltage of the first port P1 is changed, and the voltages of the second port P2 and the third port P3 are not changed. The processor 40 compares the detected voltage of the first port P1 to the standard voltages and executes a function corresponding to the standard voltage matched to the detected voltage of the first port P1.
When one of the keys Kb1-Kb3 is pressed, the voltages of the first port P1 and the second port P2 are changed, and the voltage of the third port P3 is not changed. The processor 40 compares the detected voltage of the first port P1 to the standard voltages and executes a function corresponding to the standard voltage matched to the detected voltage of the first port P1. When any combination of the keys Kb1-Kb3 is pressed simultaneously, the detected voltage of the first port P1 does not match any of the standard voltages. Thus the processor 40 does not execute any function.
When one of the keys Kc1-Kc3 is pressed, the voltages of the first port P1 and the third port P3 are changed, and the voltage of the second port P2 is not changed. The processor 40 compares the detected voltage of the first port P1 to the standard voltages and executes the function corresponding to the standard voltage matched to the detected voltage of the first port P1. When any combination of the keys Kc1-Kc3 is pressed simultaneously, the detected voltage of the first port P1 does not match any of the standard voltages. Thus the processor 40 does not execute any function.
When any combination of the key Kb1-Kb3 and the key Kc1-Kc3 are pressed simultaneously, the voltage of the second port P2 and the third port P3 are changed simultaneously. The processor 40 does not compare the detected voltage of the first port P1 to the standard voltages and does not execute any function.
In use, when any combination of the keys are pressed simultaneously, the voltage provided by the first voltage module 10 does not match any of the standard voltages, and the processor 40 does not compare the voltage provided by the first module 10 to the standard voltage. Therefore, misoperation of keys of the electronic device 100 is reduced. Furthermore, separately connecting the second port P2 and the third port P3 to the processor 40 reduces a processing time of the processor 40 when any combination of the keys is pressed simultaneously.
It is to be understood, however, that even though information and advantages of the present embodiments have been set forth in the foregoing description, together with details of the structures and functions of the present embodiments, the disclosure is illustrative only; and changes may be made in detail, especially in the matters of shape, size, and arrangement of parts within the principles of the present embodiments to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Date | Country | Kind |
---|---|---|---|
2013101069029 | Mar 2013 | CN | national |