Pages: [1]   Go Down
Author Topic: What to do with unused pins  (Read 1082 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know this might be a noob questions, and I think I know the answer but;
For long term, is it best to set unused pins as OUTPUT or INPUT, HIGH or LOW?
Setting them as INPUT,HIGH would enable the internal pullup and a small amount of current would flow.
I'm thinking setting them as OUTPUT,LOW would be best.


Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12936
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Setting them as INPUT,HIGH would enable the internal pullup and a small amount of current would flow.

Flow where?
Logged

83 - var
Offline Offline
God Member
*****
Karma: 9
Posts: 864
ARDUINO Powa !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

output LOW !

Skizo !
Logged

Un tien vaux mieux que deux tu l'auras !

Germany
Offline Offline
Faraday Member
**
Karma: 59
Posts: 3060
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As long as you don't put in wrong wires, it does not matter. ( OUTPUT, LOW does not like to drain 5V without a resistor )

Rather tape the unused pins smiley-wink
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As long as you don't put in wrong wires, it does not matter. ( OUTPUT, LOW does not like to drain 5V without a resistor )

Rather tape the unused pins smiley-wink

I didn't know if the undefined/unused pins would or could cause issues if left "floating" so to speak. Like intermittent interference or something.
Logged

South England
Offline Offline
Full Member
***
Karma: 3
Posts: 205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I might be talking out of my arse here, but don't I/O pins on microcontrollers tri-state if you don't tell them what to do? So you don't REALLY need to do anything to them? I've never bothered doing anything special to my unused pins on arduino projects and nothing weird's happened so far.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34243
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

While it is normal to tie unused logic inputs to a level on logic ICs, I don't think it matters on the processor because the floating pickup on them is not going to make it's way into the rest of the logic unless the code invites them in.
I don't do anything with unused inputs and I have not experienced any problems.

Quote
but don't I/O pins on microcontrollers tri-state
They default to inputs not tri-state.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good to know, thanks
Logged

South England
Offline Offline
Full Member
***
Karma: 3
Posts: 205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

While it is normal to tie unused logic inputs to a level on logic ICs, I don't think it matters on the processor because the floating pickup on them is not going to make it's way into the rest of the logic unless the code invites them in.
I don't do anything with unused inputs and I have not experienced any problems.

Quote
but don't I/O pins on microcontrollers tri-state
They default to inputs not tri-state.

Thanks for the correction smiley-grin Every day's a school day!
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6619
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you leave unused pins unconnected and unprogrammed, they default to (input, low). In this state the pin may float at a voltage that is neither high nor low, which slightly increases the current consumption of the input buffer. Unless you're using the sleep mode of the processor, you probably won't notice the difference. Programming unused pins as (input, high) to enable the internal pullup avoids the issue. So does programming them as outputs.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12936
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


The recommended practice, only if the processor will be put to sleep...

Quote
13.2.6 Unconnected Pins
If some pins are unused, it is recommended to ensure that these pins have a defined level. ... The simplest method to ensure a defined level of an unused pin, is to enable the internal pull-up.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


The recommended practice, only if the processor will be put to sleep...

Quote
13.2.6 Unconnected Pins
If some pins are unused, it is recommended to ensure that these pins have a defined level. ... The simplest method to ensure a defined level of an unused pin, is to enable the internal pull-up.

Doesn't that cause a bit more current consumption by the processor? If it's pulled to a 5v level via internal resistors, power must be flowing.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34243
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Not very much because the input has so high an impedance.
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12936
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Doesn't that cause a bit more current consumption by the processor? If it's pulled to a 5v level via internal resistors, power must be flowing.

I have a handheld gadget that: runs from 2 AA alkaline batters, is used a few times every day, for 30 minutes to one hour.  This is the third year of its existence and it is still running problem-free on the original AA batteries.  The unused pins are held high by internal pullups.

In my experience, any current consumption from the internal pullups enabled on unconnected pins is so very small as to be essentially zero.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Again, good to know  smiley-cool
Logged

Pages: [1]   Go Up
Jump to: