Pages: [1]   Go Down
Author Topic: What to do with unused pins?  (Read 3788 times)
0 Members and 1 Guest are viewing this topic.
Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm getting ready to draw the PCB for a project.
Some of the analog pins of the chip are not used.
Do I need to do something with them? Ground them? Or just leave them be?
Logged

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


Leave them be.  If the pin is connected to GND and you accidentally configure it as an output and set it HIGH, you've fried the processor.  If the pin is connected to GND and you accidentally enable the internal pull-up, you're wasting electricity.  If the pin is connected to VCC and you accidentally configure it as an output and set it LOW, you've fried the processor.

Ideally, you will configure the unconnected pins as inputs with the internal pull-up resistor enabled.
Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would bring them out to a small pad, if there is space in the board, because they might be handy in the future.
Logged

Houston
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
Electronics is just part of life.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

if you do that make sure you can reprogram your micro controller, because if you can what would be the use of having them open anyways?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
  Assuming you leave them be (no connections to Vcc/Gnd), is there any difference at all between making the pins outputs, and making them inputs with pull-ups enabled? Thanks!
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4062
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

FYI, similar thread here:
http://forums.adafruit.com/viewtopic.php?f=25&t=20742
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

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

Quote
Assuming you leave them be (no connections to Vcc/Gnd), is there any difference at all between making the pins outputs, and making them inputs with pull-ups enabled?

Yes.  If you accidentally touch a hot wire to an output set low you've short-circuited your processor and fried it.  If you accidentally touch a ground wire to an output set high you've short-circuited your processor and fried it.  If you accidentally touch either wire to an input w/ pull-up you won't even notice.

Or are you asking about power consumption?  In which case there's no difference.
Logged

'round the world...
Offline Offline
Faraday Member
**
Karma: 42
Posts: 3244
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are building a PCB for testing purposes, mapping the unused pins to a pad so you can use them on a breadboard later on is the way to go.

If the PCB is going to be a stand-alone device, then it would be advisable for you to connect them to one of the logic levels. +5V or GND. The reason for this is, as hinted by Coding Badly, the possibility that if the pins don't have a fixed voltage on them, they'll fluctuate and cause the logic on the pin to change and consume power. It's up to you really...

However, you must take care when using the pins when you do this. Or put an external pull up on that pin. That way, you'll be safe in any of these:


Leave them be.  If the pin is connected to GND and you accidentally configure it as an output and set it HIGH, you've fried the processor.  If the pin is connected to GND and you accidentally enable the internal pull-up, you're wasting electricity.  If the pin is connected to VCC and you accidentally configure it as an output and set it LOW, you've fried the processor.

Ideally, you will configure the unconnected pins as inputs with the internal pull-up resistor enabled.

Logged

Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 4302
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Ideally, you will configure the unconnected pins as inputs with the internal pull-up resistor enabled.
Ideally you would just leave them as Atmel does, in their default condition.

Don
Logged

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

Quote
Ideally you would just leave them as Atmel does, in their default condition.

Or even more ideal, follow Atmel's guideline for unconnected pins...

Quote
13.2.6 Unconnected Pins
If some pins are unused, it is recommended to ensure that these pins have a defined level. Even though most of the digital inputs are disabled in the deep sleep modes as described above, floating inputs should be avoided to reduce current consumption in all other modes where the digital inputs are enabled (Reset, Active mode and Idle mode).

The simplest method to ensure a defined level of an unused pin, is to enable the internal pull-up.  In this case, the pull-up will be disabled during reset. If low power consumption during reset is important, it is recommended to use an external pull-up or pull-down. Connecting unused pins directly to VCC or GND is not recommended, since this may cause excessive currents if the pin is accidentally configured as an output.
Logged

'round the world...
Offline Offline
Faraday Member
**
Karma: 42
Posts: 3244
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice... glad to see we weren't way off on the answers. smiley
Logged

Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 4302
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Or even more ideal, follow Atmel's guideline for unconnected pins...
So we agree that when he designs his board he just leaves the pins unconnected, or better yet brings them out to an accessible pad.  The enabling of the internal pull-ups could be done, if desired, by any program when the board is actually used.  This enabling would have to be part of each individual program since the enabling is undone at every reset.

Don
Logged

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

So we agree that when he designs his board he just leaves the pins unconnected

Yes.  Unused pins should be unconnected.

Quote
or better yet brings them out to an accessible pad

A very good idea.

Quote
The enabling of the internal pull-ups could be done, if desired, by any program when the board is actually used.

Yes.

Quote
This enabling would have to be part of each individual program since the enabling is undone at every reset.

In my case, I would (clone [if necessary] and) modify the core so enabling the pull-ups on unused unconnected pins (especially ones without pads) is performed before the Sketch starts.  That is, after all, the point of a computer: to do the simple repetitive tasks that we humans tend to forget.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did a load of testing around this sort of thing (written up here: http://electronicsfordogs.com/node/15), and found that the absolutely lowest power way to leave unused pins is to set them as LOW outputs. However, given the risks with this, it's probably a far better idea to accept a tiny amount of extra current and set unused pins as inputs with the pull up resistors enabled.

But thanks for the idea about breaking unused pins out as pads - definitely going to do that from now on!
Logged

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

You may want to disconnect pins 0 and 1 (TX and RX) when running the pin_mode_power_consumption test.  I suspect driving RX low while connected to the serial / USB converter may cause problems.
Logged

Pages: [1]   Go Up
Jump to: