20. Design pull-up input

Switch SW1 is used as an input to a controller operating at VCC = 3.3 V.

Design a circuit so that:

  • When SW1 is open, GPIO_IN = 3.3 V.
  • When SW1 is closed, GPIO_IN = 0 V.
  • Current I_SW is approximately 0.33 mA when closed.

Example test cases:

SW1Expected GPIO_INExpected I_SW
Open≈3.3 V<1 µA
Closed≈0 V≈0.33 mA