# atmega328 pin20

**URL:** <https://forum.arduino.cc/t/atmega328-pin20/215249>\
**Category:** General Electronics\
**Created:** [February 24, 2014, 11:45pm UTC](https://forum.arduino.cc/t/atmega328-pin20/215249 "2014-02-24T23:45:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [February 24, 2014, 11:45pm UTC](https://forum.arduino.cc/t/atmega328-pin20/215249/1 "2014-02-24T23:45:51Z")

</div>

I know Vcc is the voltage. Aref is the analog reference voltage. What is AVcc on pin 20? Is it necessary?

---

<div class="post-metadata">

**Author:** ![MarkT](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@MarkT](https://forum.arduino.cc/u/MarkT)\
**Post date:** [February 24, 2014, 11:50pm UTC](https://forum.arduino.cc/t/atmega328-pin20/215249/2 "2014-02-24T23:50:11Z")

</div>

Analog Vcc.

Its absolutely essential and it must always be within 0.5V of Vcc.

Its provided as a separate pin so you can filter out digital noise from the  
ADC and analog comparator circuitry on the chip. It would normally be  
connected to Vcc via a resistor, RFC or ferrite bead and separately decoupled.

Though not stated anywhere I assume the neighbouring ground pin is the  
analog ground pin in effect. The 328 doesn't recommend separate digital and  
analog grounds though.

Its also not pin 20, its pin "AVcc". Different packages have it numbered  
differently (for instance its pin 18 on the TQFP32 version of the chip.

---

<div class="post-metadata">

**Author:** ![cmiyc](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cmiyc/32/1204108_2.png) [@cmiyc](https://forum.arduino.cc/u/cmiyc)\
**Post date:** [February 25, 2014, 11:48am UTC](https://forum.arduino.cc/t/atmega328-pin20/215249/3 "2014-02-25T11:48:48Z")

</div>

From the ATmega328 datasheet.

Section 1.1.7

> 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.

Section 24.2

> 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 248 on how to connect this pin.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [February 25, 2014, 8:26pm UTC](https://forum.arduino.cc/t/atmega328-pin20/215249/4 "2014-02-25T20:26:50Z")

</div>

How come the ADC works if I don't connect it?

---

<div class="post-metadata">

**Author:** ![CrossRoads](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/crossroads/32/214033_2.png) [@CrossRoads](https://forum.arduino.cc/u/CrossRoads)\
**Post date:** [February 25, 2014, 8:36pm UTC](https://forum.arduino.cc/t/atmega328-pin20/215249/5 "2014-02-25T20:36:48Z")

</div>

You have internal leakage current thru input clamp protection diodes. Too much current, and the diodes blow.  
Connect AVcc to +5, and add a 0.1uF cap from the pin to Gnd.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [February 25, 2014, 8:49pm UTC](https://forum.arduino.cc/t/atmega328-pin20/215249/6 "2014-02-25T20:49:32Z")

</div>

thanks

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 1:30am UTC](https://forum.arduino.cc/t/atmega328-pin20/215249/7 "2021-05-06T01:30:09Z")

</div>

Closed on May 6, 2021, 1:30am UTC


