Possible Duplicate:
Is it really a bad idea to leave an MCU input pin floating?

I am using a pic microcontroller that has about 36 GPIO pins, I am only using 31 of them, is it ok to have the ones that I don't use just floating or do I have to connect them to Vdd or Vcc

  • \$\begingroup\$ datasheet link? But almost any modern uP is cool with floating pins as long as you're not expecting them to float to any particular voltage. \$\endgroup\$
    – NickHalden
    Nov 17, 2012 at 1:06
  • \$\begingroup\$ @apalopohapa I agree on one hand, and on the other that question has a very poor answer in my opinion, that is from our chiphacker.com days. \$\endgroup\$
    – Kortuk
    Nov 17, 2012 at 7:13

2 Answers 2


Floating pins can cause high power consumption. Microchip recommends making unused pins outputs and setting them low.


Not all IO pin architectures are the same. In fact, they are usually more different than one would expect. Usually either High-Z(floating) or Open Drain Low will yield the lowest power consumption, as documented in the datasheet or references for the part. On some devices not even all the IOs will have the same architecture so it is even possible that some unused pins should be left floating while others should be driven low or even configured for use by a certain peripheral for minimum consumption.
In some applications, other parameters may matter more than low power consumption, like ESD tolerance or handling ruggedness. Again, the answers may be different part to part and pin to pin and requirements should be considered.
In short, best not to make assumptions about black box systems. Look it up, take measurements, or contact a support engineer.

  • \$\begingroup\$ Better answer ;) \$\endgroup\$ Nov 17, 2012 at 15:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.