I can't seem to find decent information on this topic as all articles only explain general concepts of pull-ups and pull-downs or only cover pull-ups in greater depth.
I understand the general concept of pull-up/pull-down resistors. I understand the working of a pull-up resistor and how to calculate its value. It's the concept of voltage drops considered when calculating R for a pull-down resistor that confuses me.
I will start with a pull-up (ignoring the 100 Ohm resistor):
- Switch open: digital input acts as a current sink in a HIGH state. It has a leakage current of ~20uA and Vhigh(min) = 2V. Therefore, the circuit simplifies to +5V -> 10k resistor -> GND.
Rmax = (5.0 - 2.0)/(20*10^-6) = 150k
So with a switch closed and R = 150k, we will have a V = 2V at the junction, which is the minimum voltage required to register as logic HIGH. By picking a smaller resistor value we can ensure the voltage drop across R is smaller so the voltage at the junction is closer to +5V. For example, a 10k resistor would only have a voltage drop of 0.2V, leaving us with 4.8V at the junction when the switch is open.
- Switch closed: digital input acts as a current source in a LOW state. That current is pulled straight to ground. So we can simplify this to two separate circuits: Vin -> GND and +5V -> 150k -> GND.
So essentially the pull-up resistor value has to be high enough to prevent a short circuit when the switch is open and low enough not to cause a high enough voltage drop.
Now, I am failing to come up with same logical conclusions when applying the same method for the pull-down (again, ignoring the 100 Ohm resistor):
- Switch open: digital input as a current source in a LOW state. It has a leakage current of 400uA and Vlow(max) = 0.8V. How do I use this information?
In my eyes I see it like this: The input is connected directly to GND, the drop across R will always be 5V no matter what, giving us exactly 0V.
- Switch closed: most of current bypasses R, thus a large amount of current at 5V is going straight into input (bad thing?).
So why do people always talk about voltage drops across R when it comes to pull-downs? It doesn't make any sense to me, it's been bugging me for a while now, any help is greatly appreciated!