Is this the logic you're aiming for?
ATmega | Battery-chip | MOSFET |
---|---|---|
Hi | X | Off |
Lo | Hi | On |
Lo | Lo | Off |
Off | Hi | On |
Off | Lo | Off |
In this case the simplest thing to do would be to program the ATmega so that the "Lo" output is high-impedance (do this by setting the pin as an input and setting the state as LOW). Then connect the battery-chip's output to the ATmega's output via a resistor, and connect the ATmega's output to the MOSFET gate.