go_away

Author Topic: AVR AREF pin and AVCC pin  (Read 23028 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
AVR AREF pin and AVCC pin
« on: February 17, 2007, 02:27:14 PM »
whats the worst that could happen if i ignore the AREF and AVCC pins on an AVR microcontroller?

its occured to me that many people dont use them, and im not entirely sure what these pins do . . .

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: AVR AREF pin and AVCC pin
« Reply #1 on: February 17, 2007, 05:16:39 PM »
From the Data Sheet:

AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter. Note that PC6..4 use digital supply voltage, VCC.

AREF is the analog reference pin for the A/D Converter.

If you're not using the A/D, you don't need to connect AREF.

- Jon

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: AVR AREF pin and AVCC pin
« Reply #2 on: February 17, 2007, 06:19:20 PM »
yea, I plan to use ADC.

so a low-pass filter . . . ive seen inductors used in series between VCC and AVCC, but i dont have any on me. anyway i can use a capacitor? suggested value? my guess is that a ~10uF cap between AVCC and GND would work, right?

so what does AREF do, exactly? where does it connect? what does it actually reference? :P

(blaaaaaah im still a noob to AVR, obviously)

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: AVR AREF pin and AVCC pin
« Reply #3 on: February 17, 2007, 08:04:02 PM »
You and me both, Admin. I just got my first AVR programmed last night.

A low pass filter in this case is basically a 0.1 uF cap between AVcc and ground, as close to the pins as you can make it.

It doesn't hurt to put a 0.1 uF cap in between AREF and ground as well. In my design I tied AREF to Vcc, although I don't think that is strictly necessary, because I suspect you can use AVcc internally.

The point behind having something like AREF is so you can feed it an input from a super-stable voltage source, and it will scale the A/D inputs from ground up to AREF with the full 10 bits of precision. Of course, you need to make sure none of your analog inputs go over AREF if you are using it like that.

- Jon

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: AVR AREF pin and AVCC pin
« Reply #4 on: February 17, 2007, 08:32:47 PM »
I will paraphrase you on this for the next tutorial :P

I suspect that the low pass filter isnt necessary if I just want to measure photoresistors on the ADC, but I can see it as necessary for other more sensitive sensors like IR detectors.

Ive always added a low pass filter cap between power and ground on all my microcontrollers before, knowing that it is good practice but not entirely understanding why. Interesting how AVR specifically requires it . . .

 


Get Your Ad Here