CN102638267A - System for increasing resolution ratio of A/D (Analog-to-Digital) converter inside AVR (Automatic Voltage Regulator) series single chip microcomputer - Google Patents

System for increasing resolution ratio of A/D (Analog-to-Digital) converter inside AVR (Automatic Voltage Regulator) series single chip microcomputer Download PDF

Info

Publication number
CN102638267A
CN102638267A CN2012101350338A CN201210135033A CN102638267A CN 102638267 A CN102638267 A CN 102638267A CN 2012101350338 A CN2012101350338 A CN 2012101350338A CN 201210135033 A CN201210135033 A CN 201210135033A CN 102638267 A CN102638267 A CN 102638267A
Authority
CN
China
Prior art keywords
chip microcomputer
circuit
regulation resistance
digital regulation
pin
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012101350338A
Other languages
Chinese (zh)
Other versions
CN102638267B (en
Inventor
田文杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Union University
Original Assignee
Beijing Union University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Union University filed Critical Beijing Union University
Priority to CN201210135033.8A priority Critical patent/CN102638267B/en
Publication of CN102638267A publication Critical patent/CN102638267A/en
Application granted granted Critical
Publication of CN102638267B publication Critical patent/CN102638267B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Analogue/Digital Conversion (AREA)

Abstract

The invention provides a system for increasing the resolution ratio of an A/D (Analog-to-Digital) converter inside an AVR (Automatic Voltage Regulator) series single chip microcomputer. The AVR series single chip microcomputer is very powerful in function and is internally provided with a 10-bit A/D converter so as to be basically capable of meeting a certain measurement requirement. However, on certain occasions such as an occasion requiring a high-precision numerical control constant current source, the resolution ratio of an A/D converter with at least 12 bit is required, and generally, the higher the bit of the A/D converter is, the higher the resolution ratio is. In order to ensure that the AVR series single chip microcomputer with the very powerful function meets the requirement for high-precision measurement, the invention provides the system for increasing the resolution ratio of the A/D converter inside the AVR series single chip microcomputer, and thus the resolution ratio of the A/D converter can be set randomly.

Description

A kind of system that improves the inner A/D converter resolution of AVR series monolithic
Technical field
The present invention relates to the singlechip technology field, more specifically, relate to the system of the inner A/D converter resolution of a kind of AVR of raising series monolithic.
Background technology
The structure that the AVR series monolithic is the RISC monolithic .RISC that releases of Atmel company 1997 through making computer advantages of simple more improves arithmetic speed, and RISC preferentially chooses the highest simple instruction of frequency of utilization, avoids complicated order; And the fixed instruction width, reduce the kind of command format and addressing system, thereby shorten the instruction cycle, it is complete to improve speed of service .AVR single-chip microcomputer series, applicable to the requirement of various different occasions.The AVR single-chip microcomputer has absorbed the characteristics of DSP dual bus, adopt the Harvard bus structures, so the program storage of single-chip microcomputer separates with data storage; And can carry out independently addressing to program storage and data storage with identical address. therefore, the single-chip microcomputer of AVR is widely used in computer peripheral, industrial time controlling; Instrument and meter; Communication apparatus, household electrical appliance, every field such as aerospace equipment.
AVR series monolithic function is very powerful, and inside carries 10 analog to digital converters, and it can satisfy certain Testing requirement basically; But; Be combined in the resolution that requires high precision numerical control constant-current source then to require at least 12 A/D analog to digital converters at some, usually, the figure place of analog to digital converter is high more; Resolution is just high more. for the AVR series monolithic that makes that this function is very powerful; Satisfy the requirement of high-acruracy survey again, the invention provides the system that a kind of AVR of raising series monolithic carries analog-to-digital converter resolution, resolution can be set arbitrarily.
In the prior art; The method that improves the resolution of analog to digital converter mainly is to lean on logic to switch the dividing potential drop gear; The shortcoming of this method is that resolution can not be set arbitrarily, and the logic switch speed is slower, therefore can not satisfy the needs of quick measurement. in the exigent occasion of certainty of measurement; If select the A/D chip of seniority top digit, price will significantly improve.
Summary of the invention
AVR series monolithic inside all is to carry 10 A/D converter, but in some occasion, for example high precision numerical control constant-current source then needs at least 12 A/D converter resolution. in these occasions; In order to continue the very powerful AVR series monolithic of function of use, can satisfy the requirement of high-acruracy survey again, a kind of system that improves the inner A/D converter resolution of AVR series monolithic provided by the invention; This system's switch speed is fast; And resolution can set arbitrarily, for example, and when needing 12 A/D converter resolution; Just can in time change the resolution of analog to digital converter through keyboard, convenient and swift.
The present invention provides the system of the inner A/D converter resolution of a kind of AVR of raising series monolithic, it is characterized in that, comprises keyboard circuit, display circuit; Single-chip microcomputer, logical circuit, differential amplifier circuit, first digital regulation resistance; Second digital regulation resistance, the analog switch commutation circuit
Wherein, keyboard circuit is connected with single-chip microcomputer;
Display circuit is connected with single-chip microcomputer;
Logical circuit is connected with single-chip microcomputer, differential amplifier circuit;
The analog switch commutation circuit is connected with differential amplifier circuit, single-chip microcomputer, first digital regulation resistance, second digital regulation resistance;
Differential amplifier circuit is connected with single-chip microcomputer, logical circuit, analog switch commutation circuit, first digital regulation resistance;
First digital regulation resistance is connected with differential amplifier circuit, analog switch commutation circuit, second digital regulation resistance;
Second digital regulation resistance is connected with analog switch commutation circuit, first digital regulation resistance.
Preferably, the common cooperation of said keyboard circuit and said display circuit set resolution.
Preferably, said simulation commutation circuit connects into three and selects one mode.
Preferably, the interrupt routine of said single-chip microcomputer is used for realizing gear switch.
Description of drawings
In order to make the present invention be convenient to understand, combine accompanying drawing to describe specific embodiment of the present invention now.
Fig. 1 is the system principle diagram of a preferred embodiment of the present invention;
Fig. 2 is the circuit system schematic diagram of a preferred embodiment of the present invention;
Fig. 3 is the interrupt service routine of a preferred embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing with preferred embodiment the present invention is described in further detail.
Fig. 1 is the system principle diagram of the inner A/D converter resolution of a kind of AVR of raising series monolithic provided by the invention, and it is made up of keyboard circuit, display circuit, single-chip microcomputer, digital regulation resistance, differential amplifier circuit, analog switch commutation circuit and logical circuit.
Wherein, Need keyboard circuit and display circuit to cooperate the resolution of setting needs, as shown in Figure 1, can set the resolution of analog to digital converter through keyboard circuit; After some resolution setting are good; Realize the logic switching through single-chip microcomputer, differential amplifier circuit, logical circuit, digital regulation resistance and analog switch commutation circuit, last, show operation result through display circuit.
For example; Carry on the basis of 10 A/D translation functions in AVR series monolithic inside; Realize 12 A/D translation functions, set 12 resolution through keyboard circuit, promptly the automatic analog-to-digital converter resolution than 10 has more two; Will reference voltage be divided into 22 powers=4 grade, it is 4 times that the multiplication factor of amplifying circuit requires; If realize 13 A/D translation functions, set 13 resolution through keyboard circuit, promptly the automatic analog-to-digital converter resolution than 10 has more three, will reference voltage be divided into 23 powers=8 grade, and it is 8 times that the multiplication factor of amplifying circuit requires.
By that analogy; As long as the relation that satisfies
Figure 2012101350338100002DEST_PATH_IMAGE001
; Wherein n is the resolution figure place that on the basis of 10 analog to digital converter, will improve; Adjust the dividing potential drop gear of reference voltage through the adjustment digital regulation resistance; The confirming of gear detected and sent single-chip microcomputer to judge by the gear logical circuit, finally adjusted by the Single-chip Controlling digital regulation resistance.
In general, Amplifier Gain sum of errors zero point error is the main source of systematic error.Therefore in order to eliminate systematic error; The invention provides the analog switch commutation circuit; Digital regulation resistance that the present invention adopts has four adjustable resistances; Wherein the analog switch commutation circuit is used an adjustable resistance, and an adjustable resistance is used in the adjustment of dividing potential drop gear, and two adjustable resistances are used in the multiplication factor adjustment of differential amplifier circuit.
Fig. 2 is a circuit system schematic diagram provided by the invention.The model that single-chip microcomputer U2 selects for use is MEGA8, and the AVR series monolithic has a variety of models, among Fig. 2 with MEGA8 as an embodiment; Certainly; Select the single-chip microcomputer of other model of this series to be encompassed in protection scope of the present invention, the model that digital regulation resistance U1 selects is X9241, and the model that analog switch U9 selects is that CD4016. digital regulation resistance U1 adopts two lines to communicate by letter with single-chip microcomputer U2; R6 and R7 are pull-up resistors; There are four adjustable resistances digital regulation resistance U1 inside, and 1 pin of digital regulation resistance U1,2 pin and 3 pin are three pin terminals of first adjustable resistance (being defined as PR1), and wherein 1 pin is the slip pin terminals of adjustable resistance; 6 pin of digital regulation resistance U1,7 pin and 8 pin are three pin terminals of second adjustable resistance (being defined as PR2); Wherein 6 pin are slip pin terminals of adjustable resistance, and 11 pin of digital regulation resistance U1,12 pin and 13 pin are three pin terminals of the 3rd adjustable resistance (being defined as R3), and wherein 13 pin are slip pin terminals of adjustable resistance; 17 pin of digital regulation resistance U1,18 pin and 19 pin are three pin terminals of the 4th adjustable resistance (being defined as R4); Wherein 19 pin are slip pin terminals of adjustable resistance, and 2 pin of digital regulation resistance U1 and 7 pin meet 5 volts of reference power supply VR, 3 pin, 8 pin and 17 pin ground connection.
As shown in Figure 2; 6 pin of digital regulation resistance U1 are connected as the voltage division signal of a 0 ~ 5V of slip pin output and with the anode of operational amplifier U5, and U5 connects into the function of follower, and PR2 and U5 form a voltage divider like this; What gears this voltage divider can be divided into by Single-chip Controlling; 6 pin of digital regulation resistance U1 also connect 1 pin of analog switch U9. wherein, adjustable resistance R2, adjustable resistance R3, resistance R 0, resistance R 4, diode D3 and operational amplifier U6 constitute differential amplifier circuit; Wherein set R2=R3; R0=R4, the multiplication factor of differential amplifier circuit is A=R2/ R0, the multiplication factor of differential amplifier circuit is that the numerical value through Single-chip Controlling R2 and R3 obtains.
Analog switch U9 connects into three and selects one mode; The voltage division signal that three input signals are respectively PR1, voltage division signal and the tested voltage input signal Vi of PR2, analog switch U9 output signal is connected with the anode of operational amplifier U10, and U10 connects into the function of follower; Realize that through SCM program control three select one function; The effect of analog switch U9 is in order to eliminate systematic error, and when single-chip microcomputer was in the measurement state, tested voltage input signal Vi was selected in the output of analog switch U9; Because Amplifier Gain sum of errors zero point error is the main source of systematic error; Therefore, when single-chip microcomputer was in elimination systematic error state, the voltage division signal of PR1 or the voltage division signal of PR2 were selected in the output of analog switch U9.
Next, just concrete elimination systematic error provides theoretical derivation of the present invention.The measure equation of supposing differential amplifier is:
Figure 122723DEST_PATH_IMAGE002
; Wherein, The tested voltage input signal of y; X is the measured value of single-chip microcomputer; K is the difference multiplication factor;
Figure 2012101350338100002DEST_PATH_IMAGE003
is that zero point error has related parameter; Suppose that current gear is the at first voltage division signal
Figure 852913DEST_PATH_IMAGE004
(m gear) of the output selection PR2 of analog switch U9 of m.; The value that single-chip microcomputer obtains is
Figure 2012101350338100002DEST_PATH_IMAGE005
; The voltage division signal (m+1 gear) of PR1 is selected in the output of analog switch U9 then; The value that single-chip microcomputer obtains is
Figure 2012101350338100002DEST_PATH_IMAGE007
; It is following to obtain two equations:
Figure 90176DEST_PATH_IMAGE008
and
Figure 2012101350338100002DEST_PATH_IMAGE009
; Separate these two equations and obtain
Figure 717597DEST_PATH_IMAGE010
and ; Finally obtain
Figure 602377DEST_PATH_IMAGE012
; There are not k and
Figure 869410DEST_PATH_IMAGE003
in this formula, the visible systematic error of having eliminated.
The present invention is in order to realize the switching of gear, and with the output of the positive input termination U10 of differential amplifier circuit, the negative input end of differential amplifier circuit connects the output of U5; The output one tunnel of differential amplifier circuit connects the analog quantity input pin (the 27th pin, not shown) of single-chip microcomputer U2, and another road connects logical circuit; Logical circuit is made up of operational amplifier U3, operational amplifier U4, diode D1, diode D2, diode D3, diode D4, buffer U7 and XOR gate U8; Operational amplifier U3 and operational amplifier U4 connect into the form of voltage comparator, and the function of logical circuit is whether the gear of detection voltage divider is correct, and 18 pin of U7 are connected with 12 pin of single-chip microcomputer U2; 16 pin of U7 are connected with 13 pin of single-chip microcomputer U2; The output of U8 is connected with 14 pin of single-chip microcomputer U2, and 14 pin of single-chip microcomputer U2 are set to rising edge and catch interrupt input signal, when the output Vx of difference amplifying circuit is between 0 ~ 5V; The gear that Vx is described is correct; The output of 18 pin of U7 and 16 pin of U7 is 1, and XOR gate U8 is output as 0, makes the output Vx of differential amplifier circuit < 0 the time when measured signal changes; 18 pin of U7 are output as 1 and 16 pin of U7 are output as 0; XOR gate U8 is output as the rising edge signal produce to interrupt single-chip microcomputer U2, and the PR2 of control figure potentiometer reduces the gear of voltage divider in interrupt routine, makes the output Vx of differential amplifier circuit when measured signal changes>during 5V; 18 pin of U7 are output as 0 and 16 pin of U7 are output as 1; XOR gate U8 is output as the rising edge signal produce to interrupt single-chip microcomputer U2, and the PR1 of the control figure potentiometer gear of voltage divider that raises in interrupt routine utilizes the real-time of singlechip interruption can realize the gear of rapid adjustment voltage divider.
Another preferred embodiment of the present invention is to set the resolution of 13 A/D converter through keyboard circuit and display circuit.At first cooperate and be used for setting 13 resolution through keyboard circuit and display circuit; R2 and R3 that single-chip microcomputer receives this order control figure potentiometer make that the multiplication factor of differential amplifier circuit is 8 times, and the PR1 of control figure potentiometer makes the output of voltage divider be divided into 8 grades then, and adjacent two grades interval voltage is 0.625V; Tested like this input voltage signal is divided into 8 grades; Adjacent two grades interval voltage is 0.625V, if detected input signals is between two grades, then input signal with subtract each other than the low-grade location magnitude of voltage; Its difference is inevitable less than 0.625V; Through differential amplifier circuit this voltage signal is amplified 8 times, make it to become the voltage signal Vx of 0 ~ 5V, give 10 A/D converters in the single-chip microcomputer U2; Merge the transformation result of the residing gear N of input voltage and 10 A/D converters; Just obtain the pairing digital quantity of this input voltage, utilize the additional hardware and the software of single-chip microcomputer to carry out comparing one by one of Senior Three position, thereby the resolution of 10A/D transducer is brought up to 13.For example; Tested input voltage is 2V; The PR1 of digital regulation resistance can only be
Figure 2012101350338100002DEST_PATH_IMAGE013
on third gear; At this moment single-chip microcomputer is adjusted on the third gear through the PR1 of execution gear switch program with digital regulation resistance; This moment differential amplifier circuit output Vx=8* (2-3*0.625)=1V; Result through 10 A/D converter conversions is
Figure 881360DEST_PATH_IMAGE014
; Merging the back result is
Figure 2012101350338100002DEST_PATH_IMAGE015
; When changing, measured signal make the output Vx of differential amplifier circuit < 0 the time; The 18 pin signal YA of U7 are output as 1 and the 16 pin signal YS of U7 are output as 0, and XOR gate U8 is output as the rising edge signal and single-chip microcomputer U2 is produced interrupt, and the PR1 of control figure potentiometer reduces the gear of voltage divider in interrupt routine; Make the output Vx of differential amplifier circuit when measured signal changes>during 5V; The 18 pin signal YA of U7 are output as 0 and the 16 pin signal YS of U7 are output as 1, and XOR gate U8 is output as the rising edge signal and single-chip microcomputer U2 is produced interrupt, the PR1 of the control figure potentiometer gear of voltage divider that raises in interrupt routine; As shown in Figure 3, interrupt routine is realized the gear switch function.
More than combine specific embodiment of the present invention to describe in detail, but be not to be limitation of the present invention.Every foundation technical spirit of the present invention all still belongs to the scope of technical scheme of the present invention to any simple modification that above embodiment did.

Claims (4)

1. a system that improves the inner A/D converter resolution of AVR series monolithic is characterized in that, comprises keyboard circuit, display circuit, and single-chip microcomputer, logical circuit, differential amplifier circuit, first digital regulation resistance, second digital regulation resistance, the analog switch commutation circuit,
Wherein, keyboard circuit is connected with single-chip microcomputer;
Display circuit is connected with single-chip microcomputer;
Logical circuit is connected with single-chip microcomputer, differential amplifier circuit;
The analog switch commutation circuit is connected with differential amplifier circuit, single-chip microcomputer, first digital regulation resistance, second digital regulation resistance;
Differential amplifier circuit is connected with single-chip microcomputer, logical circuit, analog switch commutation circuit, first digital regulation resistance;
First digital regulation resistance is connected with differential amplifier circuit, analog switch commutation circuit, second digital regulation resistance;
Second digital regulation resistance is connected with analog switch commutation circuit, first digital regulation resistance;
Input voltage signal is connected with the analog switch commutation circuit.
2. the system of claim 1 is characterized in that, the common cooperation of said keyboard circuit and said display circuit set resolution.
3. the system of claim 1 is characterized in that, said simulation commutation circuit connects into three and selects one mode.
4. the system of claim 1 is characterized in that, the interrupt routine of said single-chip microcomputer is used for realizing gear switch.
CN201210135033.8A 2012-05-04 2012-05-04 System for increasing resolution ratio of A/D (Analog-to-Digital) converter inside AVR (Automatic Voltage Regulator) series single chip microcomputer Expired - Fee Related CN102638267B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210135033.8A CN102638267B (en) 2012-05-04 2012-05-04 System for increasing resolution ratio of A/D (Analog-to-Digital) converter inside AVR (Automatic Voltage Regulator) series single chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210135033.8A CN102638267B (en) 2012-05-04 2012-05-04 System for increasing resolution ratio of A/D (Analog-to-Digital) converter inside AVR (Automatic Voltage Regulator) series single chip microcomputer

Publications (2)

Publication Number Publication Date
CN102638267A true CN102638267A (en) 2012-08-15
CN102638267B CN102638267B (en) 2014-07-30

Family

ID=46622532

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210135033.8A Expired - Fee Related CN102638267B (en) 2012-05-04 2012-05-04 System for increasing resolution ratio of A/D (Analog-to-Digital) converter inside AVR (Automatic Voltage Regulator) series single chip microcomputer

Country Status (1)

Country Link
CN (1) CN102638267B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106340262A (en) * 2016-11-16 2017-01-18 天津市盛丹电子技术发展有限公司 Multi-purpose digital display circuit

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090091360A1 (en) * 2007-10-09 2009-04-09 Nokia Corporation Delay-locked loop control
CN101866155A (en) * 2010-07-02 2010-10-20 北京联合大学生物化学工程学院 Variable frequency square-wave generator
CN102436772A (en) * 2011-09-07 2012-05-02 北京联合大学 Voltage-frequency converter controlled by single chip computer and experimental box provided with module

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090091360A1 (en) * 2007-10-09 2009-04-09 Nokia Corporation Delay-locked loop control
CN101866155A (en) * 2010-07-02 2010-10-20 北京联合大学生物化学工程学院 Variable frequency square-wave generator
CN102436772A (en) * 2011-09-07 2012-05-02 北京联合大学 Voltage-frequency converter controlled by single chip computer and experimental box provided with module

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106340262A (en) * 2016-11-16 2017-01-18 天津市盛丹电子技术发展有限公司 Multi-purpose digital display circuit

Also Published As

Publication number Publication date
CN102638267B (en) 2014-07-30

Similar Documents

Publication Publication Date Title
CN100583644C (en) Integrating A/D convertion method and its A/D converter
CN103245814A (en) Combined intelligent universal meter
CN204154889U (en) A kind of mutual inductor load box calibrating installation
CN103034273B (en) Numerically-controlled constant current source
CN201233288Y (en) Multipath data acquisition system
CN104460462A (en) Sampling circuit compatible with unipolar and bipolar analog signals
CN207440271U (en) A kind of Multichannel analogue cell device
CN203881815U (en) Simple high-precision DC electronic load
CN102638267B (en) System for increasing resolution ratio of A/D (Analog-to-Digital) converter inside AVR (Automatic Voltage Regulator) series single chip microcomputer
CN202974477U (en) Temperature data acquisition device
CN202119393U (en) Digital display portable testing device of steering engine
CN202004710U (en) Alternating-current servo controller using electronic transmission ratio
CN204731668U (en) A kind of voltage-current converter circuit
CN203550971U (en) Variable constant-current sampling circuit of resistor type sensor
CN201402317Y (en) Verifying unit for resistive current tester of zinc oxide arrester
CN201869253U (en) Mobile phone with function of voltmeter
CN205037900U (en) Solid -state axial angle transmitting system of selsyn
CN101846558A (en) Main board for thermometer and thermocouple precision correcting method
CN203672963U (en) Digital voltmeter based on singlechip
CN204705640U (en) A kind of cement consistency data acquisition system (DAS)
CN203350754U (en) Program control current source
CN201716129U (en) Main board for thermodetector
CN202583932U (en) Numerical control direct current stabilized power supply
CN202939219U (en) Multichannel intelligent electric quantity module
CN106338707A (en) Electric energy meter comprehensive tester

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140730

Termination date: 20160504