I am working on an application using ATmega328p atmel microcontroller. I started with the 28 PDIP version, but now I want to use the 32 TQFP, which I noticed has 2 extra inputs after compiling my Altium project.

These inputs are ADC7:6 which "serve as analog inputs to the A/D converter. These pins are powered from the analog supply and serve as 10-bit ADC channels," according to the datasheet.

I have read online that some people have got unknown results when they use the ADC and have floating inputs. What I read they've done is activate pull-down resistors, but I do not see how to configure them (since they do not belong to an I/O port). Also, my application does not even use the A/D converter at all.

What are the best practices? Should I connect an external pull-down resistor? Ignore Altium error?


2 Answers 2


ADC6 and ADC7 are a special case. They do not have any digital input or output buffers connected to them, so they will not create noise or draw excess current like the other pins on the chip might if not handed appropriately. In other words, you can leave them floating and they shouldn't abnormally affect your design.

They also do not have any internal pull ups or pull downs, so if you do plan to tie them up or down, you will have to do so externally.

Since they can never be outputs, though, there is no additional safety or protection in using a resister versus connecting them directly to VCC or GND. If you are still worried about floating analog inputs, you can simply tie ADC7 to the GND pin adjacent to it, and ADC6 to AVCC (or AREF if you prefer).

The sample and hold capacitor is tiny, so if you do decide to follow the purge recommendation, you can use ADC7 to sample - the capacitor will drain very quickly to ground and you will gain the benefits described.

  • \$\begingroup\$ I was worried about them having any other functionality like the rest of I/O pins, but you are right, since they are not, I should take the option of leaving them floating. And also, because I am designing the final version of the application and I know the ADC will never be used. \$\endgroup\$
    – esal26
    Commented Jul 12, 2014 at 16:31
  • \$\begingroup\$ Where did you find that ADC6 and 7 are "special"? I can't verify from the data sheet that those inputs are any different from the others. \$\endgroup\$
    – Rev
    Commented Jul 8, 2015 at 8:12
  • \$\begingroup\$ @Rev1.0 There are many places in the datasheet that show this. Probably the most obvious is the last sentence in 24.9.5 : "Note that ADC pins ADC7 and ADC6 do not have digital input buffers, and therefore do not require Digital Input Disable bits." Also note the block diagram in 2.1 which shows ADC[6..7] going straight to the ADC, while the other 6 ADC ports are shared with PORTC, and the pinouts in Fig 1-1 show ADC6 and ADC7 have no shared functions. \$\endgroup\$
    – Adam Davis
    Commented Jul 8, 2015 at 12:45
  • \$\begingroup\$ Oh my fault, I was looking at the 324/644 data sheet. This is the first Atmel controller where I see this "specialty". \$\endgroup\$
    – Rev
    Commented Jul 8, 2015 at 13:36

A pull-down resistor is good, yes. Not only does it stabilize the inputs and prevent any excess current draw, but it has the hidden benefit that you can use them as a Sample and Hold capacitor purge device. If you read an analogue value from one of these extra inputs in between readings from your other inputs it can make your readings a little more stable as the sample and hold capacitor will be always starting from the same level.

The smaller the resistor the faster the capacitor will discharge, but the higher the outrush current. Something around 470Ω is good. Also protects against the pin ever being configured as an output and driven high.

  • 1
    \$\begingroup\$ Wait so if I do 1) Read actual analog value 2)Read pulled-down analog, my actual analog value will be less noisy or something? \$\endgroup\$
    – Funkyguy
    Commented Jul 11, 2014 at 15:48
  • 1
    \$\begingroup\$ It will be less influenced by the readings from other channels. Read channel 1, read spare channel, read channel 2, read spare channel, etc. \$\endgroup\$
    – Majenko
    Commented Jul 11, 2014 at 15:50
  • \$\begingroup\$ Whoaa, thats so sweet! \$\endgroup\$
    – Funkyguy
    Commented Jul 11, 2014 at 15:50
  • 3
    \$\begingroup\$ Extreme example with floating inputs: forum.arduino.cc/index.php?topic=182446.0 \$\endgroup\$
    – Majenko
    Commented Jul 11, 2014 at 16:02
  • \$\begingroup\$ I see, although I am unfamiliar with the sample and hold cap, it makes sense to fully discharge it and start sampling each time from the same reference point. Great idea. \$\endgroup\$
    – sherrellbc
    Commented Jul 11, 2014 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.