8
\$\begingroup\$

On a part I'm working with, it says that you can configure the part to operate in a particular mode by "strapping" a particular pin to ground. That is, it wants you to use a pulldown resistor to pull it to ground. From what I understand, when this part starts up, the pins are inputs, so the pin gets pulled down, which tells the part to be in X mode. I believe microcontrollers are like this as well, where all pins are inputs when it starts up or after it resets.

What confuses me is that after the part starts up, this is an output. It's basically connected to ground through this resistor. How could there still be an output if it's basically tied to ground?

Let's say it's supposed to output a signal to, I dunno, a microcontroller. Whenever it outputs, wouldn't that current all go to ground and not end up at the microcontroller?

Thanks for the help!

\$\endgroup\$
3
  • \$\begingroup\$ What value resistor did they recommend? If it's zero ohms, that would be a problem. If it's 50 kOhms, and the logic high value is 5 V, then only 0.1 mA would need to be supplied to drive the line high (Ohm's Law). \$\endgroup\$
    – The Photon
    Commented Sep 28, 2012 at 18:31
  • \$\begingroup\$ As ever, providing an actual part number and pin number and feature and data sheet reference would allow people to provide you with an exact and accurate answer instead of having lots of people spending time making intelligent guesses. \$\endgroup\$
    – Russell McMahon
    Commented Sep 28, 2012 at 19:44
  • \$\begingroup\$ Jack, the input senses voltage, not current. Think of the binary/digital output as a voltage source so no matter what is hanging there, it will always put out HIGH or LOW. In reality of course, a voltage source can only supply so much current (think of another resistor in series with the source) Stevenvh below shows you how to model your pulldown mathematically. Remember inputs are usually really high resistances (that's one of the beauties of digital) and can be found in any datasheet (as leakage current). \$\endgroup\$ Commented Sep 28, 2012 at 21:36

4 Answers 4

14
\$\begingroup\$

You have two modes.

Input
The input is high-impedance, so there won't flow any current, apart from a small leakage current, which we'll ignore for the moment. Let's say you have a 10 kΩ pull-down resistor. Since there doesn't flow any current into or out of the input there won't be any current through the resistor, and then, due to Ohm's Law there won't be any voltage across it either. So if the low end is 0 V, so will be the input. The controller sees it as a low level.

Output
Whether the output is high or low, it's low impedance, like for instance 10 Ω. Low won't be a problem: the pull-down already made the level low, and the low impedance of the output only enforces this.

If the output is high, the internal 10 Ω resistor and the 10 kΩ pull-down form a resistor divider. The output voltage will then be

\$ V_{out} = \dfrac{10 k\Omega}{10 k\Omega + 10\Omega} 5 V = 4.995 V \$

So the pull-down resistor changes the output voltage only very slightly, thanks to the big difference in resistance.

\$\endgroup\$
10
\$\begingroup\$

In electronics 'tying to ground' is not an all or nothing thing. The resistor pulls it to ground, but only weakly so. The microcontroller can - when the pin is configured as output - pull much much harder.

Think of a gentle breeze flapping a piece of laundry in one direction. You will have no problem pushing it in the other direction. (Unless the breeze turns into a tornado, the electronic equivalent would be a resistor with a very low resistance).

\$\endgroup\$
1
\$\begingroup\$

The actual pin is configured as a tri-state driver with a input attached to the pin pad. On reset the driver part is tri-stated, allowing the external resistor to pull the pin in the right direction, which is in turn read by the internally attached input. Once read the output pin is taken out of tri-state mode and driven.

\$\endgroup\$
0
\$\begingroup\$

Presumably, you're pulling the pin to ground via a resistor with a value in the 10k - 100k range. Configured as an output pin, the current through the resistor will be essentially zero when the output is low and will be 5V/10k to 5V/100k = 0.5mA to 0.05mA when the output is high, assuming 5V logic. Provided that the output pin can source more than the parasitic load produced by the resistor to ground (most everything can source at least a few mA - check your datasheet), you should have no problem using it as a normal output pin, though your system current consumption will be higher as a result. To minimize the parasitic draw, use the highest value resistors possible that will still achieve the desired result.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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