Hello,
I'd like to detect a power failure and keep the nRF52840 alive using for example a super capacitor.
From the hardware side, is it ok to just feed the nRF52840 through a diode to the pins VDDH and VDD with 3.3V and connect a super capacitor though a resistor? If the power fails then the super capacitor keeps up the voltage at VDDH and VDD (through the resistor) while the rest of the circuit gets no power due to the diode. Additionally I have a signal indicating power failure connected to an IO pin and of course a 32768Hz crystal.
From the software side when I detect the power failure signal, what steps do I have to take to minimize power consumption while RTC still runs? I already read that I have to switch off all peripherals such as UART and RADIO and then use WFI/WFE instructions. Do I have to change the POWER configuration, for example switch from DC/DC to LDO in REG1? Does the CLOCK need some configuration to ensure the 64MHz clock is switched off? Do I understand it correctly to use the ION_RAMON_GPIOTEPORT mode form the Sleep table (System ON, full 256 kB RAM retention, wake on GPIOTE PORT event) and can even lower power consumption by retaining only some of the RAM.
Thanks,
Jochen