Keyboard and rotary encoder detection method and detection circuit, display device

By judging the sequence of the trigger signal in the idle state of the rotary encoder, the problem of determining the direction of the rotary encoder is solved, and accurate determination and efficient application of the direction of the rotary encoder is achieved.

CN114544153BActive Publication Date: 2025-03-11BOE TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011327838.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-24
Publication Date
2025-03-11
Estimated Expiration
2040-11-24

AI Technical Summary

Technical Problem

The prior art is difficult to effectively judge the rotation direction of the rotary encoder, which affects the application of the rotary encoder in electronic devices.

Method used

By activating the rotation encoder after actuating the trigger signal in the idle state of the rotary encoder, the sequence of triggering of the first trigger signal and the second trigger signal is determined, thereby determining the rotation direction of the rotary encoder.

Benefits of technology

Accurate judgment of the direction of the rotary encoder is achieved, and the efficiency of the rotary encoder is improved in electronic equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114544153B_ABST
    Figure CN114544153B_ABST
Patent Text Reader

Abstract

The present disclosure provides a detection method and detection circuit of a rotary encoder, a detection method of a keypad, and a display device. The detection method of the rotary encoder includes: in an idle state of the rotary encoder, triggering a signal after the rotary encoder is activated, wherein the trigger signal includes a first trigger signal and a second trigger signal; determining the triggering timing of the first trigger signal and the second trigger signal; and determining the rotation direction of the rotary encoder according to the trigger signal that is triggered first. The detection method of the rotary encoder provided by the present disclosure can realize the determination of the direction of the rotary encoder of the keypad.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of detection technology, and in particular to a detection method and detection circuit of a rotary encoder, a detection method of a keypad, and a display device. Background Art

[0002] With the rapid development of science and technology, more and more electronic devices use rotary encoders to adjust parameters. Rotary encoders are roughly divided into incremental and absolute types. Incremental rotary encoders generally output two-phase signals called A phase and B phase.

[0003] A rotary encoder is a sensor that detects position or rotation speed by converting the mechanical displacement of rotation into an electrical signal and then processing the signal. Therefore, it is necessary to effectively determine the rotation direction of the rotary encoder.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the embodiments of the present disclosure is to provide a detection method and detection circuit of a rotary encoder, a detection method of a keypad, and a display device, which can determine the direction of the rotary encoder of the keypad.

[0006] According to one aspect of the present disclosure, a detection method for a rotary encoder is provided, the detection method comprising:

[0007] When the rotary encoder is in an idle state, a trigger signal is triggered after the rotary encoder is activated, wherein the trigger signal includes a first trigger signal and a second trigger signal;

[0008] Determine the triggering timing of the first trigger signal and the second trigger signal;

[0009] According to the trigger signal that is triggered first, the rotation direction of the rotary encoder is determined

[0010] In an exemplary embodiment of the present disclosure,

[0011] According to the trigger signal that is triggered first, determining the rotation direction of the rotary encoder includes:

[0012] Determine that the trigger signal that is triggered first sets the rotation direction flag, and extend the preset time to filter out the trigger signal that is triggered later; set the rotation direction flag according to the trigger signal that is triggered first, and determine the rotation direction of the rotary encoder;

[0013] Alternatively, the trigger signal that is triggered first is filtered out, the trigger signal that is triggered later is detected, and the rotation direction of the rotary encoder is determined according to the trigger signal that is triggered later.

[0014] In an exemplary embodiment of the present disclosure, judging the rotation direction of the rotary encoder according to the trigger signal that is triggered first includes:

[0015] A trigger signal triggered after detection;

[0016] When the post-triggering trigger signal is detected, the rotation direction of the rotary encoder is determined according to the timing of the trigger signal.

[0017] In an exemplary embodiment of the present disclosure, judging the rotation direction of the rotary encoder according to the trigger signal that is triggered first includes:

[0018] Determining whether the levels of the ports outputting the first trigger signal and the second trigger signal are opposite;

[0019] If the opposite is true, the rotation direction of the rotary encoder is determined according to the trigger signal that is triggered first.

[0020] In an exemplary embodiment of the present disclosure, judging the rotation direction of the rotary encoder according to the trigger signal that is triggered first further includes:

[0021] If the levels of the ports outputting the first trigger signal and the second trigger signal are the same, it is determined that the trigger signal is invalid.

