Electronic – Is it generally OK to ignore the current in and out of a MCU pin when analyzing circuit external to the MCU

gpiomicrocontrollerpinspulldownpullup

From here, I see below illustration about the pull-up resistor.

enter image description here

And the article says:

With a pull-up resistor, the input pin will read a high state when the
button is not pressed. In other words, a small amount of current is
flowing between VCC and the input pin (not to ground), thus the input
pin reads close to VCC
.

It gives me an impression that the current in and out of a MCU is so small that it can be ignored when analyzing the behavior of the circuit external to the MCU.

Such assumption may simplify things a bit. But is it OK?

Best Answer

Maybe. For values in K ohms usually you can ignore it, unless you're doing something with unusual operating environment or high reliability. It never hurts to read the datasheet thoroughly when you are considering spec'ing a new part though.

Of course if you enable internal pull-ups or pull-downs then you will generally have to take those into account.

If you try to minimize switch-closed consumption by using a resistor value like 10M then you will find that the MCU maker won't necessarily guarantee that will work.

For example, the Microchip ATMega328p has the following guaranteed characteristics:

enter image description here

1uA of leakage is enough to overcome the few hundred nA from the 10M resistor, so it might not work. Chances are the current will be much lower at Ta << 105°C so it might be okay for a toy or consumer device.

There are reasons not to use too low a resistor value (wasted power, possibly switch wear in extreme situations) and too high a value (switch reliability, leakage due to the semiconductors or contamination on the PCB and possible pickup of EMI).