zoukankan      html  css  js  c++  java
  • Pull-up resistors

    1  Introduction

      Pull-up resistors are very common in microcontrollers or any digital logic device. 

      

      With a pull-up resistor, the input pin will read a high state when the button is not pressed. When the button is pressed, it connects the

    input pin directly to ground.

      Keep in mind, if the resistor wasn’t there, your button would connect VCC to ground, which is very bad and is also known as a short.

      A low resistor value is called a strong pull-up (more current flows), a high resistor value is called a weak pull-up (less current flows). Usually

    we use a resistor value of 10kΩ for the pull-up.

    2  Conditions

      The value of the pull-up resistor needs to satisfy two conditions:

      1)  When the button is pressed, the input pin is pulled low. The value of R1 controls how much current will flow from VCC to ground.

      2)  When the button is not pressed, the input pin is pulled high. The value of R1 controls the voltage on the input pin.

      

      For condition 1, we do not want R1 is too low. However, for condition 2, R1 should not be too large. The general rule is to use R1 that is 1/10 less than the input impedance(R2). Usually a input pin on a microcontroler has an impedance that can vary from 100k to 1MΩ.

    3  Calculating

      Assume we want to limit the current to 1mA when the button is pressed, where Vcc = 5V. What resistor value should we use?

      It is easy to show how to calculate the pull-up resistor using Ohm’s Law:

        R1 = Vcc/I = 5V/1mA = 5KΩ

      Another thing is that the larger the pull-up resistance, the slower the pin is to respond to voltage changes.

  • 相关阅读:
    BZOJ 2038: [2009国家集训队]小Z的袜子 (莫队)
    codevs 3981 动态最大子段和(线段树)
    ACM北大暑期课培训第八天
    ACM北大暑期课培训第七天
    ACM北大暑期课培训第六天
    ACM北大暑期课培训第五天
    ACM北大暑期课培训第四天
    HDU4403-模拟、数学
    HDU4296-ChengduOnling-贪心
    POJ3176-基础DP
  • 原文地址:https://www.cnblogs.com/mengdie/p/4579024.html
Copyright © 2011-2022 走看看