1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Avr A/d

Discussion in 'AVR' started by lord loh., Aug 15, 2006.

  1. lord loh.

    lord loh. Member

    Joined:
    Jan 7, 2005
    Messages:
    634
    Likes:
    0
    Location:
    Lubbock, TX
    I am new to AVR and would like to use the AVR's ADc fecility. I am using the ATmega8535.

    I do not follow the AVcc and AREF concepts.

    The AVcc seems to be just as a feature to provide a seperate supply for the ADC. Altough, the ADC also requires 5V. The same as the AVR. So it is alright if I connect the AVcc to the Vcc and decouple it to the GND?

    The Aref seems the ADC reference voltage. The datasheet mentions that there is an internal reference voltage of 2.56v. So If I do not bother with the Vref, is it okay? Should I decouple it to the ground?

    I need to measure the temperature using an LM35 sensor. I am supplying the LM35 with 5v as well... So my output voltage can be around from -1v to 5v according to the datasheet of LM35. So I guess my Aref should be +5v and I cannot simply decouple it to the ground and forget all about it.
    Am I correct?


    I was also wondering what values shall I obtain the ADC registers if
    • Analog voltage is below GND?
    • Analog voltage is above Aref?
     
  2. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,203
    Likes:
    640
    Location:
    Derbyshire, UK
    I've never used an AVR, but it's generally HIGHLY recommended that you design your circuit so neither of those two can ever happen!.
     
  3. hjames

    hjames New Member

    Joined:
    Jun 7, 2006
    Messages:
    677
    Likes:
    6
    Location:
    Bezerkeley, USA
    AVCC is internally isolated from the VCC terminal, and needs to be within a diode drop of it. The idea is to isolate it from the main logic power supply, and decouple it to the local analog ground. The usual point is to make sure the analog ground plane is tied to the logic ground plane to prevent current loops from the logic. But if you want to connect it directly, go right ahead.

    AREF needs to be decoupled to ground - one of the ADC settings is to enable the 2.5V "reference" and put it on the AREF pin, but it still needs some capacitance. (BTW, check the specs of the "reference" and make sure it is tight enough - many people laugh when they see its "specs").

    Nigel's right - If you have a negative power supply, then you'll need to figure out how to push it above ground - just put a (biased) diode in series with the LM35's ground pin. This will let you see "-.6V" worth of signal, at the expense of the upper side of the rail.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. lord loh.

    lord loh. Member

    Joined:
    Jan 7, 2005
    Messages:
    634
    Likes:
    0
    Location:
    Lubbock, TX

    Pin 11 and pin 31 are ground in ATmega 8535...

    Which is the analog ground?
     
  6. hjames

    hjames New Member

    Joined:
    Jun 7, 2006
    Messages:
    677
    Likes:
    6
    Location:
    Bezerkeley, USA
    There is no dedicated analog ground connection on the AVR. Just make sure all the analog circuit is grounded to a single point near the AVR, and give the AVR a nice solid ground plane.
     

Share This Page