Disclosure of Invention
The invention provides a digital knob switch multiplexing device, which aims to solve the problems that one knob switch can only adjust one controlled object, the function is single and the resource occupation is large in the existing control circuit designed for the digital knob switch, realizes the multiplexing of a plurality of controlled objects on one digital knob switch, has simple circuit design and obviously saves resources.
In order to solve the technical problems, the invention adopts the following technical scheme:
a digital knob switch multiplexing device comprises a plurality of paths of power supplies with different amplitudes, a digital knob switch and a processor; the processor judges the currently selected controlled object according to the size of the power supply of the digital knob switch.
Furthermore, the processor is connected with the detection end and the state end of the digital knob switch, and after one of the paths of power supplies is selected through the gating device and before the digital knob switch rotates, the processor judges the currently selected controlled object by detecting the voltage amplitude of the detection end or the state end.
Preferably, the state end of the digital knob switch is connected with an ADC (analog to digital converter) interface of the processor, and the detection end is connected with a GPIO (general purpose input/output) port of the processor; the processor judges the currently selected controlled object by detecting the voltage value converted and output by the ADC interface, and judges whether the digital knob switch rotates or not by detecting the high-low level state of the GPIO interface.
Still further, the processor judges the rotation direction of the digital rotary switch according to the phase difference between the state end and the detection end of the digital rotary switch, and then adjusts the parameter value of the controlled object to increase or decrease according to the rotation direction.
In order to simplify the circuit design, the power supply comprises a direct current power supply with the highest voltage amplitude, and the rest power supplies are generated by voltage division conversion of the direct current power supply with the highest voltage amplitude through a voltage division circuit.
Furthermore, each power supply generated by voltage division conversion of the voltage division circuit is output to the power supply end of the digital knob switch through a backflow prevention circuit.
When the controlled objects are two, the gating device can adopt a key switch to carry out circuit design, and the key switch is connected between the direct-current power supply with the highest voltage amplitude and the power supply end of the digital knob switch; the voltage division circuit is connected between a direct current power supply with the highest voltage amplitude and the ground, and the voltage division node is connected with the power supply end of the digital knob switch.
When the controlled objects are two or more than two, the gating device can adopt a single-pole multi-throw switch to carry out circuit design, and a common end of the single-pole multi-throw switch is connected with the direct-current power supply with the highest voltage amplitude, wherein one gating end is directly connected with a power supply end of the digital knob switch, and in addition, each gating end is grounded through a group of voltage division circuits, and a voltage division node of each group of voltage division circuits is connected with the power supply end of the digital knob switch; or the voltage division circuit is a circuit with a plurality of voltage division nodes, one end of the voltage division circuit is connected with the direct current power supply with the highest voltage amplitude, the other end of the voltage division circuit is grounded, the common end of the single-pole multi-throw switch is connected with the power supply end of the digital knob switch, and each path of gating end is correspondingly gated and connected with each voltage division node.
Preferably, the dc power supply with the highest voltage amplitude is grounded through a filter capacitor, so as to improve the stability of the dc power supply.
Based on the digital knob switch multiplexing device, the invention also provides electronic equipment designed by adopting the digital knob switch multiplexing device, which comprises a plurality of paths of power supplies with different amplitudes, a digital knob switch and a processor; the processor judges the currently selected controlled object according to the size of the power supply of the digital knob switch. Therefore, the parameter adjusting requirements of various controlled objects can be met by only using one digital knob switch.
Compared with the prior art, the invention has the advantages and positive effects that: the invention realizes the automatic identification of the controlled object to be regulated at present by changing the amplitude of the power supply output to the digital knob switch, thereby enabling a plurality of controlled objects to share one digital knob switch for parameter regulation and applying the digital knob switch to the electronic equipment which needs to regulate a plurality of controlled objects step by step, not only simplifying the circuit structure of the electronic equipment, reducing the hardware cost and saving the space of the electronic equipment; and the circuit design can finish the regulation task of various controlled objects only by occupying two paths of interface resources of the processor, simplifies the wiring design of the PCB on the basis of obviously saving the interface resources of the processor, and is particularly suitable for being applied to the system circuit design with relatively short interface resources of the processor so as to simplify the difficulty of the system circuit design.
Other features and advantages of the present invention will become more apparent from the detailed description of the embodiments of the present invention when taken in conjunction with the accompanying drawings.
Detailed Description
The following describes embodiments of the present invention in further detail with reference to the accompanying drawings.
In order to implement compatible adjustment of one digital rotary switch on N kinds of controlled objects (such as volume, brightness, etc.), the digital rotary switch multiplexing device of this embodiment first provides multiple power supplies with different amplitudes for the digital rotary switch in terms of circuit design, where each power supply corresponds to one controlled object. And the gating device is used for selectively switching among the power supplies, and the corresponding power supply is gated to supply power for the digital knob switch according to the controlled object which needs to be regulated currently by the user. Then, the processor is used for detecting the power supply applied to the digital knob switch, which controlled object needs to be adjusted currently can be identified according to the detected size of the power supply, and the parameters of the controlled object are adjusted step by step or continuously according to the rotating direction of the digital knob switch.
For the multi-path power supply, N paths are taken as an example for explanation, where N is a natural number greater than 1, and may be directly provided by N paths of independent direct current power supplies; or N-1 voltage stabilizing chips are arranged on a power panel in the digital knob switch multiplexing device, and one direct current power supply in the device is subjected to voltage stabilizing conversion by using the voltage stabilizing chips so as to generate the required power supplies with the other N-1 voltage amplitude values different. For the former design scheme, the digital rotary switch is only suitable for the situation that the device is provided with multiple direct current power supplies, the existing direct current power supplies of all the paths are used for directly supplying power to the digital rotary switch, the digital rotary switch is obviously the simplest and the most economical in circuit design, but at present, electronic equipment capable of simultaneously supplying multiple direct current power supplies is rare, and therefore the application field of the electronic equipment is limited. For the situation that the device has only one or less than N direct current power supplies, if the latter design scheme is adopted, the cost of the whole circuit is undoubtedly increased, and the occupied area of the PCB board is increased. In order to solve the problem, in this embodiment, a voltage dividing circuit is designed, one path of the dc power VDD in the selection device is connected to the voltage dividing circuit, and the voltage dividing circuit is used to perform voltage dividing conversion on the path of the dc power VDD, so as to generate the remaining N-1 paths of power supplies, so as to meet the design requirement.
Obviously, the amplitude of each power supply output by the voltage divider circuit is definitely lower than the dc power supply VDD, and as long as the voltage divider circuit is configured reasonably, the voltage amplitudes of N-1 power supplies output by the voltage divider circuit are different, and each power supply can meet the power supply requirement of the digital knob switch, then the voltage divider circuit can provide N power supplies with different amplitudes for the digital knob switch by matching with the dc power supply VDD, so that the overall circuit structure of the device is simplified on the premise of accurately identifying N controlled objects. The voltage division circuit can be formed by connecting resistors in series, or can be formed by connecting a resistor and a voltage stabilizing tube in series. The serial nodes are voltage division output ends and output power supplies with corresponding amplitudes.
The specific construction structure and the operation principle of the two digital knob switch multiplexing circuits are described below with reference to fig. 1 to 3.
Referring to fig. 1, in the case that there are only two controlled objects (i.e. N = 2), one key switch S2 may be used as the gating device, and connected between the dc power supply VDD and the power supply terminal VCC of the digital knob switch DS. According to the design idea provided by this embodiment, two paths of power supplies are needed for identifying two controlled objects, and one path of the existing dc power supply VDD in the device is used as one path of the power supply, so that only one group of voltage dividing circuits needs to be designed to perform voltage dividing conversion on the dc power supply VDD, and a second path of power supply can be generated, thereby meeting the design requirements.
Therefore, in the present embodiment, the voltage dividing circuit is formed by connecting two voltage dividing resistors R1 and R2, and is connected between the dc power supply VDD and ground to perform voltage division conversion on the dc power supply VDD. The voltage dividing node (namely the middle node of the voltage dividing resistors R1 and R2) of the voltage dividing circuit is connected with the anode of a backflow prevention diode D1, the cathode of the backflow prevention diode D1 is connected with the power supply terminal VCC of the digital knob switch DS, and a second direct current power supply VDD1 is output through the voltage dividing node of the voltage dividing circuit to supply power to the digital knob switch DS. The ground terminal GND of the digital rotary switch DS is connected to the system ground of the PCB. The backflow prevention diode D1 is mainly used to prevent voltage backflow and stabilize the input of the power supply terminal VCC of the digital knob switch DS, so the present embodiment is not limited to the backflow prevention circuit formed by the backflow prevention diode D1, and the backflow prevention circuit with a backflow prevention function may be replaced as long as the backflow prevention circuit can be replaced, for example, the backflow prevention circuit formed by the backflow prevention diode D1 may be replaced by a backflow prevention circuit formed by a triode and/or a MOS transistor.
In order to stabilize the dc power VDD and VDD1 outputted to the digital knob switch DS, a filter capacitor C1 is further connected between the dc power VDD and ground in this embodiment to filter noise interference in the power supply line.
And the digital knob switch DS is connected with the processor MCU, and the power supply size of the digital knob switch DS is detected by the processor MCU, so that the identification of the currently selected controlled object is realized. In this embodiment, the processor MCU may select a low-cost single chip microcomputer to perform specific circuit design, so as to reduce the hardware cost of the whole device. In order to further save the interface resources of the processor MCU, the present embodiment is preferably implemented by detecting the high level amplitude of the status terminal a or the detection terminal B of the digital rotary switch DS for the size of the power supply applied to the digital rotary switch DS. Due to the rotation state of the digital rotary switch DS, it is necessary to detect the phase change of the state terminal a and the detection terminal B, and the signals output through the state terminal a and the detection terminal B are both high and low level pulse signals, and the amplitude of the high level is just equal to the voltage amplitude of the power supply input to the digital rotary switch DS. Therefore, when the connecting circuit of the digital knob switch DS and the processor MCU is designed, only two interfaces of the processor MCU are needed to be occupied, and the state end A and the detection end B of the digital knob switch DS are respectively connected, so that the detection of the size of the power supply of the digital knob switch DS can be realized while the requirement for detecting the rotation state of the digital knob switch DS is met.
In this embodiment, preferably, one GPIO port (for example, the interrupt signal interface INT) of the processor MCU is connected to the detection terminal B of the digital knob switch DS, and whether the digital knob switch DS rotates is determined according to the high-low level state of the detection terminal B; one path of ADC interface of the selection processor MCU is connected with a state end A of the digital knob switch DS, and the currently selected controlled object is judged according to the high level amplitude of the state end A.
The specific operation principle of the digital rotary switch multiplexing device proposed in this embodiment will be described in detail with reference to fig. 1.
Supposing that certain electronic equipment needs to gradually or continuously adjust two controlled objects of the speaker volume and the picture brightness, and when a direct-current power supply VDD is selected to supply power to a digital knob switch DS, the controlled object which needs to be adjusted is the speaker volume; when the divided dc power supply VDD1 is used to supply power to the digital knob switch DS, it indicates that the controlled object requiring adjustment is the screen brightness.
When the user needs to adjust the volume of the speaker of the electronic device, the key switch S2 is closed, and the digital knob switch DS is powered by the dc power supply VDD. Because the voltage amplitude of the dc power supply VDD is higher than the voltage amplitude of the divided dc power supply VDD1, the back-flow prevention diode D1 is turned off in reverse bias, and blocks the output of the dc power supply VDD 1. At this time, the state terminal a and the detection terminal B of the digital knob switch DS respectively output high levels, and the amplitude is equal to the voltage amplitude of the dc power supply VDD. When the processor MCU detects that the voltage amplitude of the state end A of the digital knob switch DS is VDD through the ADC interface of the processor MCU, the current controlled object is judged to be a loudspeaker.
Thereafter, the user can rotate the digital knob switch DS to adjust the volume of the speaker. When a user rotates the digital knob switch DS, the detection end B of the digital knob switch DS jumps from a high level to a low level at a certain moment, and then sends an interrupt signal to the interrupt signal interface INT of the processor MCU, so that the processor MCU enters an interrupt program. In the interrupt process, the processor MCU continues to monitor the level change of the state terminal a of the digital knob switch DS, and if the potential of the state terminal a changes from low level to high level, it indicates that the digital knob switch DS turns right, and at this time, the processor MCU controls the volume of the speaker to increase through its internal program, as shown in fig. 4; if the potential of the state terminal a changes from high level to low level, it indicates that the digital knob switch DS turns left, and as shown in fig. 5, the processor MCU controls the volume of the speaker to decrease through its internal program, thereby implementing the adjustment of the volume of the speaker.
When the user needs to adjust the screen brightness of the electronic device, the key switch S2 is lifted to cut off the direct power supply from the dc power supply VDD to the digital rotary switch DS, and the dc power supply VDD1 divided by the voltage divider circuit is used to supply power to the digital rotary switch DS. At this time, the processor MCU can accurately determine that the current controlled object to be adjusted has changed into the picture brightness by detecting that the voltage amplitude of the ADC interface changes from VDD to VDD 1.
Then, the user can freely adjust the brightness of the picture displayed on the display screen of the electronic device by rotating the digital knob switch DS. The specific adjusting process is the same as the adjusting process of the speaker volume, and the description of the embodiment is not repeated here.
The circuit building structure shown in fig. 1 is only suitable for the case where there are two controlled objects, and the present embodiment further proposes the circuit design schemes shown in fig. 2 and fig. 3 for electronic devices with more than two controlled objects.
For the case that there are more than two controlled objects, the present embodiment selects a single-pole multi-throw switch S3 as the gating device to perform specific circuit design, and proposes two specific circuit construction schemes:
firstly, referring to fig. 2, the common terminal 1 of the single-pole multi-throw switch S3 is connected to the dc power supply VDD and grounded through the filter capacitor C2 for filtering the interference signal in the dc power supply VDD; connecting one route of a gating end 4 of the single-pole multi-throw switch S3 to a power end VCC of a digital rotary switch DS, wherein a ground end GND of the digital rotary switch DS is connected with a system ground of the PCB; the other pass terminals 3 and 2 of the single-pole multi-throw switch S3 are grounded through a voltage dividing circuit, and each voltage dividing circuit can be formed by connecting two voltage dividing resistors, for example: a voltage division resistor R5 and a voltage division resistor R6 are connected to form a first group of voltage division circuits, the first group of voltage division circuits are connected between the gating end 3 of the single-pole multi-throw switch S3 and the system ground, voltage division nodes of the first group of voltage division circuits are connected with a power supply end VCC of a digital knob switch DS through a backflow prevention diode D2 (or backflow prevention circuits of other built structures), and a second power supply VDD2 is provided for the digital knob switch DS. Similarly, a voltage dividing resistor R3 and a voltage dividing resistor R4 are connected to form a second group of voltage dividing circuit, the second group of voltage dividing circuit is connected between the gating end 2 of the single-pole multi-throw switch S3 and the system ground, and a voltage dividing node of the second group of voltage dividing circuit is connected with a power supply end VCC of the digital knob switch DS through a backflow prevention diode D3 to provide a third power supply VDD3 for the digital knob switch DS. In terms of circuit design, the requirements of providing multiple paths of direct current power supplies with different amplitudes for the digital knob switch DS can be met only by reasonably configuring the resistance values of the two groups of voltage division circuits and enabling the voltage division values output by the two voltage division nodes to be different.
The circuit structure shown in fig. 2 uses the single-pole three-throw switch S3 to cooperate with two-component voltage circuit, so as to provide three power supplies VDD, VDD2 and VDD3 for the digital rotary switch DS, thereby meeting the adjustment requirement for three controlled objects. If the number of the controlled objects is more, taking N controlled objects as an example for description, N power supplies with different amplitudes can be generated by using a single-pole N-throw switch in cooperation with an N-1 group of voltage-dividing circuits, so as to meet the design requirements of the circuits.
And the other is that more than two divider resistors are connected in series to form a divider circuit with a plurality of divider nodes. As shown in fig. 3, a voltage dividing circuit having three voltage dividing nodes formed by connecting four voltage dividing resistors R7-R10 in series is taken as an example for explanation. One end of the voltage division circuit is connected to a direct-current power supply VDD, the other end of the voltage division circuit is grounded, three voltage division nodes are respectively connected with three-way gating ends 2, 3 and 4 of the single-pole multi-throw switch S4 in a one-to-one correspondence mode, and a public end 1 of the single-pole multi-throw switch S4 is connected with a power supply end VCC of the digital knob switch DS. Therefore, when the gating terminals of the single-pole multi-throw switch S4 are selectively switched, the voltage amplitudes of the power supply VDD4, VDD5 or VDD6 output by different voltage division nodes of the voltage division circuit are different, so that the design requirement of providing different power supplies for the digital knob switch DS for identifying the type of the controlled object can be met.
The circuit construction scheme shown in fig. 3 can satisfy the multi-stage adjustment of the parameter value of each controlled object when the number of the controlled objects is three. Certainly, for the case that there are more than three controlled objects, it is only necessary to select more voltage dividing resistors to form the voltage dividing circuit in series, and provide more voltage dividing nodes to be connected with the multi-path gating ends of the single-pole multi-throw switch S4 in a one-to-one correspondence manner, so as to provide more power supplies with different amplitudes for the digital rotary switch DS, so as to meet the identification requirements for more controlled objects, and this embodiment is not limited to the above example.
With reference to fig. 2, the present embodiment will describe in detail the specific operation principle of the digital rotary switch multiplexing device using single-pole multi-throw switch design by taking three controlled objects as an example. Assume that the three controlled objects are speaker volume, headphone volume, and picture brightness, respectively.
When a user needs to adjust the volume of a speaker on the electronic device, the single-pole multi-throw switch S3 is switched to the gating terminal 4, so that the common terminal 1 is connected with the gating terminal 4, and the digital rotary switch DS is directly powered by the direct-current power supply VDD. At this time, the processor MCU detects that the level amplitude of the status terminal a of the digital rotary switch DS is VDD, and thus determines that the controlled object currently required to be adjusted is a speaker. Then, the processor MCU can identify the rotation direction of the digital knob switch DS by detecting the phase change of the state terminal A and the detection terminal B of the digital knob switch DS, and then the volume of the loudspeaker is controlled to be increased or decreased by an internal program.
When a user needs to adjust the volume of a microphone on the electronic device, the single-pole multi-throw switch S3 can be switched to the gate terminal 3, so that the common terminal 1 of the single-pole multi-throw switch S is communicated with the gate terminal 3, and the digital knob switch DS is powered by the dc power supply VDD2 divided by the voltage dividing resistors R5 and R6 and then output. At this time, the processor MCU detects that the level amplitude of the status terminal a of the digital rotary switch DS becomes VDD2, and thus determines that the controlled object currently needing to be adjusted is a microphone. Then, the user can freely adjust the volume of the microphone by rotating the digital knob switch DS.
Similarly, when the user needs to adjust the screen brightness of the electronic device, the user only needs to switch the single-pole multi-throw switch S3 to the gate terminal 2, so that the common terminal 1 is connected to the gate terminal 2, and the digital knob switch DS is powered by the dc power supply VDD3 divided by the voltage dividing resistors R3 and R4 and then output. At this time, the processor MCU can determine that the current controlled object to be adjusted has changed into the screen brightness by detecting the level change (to VDD 3) of the status terminal a of the digital knob switch DS, so as to adjust the screen brightness of the display screen step by step according to the rotation direction of the digital knob switch DS.
For a larger number of controlled objects, the design can be extended in accordance with fig. 2 and the above description, and the embodiment will not be further described herein.
It is to be understood that the above description is not intended to limit the present invention, and the present invention is not limited to the above examples, and those skilled in the art may make modifications, alterations, additions or substitutions within the spirit and scope of the present invention.