Maker Pro
Maker Pro

Atmega16 adc question

M

Mark

I want to use a precision 5 volt reference as Vref for the adc on an
Atmega16. My problem is that the Vcc uses a common 78L05 regulator, whose
output can range from 4.75 to 5.25 volts. Can I tie the AVCC to the 5 volt
reference instead of Vcc? Will I get accurate adc readings if Vcc is say 4.8
volts while AVCC is 5.00 volts? Thanks for any advice.

Mark
 
S

Sander Kool

Mark said:
I want to use a precision 5 volt reference as Vref for the adc on an
Atmega16. My problem is that the Vcc uses a common 78L05 regulator, whose
output can range from 4.75 to 5.25 volts. Can I tie the AVCC to the 5 volt
reference instead of Vcc? Will I get accurate adc readings if Vcc is say 4.8
volts while AVCC is 5.00 volts? Thanks for any advice.

This is a very legal question. Of course, Atmel does not specify the maximum
voltage between AVCC and VCC. One would expect it to be around 0,5V
to avoid NP conduction.

An alternative may be to reference Vcc from your AVcc, using a series diode
with your reference, and an emittor follower transistor as buffer.
If you prefer using a regulator IC (lower output impedance than the emittor
follower)
you can use a LM337 (1.25V step) and reference it to your AVcc with a
resistive divider.

Success
Sander
 
A

Adrian Jansen

Mark said:
I want to use a precision 5 volt reference as Vref for the adc on an
Atmega16. My problem is that the Vcc uses a common 78L05 regulator, whose
output can range from 4.75 to 5.25 volts. Can I tie the AVCC to the 5 volt
reference instead of Vcc? Will I get accurate adc readings if Vcc is say 4.8
volts while AVCC is 5.00 volts? Thanks for any advice.

Mark
The AtMega16L specs say AVcc must be within +/- 0.3 volts of digital
Vcc. So you are just within spec at +/- 0.25 volts range. Therefore it
should be ok. Personally I would use a closer tolerance device than the
78L05. My current favourite is the LP2951.

Note also that if you go the other way, and elect to tie AVcc to Vcc,
then Vref *cannot* exceed Vcc.

--
Regards,

Adrian Jansen adrianjansen at internode dot on dot net
Design Engineer J & K Micro Systems
Microcomputer solutions for industrial control
Note reply address is invalid, convert address above to machine form.
 
R

Rich Webb

I want to use a precision 5 volt reference as Vref for the adc on an
Atmega16. My problem is that the Vcc uses a common 78L05 regulator, whose
output can range from 4.75 to 5.25 volts. Can I tie the AVCC to the 5 volt
reference instead of Vcc? Will I get accurate adc readings if Vcc is say 4.8
volts while AVCC is 5.00 volts? Thanks for any advice.

Check the datasheet. AVcc limits: (Vcc - 0.3, Vcc + 0.3) and (2.7, 5.5).
ARef limits: (2.0, AVcc) single-ended, (2.0, AVcc - 0.2) differential.
A 5 V AVcc looks OK to me.

On the mega16, you can program the ADMUX register to connect AVcc to
ARef internally, in which case a capacitor can be hung off of ARef to
soak up noise.

The successive approximation DAC only cares about its voltage reference,
not the chip's Vcc, so as long as none of the recommended limits are
exceeded and the precision voltage reference can source enough current,
you should be OK.
 
R

Roger Lascelles

Check the datasheet. AVcc limits: (Vcc - 0.3, Vcc + 0.3) and (2.7, 5.5).
ARef limits: (2.0, AVcc) single-ended, (2.0, AVcc - 0.2) differential.
A 5 V AVcc looks OK to me.

On the mega16, you can program the ADMUX register to connect AVcc to
ARef internally, in which case a capacitor can be hung off of ARef to
soak up noise.

The successive approximation DAC only cares about its voltage reference,
not the chip's Vcc, so as long as none of the recommended limits are
exceeded and the precision voltage reference can source enough current,
you should be OK.

Perhaps you can use the internal reference if you divide down the voltages
to be measured - however, full scale will be equal to Vint, about 2.56
volts, not AVcc.

Actually, the LM78L05 drift is smaller than some regulators, and may be
acceptable for your application - (check datasheet) - the issue is you can't
predict the voltage of an individual device. In that case, you can put a
calibration factor in EE memory and multiply your ADC reading by that.
You'll probably need calibration anyway.

Roger
 
R

Rich Webb

Perhaps you can use the internal reference if you divide down the voltages
to be measured - however, full scale will be equal to Vint, about 2.56
volts, not AVcc.

Although the AVR chips are broadly similar, there are differences in the
details. On the mega16, the bits REFS1 and REFS0 in the ADMUX register
control what voltage is used as the ADC reference.

REFS1 controls a mux that selects between AVcc and the 2.56 V bandgap
reference. REFS0 controls a gate that connects the output of the mux to
the approximation DAC.

If ADMUX is written with 01xx_xxxx then AVcc will be used.

See Figure 98 and Table 83.
 
M

Mark

Thanks for all the info and help. I think I have a handle on it now.
 
Top