A resistor on the GND side instead of a pull-up resistor? - Page 1
Forum section: electronics / beginners

author: anfang
author_rank: Regular Contributor
timestamp: September 07, 2016, 07:58:00 am
content: 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.

author: batteksystem
author_rank: Regular Contributor
timestamp: September 07, 2016, 08:01:38 am
content: 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.

author: ebclr
author_rank: Super Contributor
timestamp: September 07, 2016, 08:02:31 am
content: 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

author: wraper
author_rank: Unknown
timestamp: September 07, 2016, 08:25:25 am
content: Quote from: anfang on September 07, 2016, 07:58:00 amIt'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.QuoteYes 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.QuoteAnd 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.

author: Jeroen3
author_rank: Super Contributor
timestamp: September 07, 2016, 09:29:16 am
content: 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)

author: JPortici
author_rank: Super Contributor
timestamp: September 07, 2016, 10:18:49 am
content: -- editing away something stupid --

author: wraper
author_rank: Unknown
timestamp: September 07, 2016, 10:39:40 am
content: Quote from: Jeroen3 on September 07, 2016, 09:29:16 amInternal 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 wettinghttps://en.wikipedia.org/wiki/Wetting_currentor working in very noisy environments.QuoteNot 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.

author: wraper
author_rank: Unknown
timestamp: September 07, 2016, 10:44:23 am
content: Quote from: JPortici on September 07, 2016, 10:18:49 amWhattt?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.

author: JPortici
author_rank: Super Contributor
timestamp: September 07, 2016, 10:50:55 am
content: Quote from: wraper on September 07, 2016, 10:44:23 amyeah, it was something stupid, though editing won't take away the shame of a young-senile moment

author: danadak
author_rank: Super Contributor
timestamp: September 07, 2016, 11:21:16 am
content: Reasons for not having floating CMOS inputs -http://www.rcl-radio.ru/wp-content/uploads/2014/11/SCBA004.pdfThe two primary ones are excess input structure current drain from Vdd to Gnd, and clearlylogic levels that are indeterminate due to AC noise coupling and non deterministic leakage.Regards, Dana.