Go Down

Topic: Unused Analog Inputs Atmega328 - question (Read 1 time) previous topic - next topic

Lsnyman

Wow, that is a great article, thank you.
I am using my own board in my device si it has no USB,

Jack Christensen


Well you could put in pull-down resistors to tie them low. That shouldn't consume much, if anything. Pull-ups will add to the current drawn (as you would expect) according to my measurements here:

http://www.gammon.com.au/forum/?id=11497


Actually, I'm not sure I would expect pull-ups to add to the current drawn, if nothing else is connected to the pins. Where is the current flowing to?

In fact, in my experimenting with sleep modes, I make all the pins inputs and enable pull-ups before going into power-down mode, and supply current waffles around between 0.1µA and 0.2µA.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Nick Gammon

According to my measurements on the page quoted above, the difference is about 0.9 uA.

I presume where the current is "going" is making the input MOSFETs "work harder" by amplifying noise.

See page 43 of the datasheet:

Quote
If the input buffer is enabled and the input signal is left floating or have an analog signal level close to VCC/2, the input buffer will use excessive power.


and:

Quote
An analog signal level close to VCC/2 on an input pin can cause significant current even in active mode.

Jack Christensen


According to my measurements on the page quoted above, the difference is about 0.9 uA.

I presume where the current is "going" is making the input MOSFETs "work harder" by amplifying noise.

See page 43 of the datasheet:


Right, I saw the measurements, and hence the question as my results seem different. Shouldn't having the pullup turned on reduce noise? As opposed to a floating pin?

Datasheet section 14.2.6, p81, recommends enabling pull-ups to provide a well-defined level for unconnected pins.

Recently I've been thinking about starting each sketch with the following in setup():

Code: [Select]
PORTB = PORTC = PORTD = 0xFF;    //enable all pullups
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Coding Badly

Quote
an analog signal level close to VCC / 2


A pullup would put the signal level close to VCC not close to VCC divided by 2.

My results have been similar to Jack's.  For unconnected pins, I have not measured a difference between input with pullup, output low, or output high.  But my Extech multimeter may not be up to the task.

Go Up