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.

Pull-up resistors的更多相关文章

  1. [蓝牙] 3、 剖析BLE心率检测工程

    位于:<KEIL path> \ARM\Device\Nordic\nrf51822\Board\pca10001\s110\ble_app_hrs Heart Rate Example ...

  2. 低功耗蓝牙4.0BLE编程-nrf51822开发(2)

    相关下载:http://download.csdn.net/detail/xgbing/9565708 首先看的示例是心率计一个示例程序:<KEIL path> \ARM\Device\N ...

  3. RS485接线 - 为什么要给2线制RS485接3根线?

    http://www.chipkin.com/rs485-cables-why-you-need-3-wires-for-2-two-wire-rs485/ RS485needs 3 conducto ...

  4. STM32F4 How do you generate complementary PWM Outputs?

    How do you generate complementary PWM Outputs? I would like to generate complementary PWM Outputs wi ...

  5. TQ2440平台上LCD驱动的移植

    参考: http://liu1227787871.blog.163.com/blog/static/205363197201242393031250/ http://blog.csdn.net/cum ...

  6. RS485相关学习

    TIA-485-A (Revision of EIA-485) Standard ANSI/TIA/EIA-485-A-1998Approved: March 3, 1998Reaffirmed: M ...

  7. raspberry-gpio-python(树莓派GPIO与Python编程)

    国外的设计接口设计得很棒,包括问题:读脏与防抖,还包括读这个数据提供了两种方式,一种是阻塞等待方式,还有一种是回调函数,前一种是通讯中常用的方式,后一种来自系统架构设计的整体性考虑.这种硬件接口设计的 ...

  8. 在STM32上如果不使用外部晶振,OSC_IN和OSC_OUT的接法

    如果使用内部RC振荡器而不使用外部晶振,请按照下面方法处理: 1)对于100脚或144脚的产品,OSC_IN应接地,OSC_OUT应悬空.2)对于少于100脚的产品,有2种接法:  2.1)OSC_I ...

  9. Android之Pull解析XML

    一.Pull解析方法介绍 除了可以使用SAX和DOM解析XML文件,也可以使用Android内置的Pull解析器解析XML文件.Pull解析器的运行方式与SAX解析器相似.它也是事件触发的.Pull解 ...

  10. 解决托管在Windows上的Stash的Pull request无法合并的问题

    最近尝试合并一个托管在Windows的Stash系统中的pull request时,发现合并按钮被禁用,显示有冲突不能合并,但是在diff页面中没有现实冲突,而且代码实际上并没有任何冲突. 后来在这篇 ...

随机推荐

  1. oi的小转折

    2018.6.4,衡水中学oier——Yu-shi,真正的走入了外网领域. 从最开始的连scanf都不打取地址,到现在懂了好多以前不敢去看的东西,心态逐渐的成长了.也许有过特别迷茫的时候,也许将来会有 ...

  2. 清北学堂模拟赛d6t4 数组异或

    分析:直接O(n^3)做是只有50分的,可以加一点小小的优化,就是c[k]可以从c[k-1]得到,但是还是只有60分,从宏观意义上是不能继续优化了.对于这类涉及到位运算的性质的题目,将每个数转化成二进 ...

  3. [USACO16OPEN]关闭农场Closing the Farm(洛谷 3144)

    题目描述 Farmer John and his cows are planning to leave town for a long vacation, and so FJ wants to tem ...

  4. 数字统计(2010年NOIP全国联赛普及组)

    题目描述 请统计某个给定范围[L, R]的所有整数中,数字 2 出现的次数. 比如给定范围[2, 22],数字 2 在数 2 中出现了 1 次,在数 12 中出现 1 次,在数 20 中出 现 1 次 ...

  5. [poj3974]Palindrome_Manacher

    Palindrome poj-3974 题目大意:求字符串的最长回文子串. 注释:$1\le strlen(s) \le 10^6$. 想法:介绍一种字符串算法——Manacher.求以每一个字符和字 ...

  6. 洛谷—— P1379 八数码难题

    https://daniu.luogu.org/problem/show?pid=1379 题目描述 在3×3的棋盘上,摆有八个棋子,每个棋子上标有1至8的某一数字.棋盘中留有一个空格,空格用0来表示 ...

  7. Android: Could not find com.android.support:support-v4:21.0.0

    安装Android Support Repository即可解决这个问题.

  8. HDU 4529

    好题.果然好题,经典了. 列一个计划,清明前做好状压DP.之后就刷剩下的MULTI. #include <iostream> #include <cstdio> #includ ...

  9. ACdream区域赛指导赛之专题赛系列(1)の数学专场

    Contest : ACdream区域赛指导赛之专题赛系列(1)の数学专场 A:EOF女神的相反数 题意:n(<=10^18)的数转化成2进制.翻转后(去掉前导零)输出十进制 思路:water ...

  10. LinkedHashMap源代码阅读

    LinkedHashMap LinkedHashMap内部採用了散列表和链表实现Map接口,并能够保证迭代的顺序,和HashMap不同,其内部维护一个指向全部元素的双向链表,其决定了遍历的顺序,一般是 ...