Microcontroller › 8051 › pull up resistor
- This topic has 23 replies, 15 voices, and was last updated 8 years, 3 months ago by
Anonymous.
-
AuthorPosts
-
May 14, 2012 at 5:50 am #7776
AJISH ALFRED
ParticipantRegarding pull up/pull down basics,
A controller pin can be used for two purposes, to give an output and to take an input. So pull up/pull down resitors are used for both input and output configuration of a pin.
Suppose the pin is set as input;
If our input device give a 5V, the controller detect a logic 1 at the input
If our input device give a 0V, the controller detect a logic 0 at the input ( I’m talking about ideal conditions )
Assume if the connection to the input device somehow got interrupted, and the device is no longer attached to the input pin. In such a case we have neither logic high nor logic low at the input pin, and the controller can’t decide which logic should be read in.
To avoid such conditions we set a default value at the input pin using pull up/pull down resistor. If we pull up the pin the default value at the input pin will be logic 1, and if we pull down there will be a default input value of logic 0, no matter wheather there is an input device present or not.
Now suppose the pin is set as output;
You know, we just can’t directly drive a relay, buzzer etc. using microcontroller, because the controller dosen’t have that much current sourcing power. So we use a low value pull up resitor at the output pin to directly drive the device using VCC, and if we want to turn off the device, we just give a 0V as output and all the current through the resistor will be sinked into the controller.
We decide wheather to use pull up or pull down at the output pin depending upon the internal circuit design of the pin, mainly its current sinking and sourcing power.
May 14, 2012 at 5:50 am #7793AJISH ALFRED
ParticipantRegarding pull up/pull down basics,
A controller pin can be used for two purposes, to give an output and to take an input. So pull up/pull down resitors are used for both input and output configuration of a pin.
Suppose the pin is set as input;
If our input device give a 5V, the controller detect a logic 1 at the input
If our input device give a 0V, the controller detect a logic 0 at the input ( I’m talking about ideal conditions )
Assume if the connection to the input device somehow got interrupted, and the device is no longer attached to the input pin. In such a case we have neither logic high nor logic low at the input pin, and the controller can’t decide which logic should be read in.
To avoid such conditions we set a default value at the input pin using pull up/pull down resistor. If we pull up the pin the default value at the input pin will be logic 1, and if we pull down there will be a default input value of logic 0, no matter wheather there is an input device present or not.
Now suppose the pin is set as output;
You know, we just can’t directly drive a relay, buzzer etc. using microcontroller, because the controller dosen’t have that much current sourcing power. So we use a low value pull up resitor at the output pin to directly drive the device using VCC, and if we want to turn off the device, we just give a 0V as output and all the current through the resistor will be sinked into the controller.
We decide wheather to use pull up or pull down at the output pin depending upon the internal circuit design of the pin, mainly its current sinking and sourcing power.
May 15, 2012 at 7:35 am #7817Amrith
ParticipantHello All,
Really a nice and basic topic to discuss, every one did very well in explaining the reason for pull up resistor.
Can we do the same with another intresting topic,
The topic is about “Signal Integrity“. Kindly find the new post on this topic and discuss the same there.
July 2, 2012 at 11:55 pm #8182Anonymous
GuestIf there is internal pull ups to port 1, 2, 3 , then why we connect external pullups to port 1, 2, 3?????? and what happend if there is not????
April 19, 2013 at 2:41 am #9516shankar
ParticipantWhen PORT 0 is used for input operations, both the FETs are open, that means the point is at high impedance so to pull it to Vcc, the pull up register is used. For the better understanding of PORT 0 and the concept of Pull up registers check this out.
https://www.youtube.com/watch?v=t9bN-2nFNEs
Thank you.
July 18, 2013 at 5:41 am #10160Narendra Krishnavanshi
ParticipantDoes Port 2 require any pull up resistors if we use it as output lines ?
July 18, 2013 at 7:09 am #10161AJISH ALFRED
ParticipantHi Narendra,
It depends on the application that you have to decide whether to use or not to use the pull up resistors. I suggest you to always try to use a pull-up or pull-down resistor with a pin when you are using it as input. There might be internal pull-up resistors and if you are not using the external pull-up you must configure the internal pull-up properly which is associated with the pin.
April 24, 2015 at 8:26 am #12827narayan gour
Participanti have microcontroller board from my …in this borad simple microcontroller require peripheral (reset ckt,crystl oscilator.reisster etc).bt difficulty is this ckt having one more pullup registers are attached on all port…(means by default pullup is there on port 1,2,3 bt again pullup r connected on all port ,0,1,2,3,)..if i want zero or 5v on output …what i need to provide logic in my c code so i will able to get output according to my programing …means if i want high logic on output what i have to give logic in program …thanks and plz rply..
November 15, 2016 at 5:02 am #14242Anonymous
GuestTo summarize if a port is open drain (or open collector) then that port connects to GND for logic 0. For logic 1 the circuit remains open. This enables connecting a relay, designed to be operated at 12 volt, to port 0 pins even though the chip is working at 5 volt.
This way output load is activated when there is logic 0 on the pin. In case internal load resistors are present then external load will be off for logic 0. This will keep the current to flow through the pull down transistor. This is one disadvantage of having the pull up resistor.
-
AuthorPosts
- You must be logged in to reply to this topic.