[0022] In an exemplary embodiment of the present disclosure, judging the rotation direction of the rotary encoder according to the trigger signal that is triggered first includes:

[0023] If the first trigger signal is triggered first, determining that the rotation direction of the rotary encoder is a first direction;

[0024] If the second trigger signal is triggered first, it is determined that the rotation direction of the rotary encoder is the second direction.

[0025] According to another aspect of the present disclosure, a keypad detection method is provided, the detection method comprising:

[0026] The judgment trigger signal is input through the key port or the rotary encoder port;

[0027] If the trigger signal is input through the key port, the key processing method is executed;

[0028] If the trigger signal is input through the rotary encoder port, the above-mentioned rotary encoder detection method is executed.

[0029] According to another aspect of the present disclosure, a detection circuit of a rotary encoder is provided, the detection circuit comprising:

[0030] A rotary encoder unit, comprising a first signal terminal and a second signal terminal, wherein the first signal terminal is capable of outputting a first trigger signal, and the second signal terminal is capable of outputting a second trigger signal;

[0031] The controller unit is configured to determine the triggering timing of the first trigger signal and the second trigger signal, and determine the rotation direction of the rotary encoder according to the trigger signal that is triggered first.

[0032] In an exemplary embodiment of the present disclosure, the detection circuit further includes:

[0033] An XOR gate, comprising an output terminal and two input terminals respectively connected to the first signal terminal and the second signal terminal; when the first signal terminal and the second signal terminal have the same level, the XOR gate outputs a low level; when the first signal terminal and the second signal terminal have different levels, the XOR gate outputs a high level;

[0034] Wherein, the controller unit comprises a first input terminal and a second input terminal, the first input terminal is connected to the output terminal of the XOR gate, and the second input terminal is connected to the first signal terminal or the second signal terminal; when the second input terminal is connected to the first signal terminal and the XOR gate outputs a high level, it is determined whether the level of the second input terminal is the same as the idle state; if it is different from the idle state, it is determined that the rotation direction of the rotary encoder is the first direction; if it is the same as the idle state, it is determined that the rotation direction of the rotary encoder is the second direction;

[0035] When the second input terminal is connected to the second signal terminal and the XOR gate outputs a high level, it is determined whether the level of the second input terminal is the same as the idle state; if it is different from the idle state, it is determined that the rotation direction of the rotary encoder is the second direction; if it is the same as the idle state, it is determined that the rotation direction of the rotary encoder is the first direction.

[0036] According to yet another aspect of the present disclosure, a display device is provided, which includes the detection circuit of the rotary encoder described above.

[0037] The detection method of the rotary encoder provided by the present disclosure triggers a signal after the rotary encoder is activated when the rotary encoder is in an idle state, and determines the triggering timing of the first trigger signal and the second trigger signal, thereby realizing the determination of the direction of the rotary encoder of the keypad.

[0038] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings herein are incorporated into and constitute a part of the specification, showing embodiments consistent with the present invention, and together with the specification, are used to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0040] Figure 1 A schematic diagram of a keypad provided for an embodiment of the present disclosure;

[0041] Figure 2 A flow chart of a detection method for a rotary encoder provided in one embodiment of the present disclosure;

[0042] Figure 3 An embodiment of the present disclosure provides Figure 2 Detailed step diagram of step S300;

[0043] Figure 4 Another embodiment of the present disclosure provides Figure 2 Detailed step diagram of step S300;

[0044] Figure 5 Another embodiment of the present disclosure provides Figure 2 Detailed step diagram of step S300;

[0045] Figure 6 A schematic diagram of a detection circuit of a rotary encoder provided in one embodiment of the present disclosure;

[0046] Figure 7 A circuit diagram of a rotary encoder provided for one embodiment of the present disclosure;

[0047] Figure 8 A schematic diagram of the level of a trigger signal of a rotary encoder provided by an embodiment of the present disclosure;

[0048] Fig. 9 A schematic diagram of a detection circuit of a rotary encoder provided in another embodiment of the present disclosure. DETAILED DESCRIPTION

[0049] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present invention will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0050] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.

[0051] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0052] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0053] Figure 1 The figure is a schematic diagram of the connection between a keypad 20 and a SoC (System-on-a-Chip) system board 10. There are two common keypads: one contains only action devices, such as keys, encoders, and dip switches. The keypad leads the interfaces of the action devices through the connector on the board, and the SoC detects the action status and identifies the action device; the other contains the action device and the co-controller, and the action of the action device is identified by the co-controller, and the action information is transmitted to the SoC system board through the digital interface. Figure 1 The keypad 20 in the embodiment adopts the second type including an action device and a coprocessor, and is connected to the SoC system board 10 via an RS232 interface.

