Newbie level 4
A rough sketch of the circuit is attached.
I'm designing a circuit with the following requirements:
I need switch activated powering of a small microprocessor with a power budget of around 100mA.
Power is activated by holding in the switch for 2 seconds.
Power is deactivated by holding in the switch for 2 seconds.
While power is activated, the switch will function as an input to the microprocessor.
I imagine a starup sequence like this:
1. The switch is pushed in and held in.
2. The processor recieves power through the switch, and starts a timer.
3. When the timer hits 2sec the processor pulls up the PWR pin.
4. The switch is released and the processor now supplies itself through the MOSFET.
While the processor is active, an input should work like this:
1. The switch is pushed and the SWITCH signal goes high.
2. The processor activates a timer.
3. The switch is released before the timer reaches 2sec and the processor knows it was not a poweroff command.
My question is now, am i missing something? Are there any best practices for designing such a circuit?
I have been unable to find a circuit that meets my demands using google.
I plan on using the processor timer for debouncing of the input signal also. Obviously a bouncing during powerup will cause the sequence to restart. I cant see that this should be a problem.