Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

still learning (newbie)

Status
Not open for further replies.
pull up and pull down resistors are just used to make sure that there is a know state on an input pin, instead of being left to float.

Here is an example of a pull up resistor:

Untitled.png

you can see that when the button isnt pressed the input pin is pulled high to a know state and if it is puched the input pin goes to 0v. its the same for a pull down resistor. it took me a while to understand lol
 
ID like to know how you would find out the voltage on the input pin ? becuase it cant be VCC
 
sir, thank you for the reply. actually, there is still, another problem. i still don't know how to read or understand circuits. i am really sorry sir, i just want to learn.
 
so if that switch is open sir, would the input pin read high? does the command of that pin depend on what i program on my microcontroller?
 
lol dont worry ive asked this exact question befor on here, you might wana look for that explanation :) but yea if the switch is open it will read high and depening on what you programe on micro for e.g. if pin goes low then do this, its best to have a pull up resistor on there to make sure your allways in a state that you know.

So the code for Micro could be if button pressed i.e. go low then do this. the same is for pull down resistors. if you leave a pin floating you get things like induced noise and voltage spikes on it which you could end up reading a wrong state?

Has this helped ?
 
Pull up resistors seem to be more common, I think it goes back to the old days of rtl, with most micrcontrollers pull up or down will work.
Dont forget if your writing code to look at an input switch to have some kind of anti repeat, your code will service the switch input repeatedly very quickly if you dont, I usually look for a change on a port by subtracting the last sampled value with the current one.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top