for my phone project i'm trying to find a solution for the power on/off management.
A 3.7V battery powers my ATmega328 as well as a SIM A7670E Module.
I want to turn it on and off with just one button. I'm thinking to use a latch circuit, which works perfect for turning it on. But for the turnoff, i can't just power my modules off. The SIM module states:
Here's a circuit that uses the MCU as the latch, with the button performing double duty to trigger power-up as well as be an input after that. Maybe something there will be useful.
That would mean i'd have to keep pressing the button until the ATmega's output is enabled (about 2s if the internet didn't lie), or else the gate will get immediately pulled up to V+ again, right?
Is it fine to just cut the power of the Arduino/ATmega328 or do i need to command it to shut down as well?
That's right. If it takes two seconds, that probably wouldn't be a practical solution. But if your processor is running on a battery, and not connected to USB, it should boot up much faster. It's the communication with USB that takes a lot of time. What I've done in the past is to light up an LED so you can tell it's safe to release the button.
When you're ready to shut down, either because the button has been pressed again or because you've finished doing what you need to do, you just change the GPIO powering the transistor from HIGH to LOW output. Then the transistor will shut down, which in turn shuts down the mosfet, and the power shuts down.
Mine is the same circuit shown in post #4, except that the NPN transistor can be an N-channel mosfet if you prefer.
Yes, but i meant if it is safe for the ATmega328 to shut down by just cutting the power? Other chips like the before meantioned SIM Module do no like that (possible damage to flash, according to the hardware design sheet).
Good point.
I already bought this programmer and this adapter socket in order to get an arduino bootloader onto the raw chip.
Do i understand it right that if i want to drop the bootloader, but still use the Arduino IDE as programming environment, this programmer will not be working?
And i have to use an Arduino UNO or likewise as a programmer in between?