Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer
    
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. –  esal26 Jul 12 at 16:31

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.

share|improve this answer
1  
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? –  Funkyguy Jul 11 at 15:48
1  
It will be less influenced by the readings from other channels. Read channel 1, read spare channel, read channel 2, read spare channel, etc. –  Majenko Jul 11 at 15:50
    
Whoaa, thats so sweet! –  Funkyguy Jul 11 at 15:50
3  
Extreme example with floating inputs: forum.arduino.cc/index.php?topic=182446.0 –  Majenko Jul 11 at 16:02
    
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. –  sherrellbc Jul 11 at 16:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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