Logic and pull-up resistors

Source: Internet
Author: User

1 Logic level

in digital circuits, there is no mathematical sense of 1 and 0, with only different voltage values.

A different range of voltage values is typically defined to represent "logic 1" and "Logic 0" as follows:

2 Pull-up resistor

2.1 Definitions

The actual circuit, especially in the microcontroller and some digital logic devices, commonly used pull-up resistor to connect the switch or button, indicating the input logic state (1 or 0).

For example, enter as "High" ("1") when the button is turned on, and enter as "Low" ("0") when the button is off.

When the button is pressed, if there is no pull-up resistor, the GND will be connected directly to VCC, resulting in a short circuit, which also proves the necessity of the presence of the pull-up resistor from the opposite side.

2.2 of two conditions

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

1) When the button is off, theR1 controls the current value of GND, VCC, so the value of R1 cannot be too small (too small, too large, and meaningless power consumption increases) .

2) When the button is turned on, the voltage at theR1 control input pin is "high", so the value of the R1 can not be too large (too large the voltage on the R2 is too small, resulting in the inability to determine whether the input is "1" or "0")

Considering the above two conditions to take R1/R2≈1/10, and the input resistor at the microcontroller input pin is usually 100kω~ 1MΩ, so the value of the pull-up resistor is generally 10kω

3 Calculating Resistance values

Example: Assuming VCC = 5 V, the required limit current is about 1mA when the button is pressed, and the R1 value is obtained.

According to Ohm's Law know:

R1 = vcc/ir = 5v/1ma = 5 KΩ

It is also important to note that the higher the pull-up resistor value, the more slowly the pin responds when the input voltage is switched high and low.

Resources:

<foundations of Analog and Digital Electronic circuits > Chapter 5

Https://learn.sparkfun.com/tutorials/pull-up-resistors/introduction

Logic and pull-up resistors

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.