Author Topic: A resistor on the GND side instead of a pull-up resistor?  (Read 3025 times)

0 Members and 1 Guest are viewing this topic.

Offline anfangTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 108
  • Country: us
A resistor on the GND side instead of a pull-up resistor?
« on: September 07, 2016, 07:58:00 am »
Lately I have been reading about pull up resistors but I do not understand why we need them on the V+ side instead of on the GND side.

My question is based on this nice simple diagram published by Sparkfun on their tutorial on pull-ups:



I understand that without R1 pressing the button will short the circuit. But, if Vcc matches the required voltage, why can't we just put R1 between the button and GND? Doing this we can avoid wasting current when the IC-pin is on.

And a more general question: why is this resistor even called "pull-up"? There is nothing to be pulled here. If R1 was not there, the input pin would always be properly connected to Vcc; problems arise only when GND is involved. I would have called "pull down protector". But it is called a pull-up, so there must be something wrong with my understanding of them. :D
 

Offline batteksystem

  • Regular Contributor
  • *
  • Posts: 167
  • Country: hk
    • My ebay store
Re: A resistor on the GND side instead of a pull-up resistor?
« Reply #1 on: September 07, 2016, 08:01:38 am »
The idea of pulling up the pin of MCU input is to avoid the pin floating, in which voltage can vary a lot depends on the environment they are in. If you put the resistor between button and GND, when switch is off, the voltage will be floating on the MCU pin.

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: A resistor on the GND side instead of a pull-up resistor?
« Reply #2 on: September 07, 2016, 08:02:31 am »
Thew only reason is the name pull UP UP mean +Vcc, if you want to connect to ground will be a pull down.

The reason this kind of resistor exist is top warranty a logic state while the switch is open, will be 1 for pullup and 0 for pull down
 

Online wraper

  • Supporter
  • ****
  • Posts: 16866
  • Country: lv
Re: A resistor on the GND side instead of a pull-up resistor?
« Reply #3 on: September 07, 2016, 08:25:25 am »
why can't we just put R1 between the button and GND
It's called pull-down resistor. In that case switch would need to be connected to Vcc instead of GND.
EDIT: I mean between the right side of the switch and GND. If you mean "between" as in series with the switch, there is no use for it in this case.
Quote
And a more general question: why is this resistor even called "pull-up"? There is nothing to be pulled here.
Yes there is, it pulls up the voltage on the input pin to the Vcc level. Also generally there is no R2 in the MCU as on your schematic. Either pin is freely floating (very high input resistance), or if internal weak pull up is enabled, it rises to Vcc. Some MCUs may also have configurable pull-down.
Quote
If R1 was not there, the input pin would always be properly connected to Vcc
And where would you connect the switch in that case? Between Vcc and GND and short the power on each button press?
The thing is, depending on the switch state, input voltage need to be either high or low. If there is no pull-up resistor it would be freely floating when the button is not pressed and would be in undetermined state. Likely changing state rapidly because of the picked up interference. Connecting the resistor to GND would make the schematic not working at all. As voltage on the pin would be the same as GND, button press would have no effect.
« Last Edit: September 07, 2016, 08:30:42 am by wraper »
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: A resistor on the GND side instead of a pull-up resistor?
« Reply #4 on: September 07, 2016, 09:29:16 am »
R2 is not there by default. By default there is only a few uA of leakage.
R2 is approximately 40 kOhm (+-10k), up or down configurable by software. OR. R2 is around 100 Ohm if you set the pin as output!
Removing R1 makes the pin software-destructible. Could be a feature if you want it to be.

Reasons to not use the internal resistors are:
- Not available on every pin.
- Not available until software turns them on.
- Additional Vdd/Vss currents adding up to the power total. (and heat, reducing max Tambient)
- Easy to destroy. (low power rating)
 

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: A resistor on the GND side instead of a pull-up resistor?
« Reply #5 on: September 07, 2016, 10:18:49 am »
-- editing away something stupid --
« Last Edit: September 07, 2016, 10:50:17 am by JPortici »
 

Online wraper

  • Supporter
  • ****
  • Posts: 16866
  • Country: lv
Re: A resistor on the GND side instead of a pull-up resistor?
« Reply #6 on: September 07, 2016, 10:39:40 am »
- Additional Vdd/Vss currents adding up to the power total. (and heat, reducing max Tambient)
Internal pull-up current is tiny, unlikely to reduce Tambient by any serious amount amount unless it's a monster chip wih a shitload of terminals. The reason to not use it with a switch and use external resistor instead is exactly that, current is too small  for proper switch contact wetting https://en.wikipedia.org/wiki/Wetting_current or working in very noisy environments.
Quote
- Easy to destroy. (low power rating)
Not easier to destroy as if the pull-up wasn't used. Inputs are clamped to to power rails by protection diodes. Therefore it's impossible to exceed their safe power dissipation before destroying the input by other means.
 

Online wraper

  • Supporter
  • ****
  • Posts: 16866
  • Country: lv
Re: A resistor on the GND side instead of a pull-up resistor?
« Reply #7 on: September 07, 2016, 10:44:23 am »
pull down
pro: no current draw
con: you absolutely need a current limiting resistor so more components

Whattt?  :palm:

The only difference between pull-up and pull-down is polarity, nothing else. What better suits your needs depends on the particular application, but usually it is pull-up as everything usually is referenced to GND.
« Last Edit: September 07, 2016, 10:49:46 am by wraper »
 

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: A resistor on the GND side instead of a pull-up resistor?
« Reply #8 on: September 07, 2016, 10:50:55 am »
pull down
pro: no current draw
con: you absolutely need a current limiting resistor so more components

Whattt?  :palm:

The only difference between pull-up and pull-down is polarity, nothing else. What better suits your needs depends on the particular application, but usually it is pull-up as everything usually is referenced to GND.
yeah, it was something stupid, though editing won't take away the shame of a young-senile moment  :-[
« Last Edit: September 07, 2016, 10:55:14 am by JPortici »
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: A resistor on the GND side instead of a pull-up resistor?
« Reply #9 on: September 07, 2016, 11:21:16 am »
Reasons for not having floating CMOS inputs -

http://www.rcl-radio.ru/wp-content/uploads/2014/11/SCBA004.pdf

The two primary ones are excess input structure current drain from Vdd to Gnd, and clearly
logic levels that are indeterminate due to AC noise coupling and non deterministic leakage.

Regards, Dana.
« Last Edit: September 07, 2016, 11:24:32 am by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: anfang


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf