For this switch setup to work, time delays even up to 50 ms is acceptable.
How do I calculate/estimate resistor values?
- R1: Gate pull-up for P-MOSFET. (defaults to P-MOS being OFF)
- R2: I don't know why it's needed or whether it's needed at all. (comment if you know.)
- R3: Limiting MCU output pin current (when charging the N-MOSFET gate capacitor)
- R4: Providing some resistance while the manual momentary-switch is held down. (limiting in-rush current before the P-MOSFET turns ON hard.)
- C1: making the P-MOSFET turn-on-time longer.
Datasheets images: (first two are of 45N03 N-MOSFET)