[0054] The embodiment of the present disclosure first provides a detection method of a rotary encoder, such as Figure 2 As shown, the detection method of the rotary encoder includes:

[0055] Step S100, in an idle state of the rotary encoder, triggering a signal after the rotary encoder is activated, wherein the trigger signal includes a first trigger signal and a second trigger signal;

[0056] Step S200, determining the triggering timing of the first trigger signal and the second trigger signal;

[0057] Step S300: Determine the rotation direction of the rotary encoder according to the trigger signal that is triggered first.

[0058] The detection method of the rotary encoder provided by the present disclosure enables the rotary encoder to trigger a signal after it is activated when the rotary encoder is in an idle state, and determines the triggering timing of the first trigger signal and the second trigger signal, thereby realizing the determination of the direction of the rotary encoder of the keypad.

[0059] Below, each step of the detection method of the rotary encoder provided by the embodiment of the present disclosure will be introduced in detail.

[0060] In step S100 , when the rotary encoder is in an idle state, a trigger signal is generated after the rotary encoder is activated. The trigger signal includes a first trigger signal and a second trigger signal.

[0061] Specifically, Figure 7 and Figure 8 The circuit diagram and timing waveform of the rotary encoder in the keypad. It includes the rotary encoder, pull-up resistors R101 and R102, and RC filters R103, C101 and R104, C102. The A and B ends of the rotary encoder circuit are connected to the two input pins of the MCU's GPIO (General-purpose input / output).

[0062] Specifically, the rotary encoder usually has two ports that emit rectangular waves, namely the A-phase port and the B-phase port. When the rotary encoder is rotated, the levels output by the A-phase port and the B-phase port will jump once for each rotation, and finally form a rectangular wave. There is a phase difference between the rectangular waves emitted by the A-phase port and the B-phase port. Depending on the rotation direction of the rotary encoder, the phase difference will also be different. For example, when the rotary encoder rotates clockwise, the rectangular wave output by the A-phase port will lead the rectangular wave output by the B-phase port by 1 / 4 phase; otherwise, it will lag behind by 1 / 4 phase; wherein, the rectangular wave output by the A-phase port may lead the rectangular wave output by the B-phase port by 1 / 2 phase, or other phase differences, and the present disclosure does not limit this. Therefore, the rotation direction of the rotary encoder can be determined based on the phase relationship between the rectangular wave output by the A-phase port and the rectangular wave output by the B-phase port, and the number of rotation grids of the rotary encoder can be determined based on the number of the above jumps.

[0063] The working sequence of the rotary encoder is as follows: Figure 8 As shown in the figure, when the rotary encoder rotates clockwise (CW), the level of the A-phase port jumps first, then the level of the B-phase port jumps, and the rotary encoder rotates one scale. When the rotary encoder rotates counterclockwise (CCW), the level of the B-phase port jumps first, then the level of the A-phase port jumps, and the rotary encoder rotates one scale.

[0064] In the idle state of the rotary encoder, that is, when the A-phase port and the B-phase port have the same level, for example Figure 8 The A-phase port and the B-phase port are in the low level state in the initial stage, so that the rotary encoder can be activated and the trigger signal is generated, and the trigger signal includes the first trigger signal output from the A-phase port and the second trigger signal output from the B-phase port.

[0065] In step S200, the triggering timing of the first trigger signal and the second trigger signal is determined;.

[0066] Specifically, the triggering timing of the first trigger signal and the second trigger signal is determined, and the first interrupt signal can be generated by the A phase port, and the second interrupt signal can be generated by the B phase port. Figure 8 As shown, the A-phase port outputs the trigger signal first.

[0067] In step S300, the rotation direction of the rotary encoder is determined according to the trigger signal that is triggered first.

[0068] Specifically, if the first trigger signal is triggered first, the rotation direction of the rotary encoder is determined to be the first direction; if the second trigger signal is triggered first, the rotation direction of the rotary encoder is determined to be the second direction. The first direction is opposite to the second direction, the first direction is clock wise (CW), and the second direction is counterclockwise (CCW); of course, the first direction may be counterclockwise and the second direction may be clockwise, and the present disclosure does not limit this.

