About AVref

Hi guys;

I have a little question about AVref. When I have a ATMEGA328P with the Ardiuno bootloader, I know about Vcc, Avcc, GND and AGnd are +5 V and ground. OK I got that. But what about AVref ? Did I ?

  1. Connect to Vcc
  2. Not connected
  3. Connect a 0.1 uF - AVref - GND
  4. A potentiometer. AVref is the wipper of the pot. One end to +5 and the other end gnd.

I did look at the schematic of the UNO, but the schematic did not use a ATmega328P...

Option 4 is what I did on a Freeduino board. And I am award that when I will be using analogRead() and maybe analogWrite(), I have to put analogReference(EXTERNAL); in void setup().

Because of this :

Warning
If you're using an external reference voltage (applied to the AREF pin), you must set the analog reference to EXTERNAL before calling analogRead(). Otherwise, you will short together the active reference voltage (internally generated) and the AREF pin, possibly damaging the microcontroller on your Arduino board.

So what is my option when I breadboard the Atmega/Arduino or I do a PCB for a project ?

And I am sorry the question sound a bit "noob"... The warning worry me ...

I did look at the schematic of the UNO, but the schematic did not use a ATmega328P...

That's strange, I thought all Arduino UNO boards used a ATmega328P controller chip. What chip did your drawing show?

So what is my option when I breadboard the Atmega/Arduino or I do a PCB for a project ?

A lot depends on if and how you plan on using the analog input pins. The default voltage reference for reading analog input pins is for the internal A/D to use whatever voltage is on the Avcc pin as the reference, +5vdc for a UNO. That then allows one to read voltages from 0 to +5vdc on the analog pins. Therefore you can just leave the Aref pin unconnected, or just wire a .1mfd cap from Aref pin to ground to add a little more noise filtering for the internal reference voltage. If you have special and specific requirements for the analog input pins then we can talk about utilizing the Aref pin, but most designs leave it unconnected, including the UNO board.

Lefty

Thanks retrolefty.

Connect a 0.1 uF won't hurt.

My DIY PCB ZIF board, I have to "seperated" the AVcc and AVref. Installing a 0.1 uF would be OK...

I hope ...

In another project, I did not connect the AVref and AVcc together, and I did reserved a capacitor space on my DIY Telephone Counter - CPU board PCB.

IIRC, Vref is internally connected to Vcc when you set the ADC to use Vcc as the reference voltage. If you ever want to use some other reference voltage (including the internal lower-voltage bandgap), you should NOT connnect Vref to the power rail.

@westfw

Thanks for the advise... I just don't want to damage the ATMEGA328P chip.