[quote:5a1ead13f4="hgrueneis"]When you give advice for something, maybe you should read the datasheet.
Here is your opportunity to do so.
QUOTE from the datasheet:
'The ADC has a separate analog supply voltage pin, AVCC. AVCC must not differ more
than ± 0.3V from VCC. See the paragraph ADC Noise Canceler on page 198 on how to
connect this pin.
Internal reference voltages of nominally 2.56V or AVCC are provided On-chip. The voltage
reference may be externally decoupled at the AREF pin by a capacitor for better
noise performance.'
Therefore AREF should only be connected to a capacitor (as with most AVRs) if the reference should be the same as supply.
If it is connected to the supply, it might kill the chip or the reference.
Just my opinion.
This has been discussed several times before.
(and I am probably not as rude as some others in this forum)
Maybe I should appologise in advance!?
Sorry for the commented correction and nobody even stole copper this time.
Have a great week!
Hubert[/quote:5a1ead13f4]
I'm somewhat reluctant to do this, but here we go...
Hubert, what is wrong with the advice given by either AdrianJ or Paulvk?
It is acceptable to connect AREF to an external reference, which could be AVCC (which as stated above must not vary more than +/- 0.3V from VCC). This is stated in the datasheet:
"ADC Voltage
Reference
The reference voltage for the ADC (VREF) indicates the conversion range for the ADC. Single
ended channels that exceed VREF will result in codes close to 0x3FF. VREF can be selected as
either AVCC, internal 2.56V reference, or external AREF pin.
AVCC is connected to the ADC through a passive switch. The internal 2.56V reference is generated
from the internal bandgap reference (VBG) through an internal amplifier. In either case, the
external AREF pin is directly connected to the ADC, and the reference voltage can be made
more immune to noise by connecting a capacitor between the AREF pin and ground. VREF can
also be measured at the AREF pin with a high impedant voltmeter. Note that VREF is a high
impedant source, and only a capacitive load should be connected in a system.
If the user has a fixed voltage source connected to the AREF pin, the user may not use the other
reference voltage options in the application, as they will be shorted to the external voltage. If no
external voltage is applied to the AREF pin, the user may switch between AVCC and 2.56V as
reference selection. The first ADC conversion result after switching reference voltage source
may be inaccurate, and the user is advised to discard this result."
Connecting AREF to AVCC raises to points:
1. You need to make sure that the reference option is set to external, otherwise there exists a possibility of damage.
2. Why bother when you could leave AREF unconnected and set the option to either the internal 2.56V ref or the internal AVCC passive switch.
So while it makes little sense to connect the AREF pin to the AVCC pin it is not necessarily wrong or going to do any damage.
To answer to OP the best thing to do is:
1. Connect AVCC to VCC, as noted by AdrainJ this maybe necessary if PORTC is used for digital output(some pins use digital power).
2. Leave AREF unconnected(easiest) and set the ADC reference to either AVCC or internal 2.56V so that it is not left 'floating'. Since the ADC is not being used there is no need to attach a capacitor.
↧