Summary of the invention
The purpose of this invention is to provide a kind of can either reducing cost, can improve analog-to-digital conversion (A/D) circuit of analog-to-digital conversion (A/D) precision again.
Technical scheme of the present invention is: a kind of analog to digital conversion circuit, comprise the analog voltage input mouth, the control sample circuit, it is characterized in that between analog voltage input mouth and control sample circuit, having increased by integrating circuit, the closed feedback loop that Schmidt's comparison circuit and a reference source generation circuit are formed, specifically, the analog voltage input mouth links to each other with integrating circuit, integrating circuit links to each other with Schmidt's comparison circuit, the output of Schmidt's comparison circuit links to each other with the control sample circuit, and a reference source generation circuit connects the output of analog voltage input mouth and Schmidt's comparison circuit.
Described integrating circuit is made up of U2, capacitor C 1 and resistance R 4, U2 is general amplifier integrated circuit, the pin 3 of U2 meets the input resistance R5 of analog voltage input mouth, capacitor C 1 connects pin two and the pin 6 of U2, the pin 6 of U2 connects pin two and the pin 6 of Schmidt's comparison circuit U1 simultaneously, one end of resistance R 4 links to each other with capacitor C 1, the other end is connected between the resistance R 2 and R1 of a reference source generation circuit, the pin 4 of U2 connects power supply VSS end, link to each other with the control sample circuit simultaneously, the pin 7 of U2 connects the power supply vdd terminal, the pin one of U2,5,8 vacant;
Schmidt's comparison circuit is made up of U1, C2, C3 and R6, U1 is CMOS output, two groups of timers, the pin one of U1 is connected with the control sample circuit, connect the power supply vdd terminal by resistance R 6 simultaneously, the pin 3 of U1 links to each other by the VSS end of capacitor C 2 and power supply, the pin 7 of U1 links to each other with the VSS of power supply end, the pin one 1 of U1 links to each other by the VSS end of capacitor C 3 and power supply, the pin 5,8,12 of U1 is connected, the pin 9 of U1 links to each other with the resistance R 2 of a reference source generation circuit, and the pin 4,10 of U1 links to each other with the vdd terminal of power supply with 14 simultaneously, and the pin one 3 of U1 is vacant;
A reference source generation circuit is made up of R1, R2 and R3, a termination reference power supply VR of resistance R 1, and other end connecting resistance R2, a termination power vdd terminal of resistance R 3, the other end is connected between resistance R 1 and the R2.
Operation principle of the present invention is: behind the treated analog quantity changing voltage, import from the analog voltage input mouth, with the feedback a reference source acting in conjunction in integrating circuit, after integrating circuit is handled, enter Schmidt's comparison circuit and reference voltage and compare output, generation a reference source is switched, feed back to integrating circuit through a reference source generation circuit, export the proportional square-wave pulse of a duty ratio and input voltage simultaneously, after the control sample circuit is handled, the numerical value value of output voltage, thus analog-to-digital conversion finished.
Effect of the present invention is: because this analog-to-digital conversion (A/D), between aanalogvoltage input end mouth and control sample circuit, increase the closed feedback loop of forming by integrating circuit, Schmidt's comparison circuit and a reference source generation circuit, therefore can utilize common components and parts to realize the analog-to-digital conversion (A/D) of degree of precision.
Embodiment
Among Fig. 1, analog-to-digital conversion (A/D) circuit, comprise the analog voltage input mouth, control sample circuit A4, it is characterized in that between analog voltage input mouth and control sample circuit A4, having increased by integrating circuit A1, the closed feedback loop that Schmidt's comparison circuit A2 and a reference source generation circuit A3 form, specifically, the analog voltage input mouth links to each other with integrating circuit A1, integrating circuit A1 links to each other with Schmidt's comparison circuit A2, the output of Schmidt's comparison circuit A2 links to each other with control sample circuit A4, and a reference source generation circuit A3 connects the output of analog voltage input mouth and Schmidt's comparison circuit A2.
Among Fig. 2, the analog voltage input mouth comprises VI+, VI-two interfaces, and VI+ is connected with the pin 3 of integrating circuit U2 by resistance R 5, and VI-is a voltage reference points.
Integrating circuit is made up of U2, capacitor C 1 and resistance R 4, U2 is general amplifier integrated circuit, its model is OP07, the pin 3 of U2 meets the input resistance R5 of analog voltage input mouth, capacitor C 1 connects pin two and the pin 6 of U2, the pin 6 of U2 connects pin two and the pin 6 of Schmidt's comparison circuit U1 simultaneously, one end of resistance R 4 links to each other with capacitor C 1, the other end is connected between the resistance R 2 and R1 of a reference source generation circuit, the pin 4 of U2 connects power supply VSS end, simultaneously and control sample circuit and link to each other, the pin 7 of U2 connects the power supply vdd terminal, the pin one of U2,5,8 vacant;
Schmidt's comparison circuit is by U1, C2, C3 and R6 form, U1 is CMOS output, two groups of timers, its model is TLC556, the pin one of U1 is connected with the control sample circuit, connect the power supply vdd terminal by resistance R 6 simultaneously, the pin 3 of U1 links to each other by the VSS end of capacitor C 2 and power supply, the pin 7 of U1 links to each other with the VSS of power supply end, the pin one 1 of U1 links to each other the pin 5 of U1 by the VSS end of capacitor C 3 and power supply, 8,12 are connected, and the pin 9 of U1 links to each other with the resistance R 2 of a reference source generation circuit, the pin 4 of U1,10 link to each other with the vdd terminal of power supply simultaneously with 14, and the pin one 3 of U1 is vacant;
A reference source generation circuit is made up of R1, R2 and R3, and resistance R 1, R2 and R3 are 0.5% precision resistance for precision, one termination reference power supply VR of resistance R 1, other end connecting resistance R2, a termination power vdd terminal of resistance R 3, the other end is connected between resistance R 1 and the R2.
The control sample circuit comprises the buffer circuit of being made up of U3, U4 and controls sample circuit by CPU and form.Wherein, U3 is the high-speed light lotus root of band control, model is 6N137, U4 is 1/4 XOR gate, model is 74HC86, and the pin 3 of U3 connects power supply VSS end by resistance R 7, and the pin two of U3 connects the pin one of U1, U3 pin 5 ground connection DGND, the pin 6 of U3 connects the pin one of U4, and the pin 7 of U3 connects the CONTRAL port of CPU, and the pin 8 of U3 connects power supply VCC end, the pin one of resistance R 8 one termination U4, another termination power VCC end, the CONTRAL port of resistance R 9 one termination CPU, another termination power VCC end, the pin two of U4 is connected with the SIGN-CTR port of CPU, and the pin 3 of U4 is the PWM output.
The course of work of the present invention is: signal after the circuit conversion, is exported a duty ratio and input signal linear square-wave signal by U4 by VI+, VI-input, to the square wave duty ratio measuring, can obtain the exact value of input signal by CPU.
During the Q of U1 (U1-9) end output high level, Vr is positive a reference source Vr+, and during output low level, Vr is negative reference power supply Vr-, and by VI+, VI-input, the signal Vi after the conversion satisfies: Vr-<Vi<Vr+ after the conversion of input signal process.
Therefore, when the Q of U1 end output high level, Vr=Vr+, then this moment, integrator U2 gave capacitor C 1 charging, and voltage Vo is raise, when being increased to Schmidt's comparator U1, goes up in limited time Vo, the Q end output step-down of U1 makes Vr=Vr-, at this moment, capacitor C 1 discharge, Vo is reduced, prescribe a time limit when Vo reduces under Schmidt's comparator, the Q end output of U1 uprises, make capacitor C 1 charging again, so U1 output U1-1 pin produces periodic pulse signal, establishing positive pulse width is T1, and negative pulse width is T2, according to charge balance concept, the charge/discharge electricity amount of electric capacity equates promptly:
Ri is capacitor C 1 a charge-discharge circuit resistance value in the formula, and then duty of ratio is
Because the resistance of R1, R2 and R3 determines that Vr+, Vr-also are a determined value, therefore can calculate input value Vi by measuring duty ratio.
CPU can be collected the high-low level time of square wave by pin PWM, thereby calculate the duty ratio of square wave by the control to port SIGN-CTR, CONTRAL, draws the Vi value.
Adopt foregoing circuit to carry out analog-to-digital conversion (A/D), can reach 2/1000ths precision.