ADC input question

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If I am sampling from a device on a 3.3V bus, using an atmega164 processor, is it better to apply 3.3V to AREF? or use an opamp to bring the analog signal to 5V levels?

The device providing the analog signal is an analog mems accellerometer.

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What Vcc is your AVR running at?

If the device is a 3V device, then we usually run a 3V AVR to avoid level-shifting and multiple power supply levels whenever practical.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The device is currently on a old board I built some time ago and is 5V powered, I am going to build a small PCB to mount the sensor on, which will have its own power supply.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ATmega164P

from the datasheet

Voltage on any Pin except RESET
with respect to Ground ................................-0.5V to VCC+0.5V

If you are dealing with a 5V analog signal, just use a resistor divider.

If you ar dealing with anything less than 3.3 V, use an amplifier to utilize the entire scale otherwise put signal directly into uC.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

If you ar dealing with anything less than 3.3 V, use an amplifier to utilize the entire scale otherwise put signal directly into uC.

Now that doesn't quite make sense. Yes, one often wants to amplify and/or filter low-level signals. And one of the reasons would be to use the full scale of the AVR's A/D for, say, a millivolt signal.

One could use the '164's internal reference, for example, after calibration and >>reduction<< of the signal to stay within 2.5V or 1.1V. One could inject an external reference signal. Without looking at the part in question a logical choice is the Vcc or Vref that the part uses. One could use AVcc and live with the 3/5 of scale. One could be clever and use one or more differential pairs and expand the signal range that way. Summary: One size does not fit all as your statement implied.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Thu. Oct 18, 2007 - 09:24 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The ADC is 10 bit, 1024 potential values, does that scale to AREF? ie: will I lose accuracy if the signal is not 0-5V?

sorry if these are dumb questions, its the first time I have used analog signals in this way

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, the ADC scales to Aref. Just do not apply anything higher than Vcc + 0.5 to Aref.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
The ADC is 10 bit, 1024 potential values, does that scale to AREF? ie: will I lose accuracy if the signal is not 0-5V?

Accuracy of the ADC will not be influenced by the input signal.
But you can don´t use the full ADC input range.
AT 5V Ref and max. 3.3V Vin you only use 676 (out of 1024) steps.

Klaus
********************************
Look at: www.megausb.de (German)
********************************

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So the 10 bit range is always from 0v-Vcc?

What is the purpose of utilizing an external voltage applied to Aref then? just for scaling of the value ie: max value at 3.3v, but only 676 steps between min and max instead of 1024?

If so then is it better to use an external opamp and obtain the full range of steps?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

So the 10 bit range is always from 0v-Vcc?

What did dilk answer?
Quote:

Yes, the ADC scales to Aref.

What does the datasheet say:

Quote:
For single ended conversion, the result is ADC = Vin * 1024 / Vref
where VIN is the voltage on the selected input pin and VREF the selected voltage reference

Always? Yes, for single-ended conversions.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 10 bit range is 0V to VRef as dilk already said.

So what is your configuration?
VCC (=AVCC) of the AVR:
VREF of the AVR:
Max output swing of your sensor:

Some info for the AVR:
* AGND = GND
* AVCC = VCC (decoupled with RC or LC)
* VREF(max) = AVCC
* VREF(min) = GND (not to destroy the AVR)
* VREF(min) = 1.1V (to get good conversion results)
* AnalogIn(max) = AVCC (to not destroy the AVR)
* AnalogIn(max) = VREF (to use the full ADC range)

Do you have the datasheet by hand? It´s all written in there. We know it from there.

Klaus
********************************
Look at: www.megausb.de (German)
********************************

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have looked at the datasheet, and was looking for some additional information to clear up my personal mental blockage....

I appologize if i'm asking the same thing repeatedly, but I think I understand now.

thanks