The main difference is that in the first case, the logic level is high when the switch is closed, in the second, the logic level is low with a closed switch.
There's no preferred connection. It just depends on which logic level you want with a closed switch.
i was told tat the pull up connection is perferable then the pull down connection and have the advantage.
anyone can explain why and what is the advantage?
i was told tat the pull up connection is perferable then the pull down connection and have the advantage.
anyone can explain why and what is the advantage?
Pullup is the preferred method, and the one almost always used.
I've always presumed the reason is safety?, if you have a pulldown you're running the live positive rail to the switch, so a shortcircuit on that connection could short the entire supply rail. Using a pullup there's no possiblity of a suppy rail short, as you only have ground and a very low current feed from positive.