36

This is somewhat similar to this question about NC pins. In cases where the datasheet doesn't specify what to do with unused IC pins, what is the recommendation to do with these pins? In particular I'm thinking of GPIO pins for the AT32UC3C microcontroller, but also more generally for other IC types (for example multi op-amp IC's).

I can think of a few possible combinations:

  1. Provide a solder pad/hole so the chip is secured but leave pin floating.
  2. Connect the pin to ground (possible through a resistor/capacitor/etc.)
  3. Connect the pin to a supply source
  4. Something I can't possibly think of
helloworld922
  • 16,600
  • 10
  • 54
  • 87

3 Answers3

32
  1. "Provide a solder pad". Of course you will. All the IC's pins should be soldered. Always. Leaving it floating is NOT a good idea. It may change level all the time, which may have undesired effects to the internally connected circuitry. You always want to have predictive behavior. If the input has an internal pull-up resistor this is a good solution, though, as long as you don't forget to enable it.

  2. "Connect the pin to ground". That's a good solution, provided that you can guarantee that the pin will never become an output. Output high and you short-circuit the power supply. A resistor would prevent that, but that's an extra cost. Don't use a capacitor; it would leave the pin floating, and the microcontroller doesn't like the capacitive load in case it would become output.

  3. "Connect the pin to a supply source". Same as above: if the pin should become output low you'll have a short-circuit.

  4. "Leave unconnected, but make the pin output". That's the best solution. Don't use the possible alternate functions, like ADC or serial. A high level is preferred in case you forgot to switch off the internal pull-up resistors, which otherwise would cause a (small) leakage current.

For opamps the output can be left open, and the inputs to a fixed voltage, but not both to the same! I recently saw in a Linear Technology application note how they connected the non-inverting input to V+, the inverting input to V-. Szymon rightly points out that this can't be used if the inputs have clamping diodes.

The best thing to do with a surplus op-amp it is to use it. There are lots of places in an analog circuit where a buffer amplifier may improve performance - and a unity gain buffer uses no extra components. (from this article, linked to by Szymon)

stevenvh
  • 145,145
  • 21
  • 455
  • 667
  • 3
    For unused opamps the recommended practice is making them into followers and connecting the input to a potential within the output voltage swing. http://pdfserv.maxim-ic.com/en/an/AN1957.pdf http://www.analog.com/static/imported-files/rarely_asked_questions/unused_op-Amp_article.html – Szymon Bęczkowski Aug 12 '12 at 07:31
  • 1
    @Szymon - I saw that recently in a Linear Technology application note, unfortunately can't find it back right now. If I have to choose between advice from Maxim or Linear I go for Linear. – stevenvh Aug 12 '12 at 07:38
  • I guess this depends on the input/output stages of opamps. If the inputs are clamped you cannot use your solution. Also, did you notice link to AD in my comment? They give the same advice as Maxim. – Szymon Bęczkowski Aug 12 '12 at 07:55
  • @Szymon - Good point about the clamping, I updated my answer. Yes, I read the Analog article too, quote added to answer as well. :-). Thanks for the feedback. – stevenvh Aug 12 '12 at 08:07
12

I'll start by saying there is no right answer to this question. Usually the microcontroller manufacturer will have recommendations for each pin category. This is certainly the case for the MSP430 chips I've worked with where power consumption is a major consideration.

The problem you will encounter if you don't terminate GPIO is that the default state of the pins is often "input". Depending on the input circuit, this could cause your pins to float in at a non-digital value, and your IC's transistors will behave accordingly, drawing more static power than the would otherwise.

If the datasheet doesn't say anything it is likely that there is an app note from the manufacturer that discusses it. The closest thing I could find was one related to the XMega family (AVR1010) that states:

To minimize power consumption, enable pull-up or -down on all unused pins, and disable the digital input buffer on pins that are connected to analog sources.

If you search the interwebs on this topic, you'll find a lot of different opinions. The context of your chip matters a lot.

vicatcu
  • 22,499
  • 13
  • 79
  • 155
  • +1 for clearly stating why setting (leaving) them as input is actually a problem (the usual "because it would let it floating" alone is too vague) – Sz. Dec 13 '15 at 18:19
10

For microcontrollers, generally the best idea is to make the pin an output and drive it either high or low (or pullup/pulldown can be used)
What you don't want is the floating halfway scenario where both the input transistors are half on and passing current.

For opamps, the general way is to connect the output to the inverting input, and then connect the non-inverting input to the supply midpoint (or somewhere between rails)
Basically you don't want the output to saturate, it should be somewhere within the output swing of the opamp.
Be careful with non-unity gain stable opamps though. In "specialised" cases the datasheet is likely to have a suggestion for what to do with any unused opamps.

Oli Glaser
  • 54,990
  • 3
  • 76
  • 147