A very basic question:
Must each IO pin of a microcontroller that is serving as an input from a switch or jumper have its own pull-up/down resistor?
In this example, each pin is pulled down by a resistor, then pulled up by a 1P3T switch to VCC.
It seems straightforward, but as more IO pins are used, are more resistors absolutely required? Is there some clever way to keep the resistor count down?
Related question: Sharing a pull-up resistor
Best Answer
As per the schematic provided, if all 3 inputs were sharing a resistor, then any of the lines being pulled high via the switch would raise all 3 lines to high, countering the purpose of the design - the MCU would not know which switch position is selected.
A common way of reducing part count, not resistor count, for such designs is to use a common bus resistor network or array:
(from here)
These are available as through-hole SIP/DIP as well as SMD, in a variety of resistor counts, depending on your needs. The bus pin is connected to ground, and the other pins are connected to the respective MCU inputs as in your schematic. (from here)
(from here)