I'm wondering why pull up resistors in text books are told such that they pull up the voltage to \$V_{CC}\$. Here is a diagram:
When the button is open what will be the input voltage to the micro controller? \$V_{CC}\$? No voltage drop at \$R_1\$?
I'm wondering why pull up resistors in text books are told such that they pull up the voltage to \$V_{CC}\$. Here is a diagram:
When the button is open what will be the input voltage to the micro controller? \$V_{CC}\$? No voltage drop at \$R_1\$?
If the button is closed then the MCU input pin is shorted to ground. There is a path from \$V_{CC}\$ to ground with resistance \$R_{1}\$ and a current flows through \$R_{1}\$. By Ohm's Law $$V = IR$$ so the current \$I\$ through \$R_{1}\$ is $$I = \frac{V_{CC}}{R_{1}}$$ and is non-zero.
If the button is open and the MCU input pin has a high impedance then very little current will flow through \$R_1\$. Since \$I \approx 0\$ in this case the voltage across the resistor is approximately \$0\$. The voltage at the MCU input is therefore "pulled up" to \$V_{CC}\$.
Without the resistor (i.e. \$R_{1} = 0\$) the MCU pin would simply be shorted to \$V_{CC}\$ and could never be "pulled down" by the button switch. If the button switch was closed then the current drawn from \$V_{CC}\$ would be $$I = \frac{V_{CC}}{R_{1}} \approx \frac{V_{CC}}{0} = \infty$$