"I was playing with some switches and your design said to use 10K pull-up resistors, they take about 500uA of current each, why so much? Aren't pull-ups just to get a voltage?"
Well, yes and no! There are several reasons to use a pull-up resistor
- Establish a logical 1 input on the pin.
- Provide wiping current for switches.
- Act as a current source for something like an open-drain or open-collector output
Switches open up a whole new ball game. The contacts of most switches are made with a highly conductive metal plating over a lower cost metal such as brass. When selecting a switch for your application check the data carefully as some types will require a minimum 'wiping' current which is needed to inhibit oxidation of the contact surface, particularly for designs where the switch contacts do not 'wipe' across each other. Once again, modern parts require lower currents, but if a switch seems to be unreliable, try increasing the current by reducing the value of the pull-up resistor.
When the resistor is used to provide the output load for an open drain or open collector circuit its value needs to be high enough to keep the current down to a reasonable value, but low enough to provide enough current to get the required speed. A perfect example is the I2C (i-squared-c) bus from NXP. A large number of inputs can appear in parallel so the pull-up needs to provide sufficient current to take all of them to the high state. And it must do so whilst charging up the input capacitance of all the devices and any parasitic capacitances in boards or cables quickly enough to get the appropriate rise times.
One common mistake I see is people using I2C with controllers and accepting the internal pull-up as being adequate for driving the bus. It just might work if the one I2C peripheral or memory part is the only thing connected to the processor and it is very close to the host. But even then many users report that they cannot get the 100kHz or 400kHz speed of the I2C bus, the might have to reduce the clock to 10kHz or even less. I2C was specified with a 4.7K pull-up for a darned good reason, and you will see that the rise times and thus speed capability of the bus only achieve optimal values when you use that pull-up.
No comments:
Post a Comment