Pull up/ Pull down resistor

pulldownpullup

I am using an external pullup resistor on my input pin, and a switch connected to GND. It is like in the picture below. In the below picture, when the switch is open, the MCU input pin will see a logical high. I want to reverse this condition and see a logical high when the switch is closed. Should I use an internal pull up or pull down resistor to accomplish this? Also, what will happen if I use a pull-up? What will happen if Vcc is connected to Vcc or GND is connected to GND. I am really confused.

Regards,
Karan.enter image description here

Best Answer

To reverse your logic you just need to reverse the pull up and make it a pull down.

schematic

simulate this circuit – Schematic created using CircuitLab