1. Technical Field
The present disclosure relates to a voltage adjustment circuit.
2. Description of Related Art
Many electronic devices, such as computers, need be tested after being manufactured. For testing the electronic device, different voltages, such as 5 volts, 5.5 volts, and 4.5 volts, are supplied for the electronic device. Different power supplies are needed to provide different operating voltages. Thus, it is complicated and costly.
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 present embodiments. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
The disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. 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 programmable resistor 18 is connected to a first power supply 100, to receive a first voltage. The programmable resistor 18 is further connected to the electronic device 1, for outputting a second voltage to the electronic device 1.
The keyboard 16 and the programmable resistor 18 are connected to the MCU 12. The keyboard 16 is used to set a preset voltage. The MCU 12 adjusts a resistance of the programmable resistor 18 according to the preset voltage set through the keyboard 16, such that the programmable resistor 18 outputs the second voltage.
The programmable resistor 18 is further connected to the ADC 10, to output the second voltage to the ADC 10. The ADC 10 converts the second voltage to a corresponding digital signal, and transmits the digital signal to the MCU 12. The MCU 12 is further connected to the display unit 15. The display unit 15 displays the second voltage.
The MCU 12 further compares the second voltage received from the programmable resistor 18 with the preset voltage set through the keyboard 16 to determine whether the preset voltage is the same as the second voltage. If the two voltages are different, the MCU 12 adjusts the resistance of the programmable resistor 18 according to the difference to make the second voltage output from the programmable resistor 18 the same as the preset voltage.
A reset pin MCLR of the MCU 12 is connected to the second power supply P5V through a resistor R1, and is grounded through a capacitor C2. The second power supply P5V is further grounded through a capacitor C3. A first group of digital input and output (I/O) pins RA0-RA5 are idle. A ground reference pin Vss is grounded. Two clock input pins OSC1 and OSC2 are connected to two corresponding terminals of a crystal oscillator X1. The two terminals of the crystal oscillator X1 are grounded through corresponding capacitors C4 and C5. A second group of digital I/O pins of the MCU 12 includes first to eighth pins RC0-RC7. The first pin RC0 of the second group of digital I/O pins is connected to the clock pin SCL of the ADC 10. The second pin RC1 of the second group of digital I/O pins is connected to the three-state digital output pin SDO of the ADC 10. The third pin RC2 of the second group of digital I/O pins is connected to the active low digital input pin CS of the ADC 10. The fourth and fifth pins RC3 and RC4 of the second group of digital I/O pins are respectively connected to a clock pin CLK and a data pin D1 of the display unit 15. A ground pin GND of the display unit 15 is grounded. A power pin VCC of the display unit 15 is connected to a third power supply.
The sixth to eighth pins RC5, RC6, and RC7 of the second group of digital I/O pins are connected to the programmable resistor 18. A ground pin GND is grounded. A power pin VDD is connected to the second power supply P5V. A third group of digital I/O pins include first to eighth pins RB0-RB7 connected to the keyboard 16. The crystal oscillator X1 provides a working clock for the MCU 12. The second power supply P5V supplies power to the MCU 12.
The programmable resistor 18 is a chip U9. An increment control pin INC is connected to the seventh pin RC6 of the second group of digital I/O pins of the MCU 12. An up and down control pin U/D is connected to the sixth pin RC5 of the second group of digital I/O pins of the MCU 12. A potentiometer high terminal pin Rh is idle. A ground pin GND is grounded. A potentiometer wiper terminal pin Rw is connected to the first power supply 100. A potentiometer low terminal pin RL is connected to the analog input pin Vin of the ADC 10, and connected to the electronic device 1. A chip select pin CS is connected to the eighth pin RC7 of the second group of digital I/O pins of the MCU 12. A power pin VCC is connected to the second power supply P5V, and is grounded through a capacitor C6. The second power supply P5V supplies power to the programmable resistor 18.
The keyboard 16 includes twenty switches SW1 to SW20. First terminals of the switches SW1 to SW4 are connected to the fifth pin RB4 of the third group of digital I/O pins of the MCU 12. First terminals of the switches SW5 to SW8 are connected to the sixth pin RB5 of the third group of digital I/O pins of the MCU 12. First terminals of the switches SW9 to SW12 are connected to the seventh pin RB6 of the third group of digital I/O pins of the MCU 12. First terminals of the switches SW13 to SW16 are connected to the eighth pin RB7 of the third group of digital I/O pins of the MCU 12. First terminals of the switches SW17 to SW20 are connected to the fourth pin RB3 of the third group of digital I/O pins of the MCU 12. Second terminals of the switches SW1, SW5, SW9, SW13, and SW17 are connected to the first pin RB0 of the third group of digital I/O pins of the MCU 12. Second terminals of the switches SW2, SW6, SW10, SW14, and SW18 are connected to the second pin RB1 of the third group of digital I/O pins of the MCU 12. Second terminals of the switches SW3, SW7, SW11, SW15, and SW19 are connected to the third pin RB2 of the third group of digital I/O pins of the MCU 12. Second terminals of the switches SW4, SW8, SW12, SW16, and SW20 are connected to the fourth pin RB3 of the third group of digital I/O pins of the MCU 12.
In the embodiment, the first voltage from the first power supply 100 is 3 volts, namely the potentiometer wiper terminal pin Rw of the programmable resistor 18 receives the 3 volts, the potentiometer low terminal pin RL of the programmable resistor 18 outputs a 3.5 volts according to the parameter of the programmable resistor 18. The ADC 10 converts the 3.5 volts to a digital signal and transmits the digital signal to the MCU 12. The display unit 15 displays the digital signal to show that the programmable resistor 18 outputs the 3.5 volts.
When the voltage supplied to the electronic device 1 needs to be adjusted, operators set a preset voltage, such as 3.15 volts through the keyboard 16. The MCU 12 adjusts the resistance of the programmable resistor 18 accordingly. In the embodiment, the keyboard 16 is a matrix keyboard circuit which includes four rows and five lines. The MCU 12 detects the statuses of the twenty switches SW1-SW20 to determine which switch is turned on, and executes programs stored in the MCU 12 according to the adjusted resistance of the programmable resistor 18.
After the resistance of the programmable resistor 18 has been adjusted, the sixth pin RL of the programmable resistor 18 outputs the second voltage. The ADC 10 converts the second voltage to a digital signal and transmits the digital signal to the display unit 16. The display unit 16 displays the second voltage. In addition, the MCU 12 compares the second voltage with the preset voltage. If the second voltage is different from the preset voltage, the MCU 12 adjusts the resistance of the programmable resistor 18 according to the difference between the second voltage and the preset voltage to make the second voltage output from the programmable resistor 18 the same as the preset voltage.
The foregoing description of the exemplary embodiments of the disclosure has been presented only for the purposes of illustration and description and is not intended to be exhaustive or to limit the disclosure to the precise forms disclosed. Many modifications and variations are possible. The embodiments were chosen and described in order to explain the principles of the disclosure and their practical application so as to enable others of ordinary skill in the art to utilize the disclosure and various embodiments and with such modifications as are suited to the particular use contemplated. Alternative embodiments will become apparent to those of ordinary skills in the art to which the present disclosure pertains without departing from its spirit and scope. Accordingly, the scope of the present disclosure is defined by the appended claims rather than by the foregoing description and the exemplary embodiments described therein.
| Number | Date | Country | Kind |
|---|---|---|---|
| 201110373420.0 | Nov 2011 | CN | national |