Microcontroller hangs while switching off
When you hold the button down and the micro drives the ON/OFF line low, there's a low-impedance path directly from the battery, through the I/O protection diodes on the SENSE pin of the micro, to its power bus &mdash; this is a very bad thing. There's another path through your external diode and the ON/OFF pin, too.

At the very least, you should have a resistor in series with each of the I/O lines to limit the current that can flow under this condition. But the micro may still be able to keep running on this low amount of current, so you'll need to augment your design in other ways, too.

The most direct solution would probably be to put the micro on the "always powered" side of the switch, and simply put it into a low-power "sleep" mode when the system is supposed to be off. This would actually simplify the external circuitry required.



EDIT: Actually, after I thought about it a bit more, I realized that you don't turn off the transistors until after the button is released, so the problem described above is only an issue if the button bounces on release &mdash; but if it does, the system will immediately power up again, or get hung in a half-on condition.

Is it a snap-action button, or something "mushier"?