[0069] For example, Figure 3 As shown, step S300: judging the rotation direction of the rotary encoder according to the trigger signal that is triggered first, including:

[0070] Step S311, determine that the trigger signal that is triggered first sets the rotation direction flag, and extend the setting of the interrupt flag for a preset time;

[0071] Step S312: Set the rotation direction flag according to the trigger signal that is triggered first to determine the rotation direction of the rotary encoder.

[0072] Specifically, when the action or interrupt trigger interval is less than the action processing time of the processor, the processor will miss the action detection this time, and the user will feel that the operation is invalid or the operation response is slow, or it will cause repeated abnormal positive and negative judgments. The use of a high-speed controller will increase costs. When the first interrupt is triggered, the interrupt status is read immediately and processed before the next interrupt comes, otherwise it will cause lost steps or wrong judgment of the rotation direction. When the fast rotary encoder or MCU processing speed is not fast enough, the rotary encoder will fail. By extending the preset time of the set interrupt flag, abnormal reversal can be avoided.

[0073] For example, the trigger signal that is triggered first is filtered out first, and then the trigger signal that is triggered later is detected, and the rotation direction flag is set according to the trigger signal that is triggered later to determine the rotation direction of the rotary encoder.

[0074] For example, Figure 4 As shown, step S300: judging the rotation direction of the rotary encoder according to the trigger signal that is triggered first, including:

[0075] Step S321, a trigger signal triggered after detection;

[0076] Step S322: When the post-triggering trigger signal is detected, the rotation direction of the rotary encoder is determined according to the timing of the trigger signal.

[0077] Specifically, one rotation of the rotary encoder will generate two interruptions. By detecting the order of the first trigger signal and the second trigger signal, if the first trigger signal is triggered first, the rotation direction of the rotary encoder is determined to be the first direction; if the second trigger signal is triggered first, the rotation direction of the rotary encoder is determined to be the second direction.

[0078] For example, Figure 5 As shown, step S300: judging the rotation direction of the rotary encoder according to the trigger signal that is triggered first, including:

[0079] Step S331, determining whether the levels of the ports outputting the first trigger signal and the second trigger signal are opposite;

[0080] Step S332: If the opposite is true, the rotation direction of the rotary encoder is determined according to the trigger signal that is triggered first.

[0081] Specifically, in the idle state of the rotary encoder, that is, when the A-phase port and the B-phase port have the same level, for example Figure 8The A-phase port and the B-phase port are in the initial low-level state. The rotary encoder is activated and the trigger signal is triggered to determine whether the levels of the ports outputting the first trigger signal and the second trigger signal are opposite; if they are opposite, the rotation direction of the rotary encoder is determined according to the trigger signal that is triggered first; if the levels of the ports outputting the first trigger signal and the second trigger signal are the same, the trigger signal is determined to be invalid, thereby avoiding the problem of abnormal reversal.

[0082] The embodiment of the present disclosure also provides a keypad detection method, the detection method comprising:

[0083] The judgment trigger signal is input through the key port or the rotary encoder port;

[0084] If the trigger signal is input through the key port, the key processing method is executed;

[0085] If the trigger signal is input through the rotary encoder port, the above-mentioned rotary encoder detection method is executed.

[0086] The detection method of the keypad provided by the present invention can determine the trigger signal of the key or rotary encoder. When the rotary encoder is in an idle state, the rotary encoder is activated to trigger the signal. By determining the trigger signal that is triggered first between the first trigger signal and the second trigger signal, the direction of the rotary encoder of the keypad can be determined.

[0087] The embodiment of the present disclosure also provides a detection circuit of a rotary encoder, such as Figure 6 As shown, the detection circuit includes:

[0088] The rotary encoder unit 30 includes a first signal terminal and a second signal terminal, the first signal terminal can output a first trigger signal, and the second signal terminal can output a second trigger signal;

[0089] The controller unit 40 is configured to determine the triggering timing of the first trigger signal and the second trigger signal, and determine the rotation direction of the rotary encoder according to the trigger signal that is triggered first. The controller unit may include a single chip microcomputer.

[0090] The present disclosure provides a detection circuit for a rotary encoder, wherein a controller unit can determine the triggering timing of a first trigger signal and a second trigger signal, and determine the rotation direction of the rotary encoder according to the trigger signal that is triggered first.

