I have a circuit that uses a PIC micro-controller to enable the batteries. So when the user turns it off, the PIC 'commits suicide' by disabling the batteries so that no current is drawn anymore. Now no devices have power. So when the batteries are not enabled, I have to use a SPST power switch, that shorts one side to ground, to somehow send battery power to the circuit to wake up the PIC and allow it to enable the batteries and sustain life.
The troubling requirement is that the switch is grounded. So I can power the other side and use a P-Channel MOSFET to enable the batteries when the switch is grounded. I've attached a diagram of this. But the MOSFET stays on no matter what, I can't get it to stop sending battery voltage into the circuit. Please help with any advice or alternative ideas to get this circuit to disable the battery voltage to the circuit when the switch is not pressed.
*I have to use a voltage divider because the PIC is also connected to side 2 of the switch - to know when it is pressed. The batteries range from about 3.8 to 6.2 volts and the PIC can't handle more than ~6V.
The troubling requirement is that the switch is grounded. So I can power the other side and use a P-Channel MOSFET to enable the batteries when the switch is grounded. I've attached a diagram of this. But the MOSFET stays on no matter what, I can't get it to stop sending battery voltage into the circuit. Please help with any advice or alternative ideas to get this circuit to disable the battery voltage to the circuit when the switch is not pressed.
*I have to use a voltage divider because the PIC is also connected to side 2 of the switch - to know when it is pressed. The batteries range from about 3.8 to 6.2 volts and the PIC can't handle more than ~6V.