0
Offline
Sr. Member
Karma: 1
Posts: 405
MEGA_Stick_II is here
|
 |
« on: May 02, 2012, 10:57:59 am » |
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
Offline
Shannon Member
Karma: 129
Posts: 10374
|
 |
« Reply #1 on: May 02, 2012, 11:00:26 am » |
Setting them as INPUT,HIGH would enable the internal pullup and a small amount of current would flow. Flow where?
|
|
|
|
|
Logged
|
|
|
|
|
83 - var
Offline
Sr. Member
Karma: 0
Posts: 473
ARDUINO Powa !
|
 |
« Reply #2 on: May 02, 2012, 11:38:11 am » |
output LOW !
Skizo !
|
|
|
|
|
Logged
|
Un tien vaux mieux que deux tu l'auras !
|
|
|
|
Germany
Offline
Edison Member
Karma: 28
Posts: 1583
|
 |
« Reply #3 on: May 02, 2012, 11:45:25 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Sr. Member
Karma: 1
Posts: 405
MEGA_Stick_II is here
|
 |
« Reply #4 on: May 02, 2012, 12:02:55 pm » |
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 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
Full Member
Karma: 3
Posts: 197
|
 |
« Reply #5 on: May 02, 2012, 12:11:39 pm » |
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
Brattain Member
Karma: 299
Posts: 26024
Solder is electric glue
|
 |
« Reply #6 on: May 02, 2012, 12:12:57 pm » |
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. but don't I/O pins on microcontrollers tri-state They default to inputs not tri-state.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Sr. Member
Karma: 1
Posts: 405
MEGA_Stick_II is here
|
 |
« Reply #7 on: May 02, 2012, 12:23:01 pm » |
Good to know, thanks
|
|
|
|
|
Logged
|
|
|
|
|
South England
Offline
Full Member
Karma: 3
Posts: 197
|
 |
« Reply #8 on: May 02, 2012, 12:34:27 pm » |
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. but don't I/O pins on microcontrollers tri-state They default to inputs not tri-state. Thanks for the correction  Every day's a school day!
|
|
|
|
|
Logged
|
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 144
Posts: 4882
|
 |
« Reply #9 on: May 02, 2012, 01:16:31 pm » |
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. http://www.eschertech.com
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10374
|
 |
« Reply #10 on: May 02, 2012, 03:16:31 pm » |
The recommended practice, only if the processor will be put to sleep... 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
Sr. Member
Karma: 1
Posts: 405
MEGA_Stick_II is here
|
 |
« Reply #11 on: May 02, 2012, 03:19:35 pm » |
The recommended practice, only if the processor will be put to sleep... 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
Brattain Member
Karma: 299
Posts: 26024
Solder is electric glue
|
 |
« Reply #12 on: May 02, 2012, 03:20:40 pm » |
Not very much because the input has so high an impedance.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10374
|
 |
« Reply #13 on: May 02, 2012, 03:37:57 pm » |
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
Sr. Member
Karma: 1
Posts: 405
MEGA_Stick_II is here
|
 |
« Reply #14 on: May 02, 2012, 04:13:31 pm » |
Again, good to know 
|
|
|
|
|
Logged
|
|
|
|
|
|