How to shutdown the entire system after certain time period?
The circuit below should bootstrap the controller in the manner you describe. When the circuit first turns on and 3V is applied, a pulse of 3V will pass through C1, which should be enough to start the boost converter and produce 5V at the output. Once this has happened, R1 weakly pulls up the EN signal to the 5V output which now exists (magic!).

Since the Atmega16's outputs default to high impedance (check the datasheet) it will be out of circuit effectively, and R2 limits any current from the initial bootstrap pulse possibly damaging the Atmega16 (as it is unpowered when the pulse occurs, which puts it outside of recommended absolute maximum ratings).

Once you are ready to shut down, simply set DIO as an output and write a digital LOW to it - this will disable the boost converter and when the Atmega16 shuts down there will no longer be any voltage on the EN pin (as there is nothing to provide it except C1, which is now charged and hence will not provide the pulse). In order to start the circuit again, you need to remove the 3V, wait a second or two and then reapply it.






Please note that the values are approximate (I used them to do this in the past with an MCP1640T) and you will need to check the TPS61240 datasheet to ensure that 3V on the EN pin will be enough to start it up.