8

There are microcontrollers (for example all the ATmega chips as far as I know) that allow ports to be set to "output", "input tristate" or "input internal pull-up resistor".

What are the advantages/disadvantages of either of those options in case of not connected pins? As I know, leaving them on output is the worst solution. The chips are shipped (I think) with all ports as input, tristate.

I'm asking specifically about the situation where those pins are not soldered anywhere. (or possibly soldered to ground, but the general case should be not soldered anywhere)

vsz
  • 2,554
  • 1
  • 17
  • 32
  • 1
    possible duplicate of [General "rule of thumb" for unused IC pins](http://electronics.stackexchange.com/questions/37696/general-rule-of-thumb-for-unused-ic-pins) – Leon Heller Dec 03 '12 at 09:51
  • @LeonHeller I don't think so, as that question includes (and has as its answer) that those pins should be soldered to ground, or have other external circuits added. My question specifically asks about the situation where **no external connections exist** and the pin is not soldered anywhere. Also, that question is exclusively about hardware. This question asks for a specific internal setting. – vsz Dec 03 '12 at 09:56

2 Answers2

6

When you have a not connected pin, the first thing you need is to clamp it to a rail, either Vcc or ground. You need this because a floating state may cause an intermediate state in the input buffers, leading to static power absorption.

To force a level, you can either set the pin as output or input with internal pull-up. My measurements didn't show any difference in the power absorbed with the two solutions, but the manual (of a Jennic microcontroller) suggested to use the latter (input with pull-up). I'd say it's reasonable, because it uses a weaker pull-up than the output mode, and this may reduce leakage.

clabacchio
  • 13,481
  • 4
  • 40
  • 80
5

An old FPGA hack is to connect unused pins to the ground plane on the PCB, and configure them as outputs driving 0. This improved the ground connection, and reduced ground bounce from the outputs you were switching fast.

This certainly doesn't matter for low power micros like the AVRs, I would leave the pins unconnected, and configure them "input with pull-up" so that they aren't just left floating.

However it might become more important as we move towards near-GHz ARM chips for a dollar...

  • Very interesting the first paragraph about the ground connection! – clabacchio Dec 03 '12 at 18:34
  • Yeah but in a micro, it could raise the prospect of software-induced magic smoke! There's a bit more you can do in FPGA to make such failures less likely... –  Dec 03 '12 at 20:44