[0091] like Fig. 9 As shown, the detection circuit also includes: an XOR gate, the XOR gate includes an output terminal and two input terminals respectively connected to the first signal terminal and the second signal terminal; when the first signal terminal and the second signal terminal have the same level, the XOR gate outputs a low level; when the first signal terminal and the second signal terminal have different levels, the XOR gate outputs a high level;

[0092] Wherein, the controller unit includes a first input terminal and a second input terminal, the first input terminal is connected to the output terminal of the XOR gate, and the second input terminal is connected to the first signal terminal or the second signal terminal; when the second input terminal is connected to the first signal terminal and the XOR gate outputs a high level, it is determined whether the level of the second input terminal is the same as the idle state; if it is different from the idle state, it is determined that the rotation direction of the rotary encoder is the first direction; if it is the same as the idle state, it is determined that the rotation direction of the rotary encoder is the second direction;

[0093] When the second input terminal is connected to the second signal terminal and the XOR gate outputs a high level, it is determined whether the level of the second input terminal is the same as the idle state; if it is different from the idle state, it is determined that the rotation direction of the rotary encoder is the second direction; if it is the same as the idle state, it is determined that the rotation direction of the rotary encoder is the first direction.

[0094] like Figure 6 As shown, the detection circuit also includes: UART to RS232 conversion chip, RS232 interface and LED indicator. Among them, the key of the detection circuit is a touch key, which is connected to the input pin of the MCU; the rotary encoder is connected to the two input pins of the MCU; RS232 is the connection interface of the key board and the connection interface between the SoC system board; UART to RS232 is to convert the UART signal of the MCU into an RS232 level signal; LED is a status indicator, which can be set in multiples, corresponding to each key and rotary encoder one by one to display the status of each key and rotary encoder.

[0095] The embodiment of the present disclosure further provides a display device, which includes the detection circuit of the rotary encoder. The display device can be a monitoring device with a display function, such as a 4K monitor, an 8K performance control system, etc. The display device can also be a display device with a keypad such as a liquid crystal display, an organic electroluminescent display, a digital signage, etc., which are not listed one by one in the present disclosure.

[0096] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0097] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0098] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A detection method for a rotary encoder, characterized in that: include: When the rotary encoder is in an idle state, a trigger signal is triggered after the rotary encoder is activated, wherein the trigger signal includes a first trigger signal and a second trigger signal; Determine the triggering timing of the first trigger signal and the second trigger signal; Determining the rotation direction of the rotary encoder according to the trigger signal that is triggered first; Wherein, judging the rotation direction of the rotary encoder according to the trigger signal that is triggered first includes: Determine that the trigger signal that is triggered first sets the rotation direction flag, and extend the preset time to filter out the trigger signal that is triggered later; set the rotation direction flag according to the trigger signal that is triggered first, and judge the rotation direction of the rotary encoder; if the first trigger signal is triggered first, judge that the rotation direction of the rotary encoder is the first direction; if the second trigger signal is triggered first, judge that the rotation direction of the rotary encoder is the second direction.

2. A keypad detection method, characterized in that: include: The judgment trigger signal is input through the key port or the rotary encoder port; If the trigger signal is input through the key port, the key processing method is executed; If the trigger signal is input through the rotary encoder port, the rotary encoder detection method according to claim 1 is executed.

3. A detection circuit of a rotary encoder, characterized in that: include: A rotary encoder unit, comprising a first signal terminal and a second signal terminal, wherein the first signal terminal is capable of outputting a first trigger signal in an idle state of the rotary encoder unit, and the second signal terminal is capable of outputting a second trigger signal in an idle state of the rotary encoder unit; A controller unit is configured to determine the triggering timing of the first trigger signal and the second trigger signal, and determine the rotation direction of the rotary encoder according to the trigger signal that is triggered first; Wherein, the controller unit is configured to determine that the trigger signal that is triggered first sets the rotation direction flag, and extend the preset time to filter out the trigger signal that is triggered later; set the rotation direction flag according to the trigger signal that is triggered first, and judge the rotation direction of the rotary encoder; if the first trigger signal is triggered first, judge the rotation direction of the rotary encoder to be the first direction; if the second trigger signal is triggered first, judge the rotation direction of the rotary encoder to be the second direction.

4. A display device, characterized in that: A detection circuit comprising the rotary encoder according to claim 3.

Citation Information

Patent Citations

  • Knob digital code switch device and working state identification method thereof

    CN107589933A

  • Key detection method, keyboard and key system

    CN110221709A