I have the following circuit to turn on the ATmega with a push button:
The idea is simple: a MOSFET opens and closes the path between the ATmega and GND.
Both the [push button] and [ATmega pin 17] go into an OR gate, which goes into the MOSFET gate.
Once the ATmega starts, pin 17 goes HIGH immediately, which keeps the fet gate HIGH and the fet ON after the button's released.
My problem is: with only VCC connected, the ATmega leaks current through the ports. Say, if I have an LED on pin 5, current will flow through:
VCC -> Pin5 -> LED+Resistor -> GND.
Which defeats the goal of completely killing power to the ATmega.
I thought about controlling the path between +5V and the ATmega's VCC, but due to the Vgs drop of the mosfet, I always get less than 5V at the source.