AVR – Pullup vs Pulldown on Button Input

avrmicrocontroller

So I know the Atmega328p (What im using now) has Pull-up resistors available to be activated. And I know when reading input we could either make a button cause a PIN to go high or low….but is there an advantage to either?

Obviously making the button go to GND when pressed is easiest since there are Internal Pullup's available…but is there possibly an advantage to making an external pulldown and then making the logic level go high when pressed?

I seem to see the first (easier way) used more, but I was curious if there was an advantage to either one.

Best Answer

Datasheet shows that

  • the noise margin is a little wider for the High logic input state.
  • input current is microamperes, no serious difference between Hi and Lo states.

Obviously the same noise field cause more voltage to wire+pull-up resistor than to wire + to GND conducting switch. Conclusion: Use pull-up resistors.

This is true of course when only external resistors are compared. If you compare internal pull-up vs external pull-down, of course the external pull- down resistor reduces noise, because it must be quite small to win the internal pull-up. This can make someone to think that the question was originally a trick.

NOTE: In severe conditions, for ex. near radio transmitters (including wlan and phones) the difference is nonexistent, serious design effort is needed to filter the noises out of the signals.