I want to use the ESP32 built-in RTC clock. In my situation, my ESP32 will not have access to an NTP server I do not want to use external RTC modules
ESP32 provides a pin VDD_RTC will powers the RTC domain exclusively My problem would be solved if I attach a coin cell to this pin. In this case, in the event of a brownout, the VDD_RTC will be powered and RTC clock preserved.
But, all dev kits I have seen seem to have VDD_CPU, VDD_DSIO and VDD_RTC connected together So, if I would use a battery or some sort of small ups to power my ESP32 during brownout, it will be depleted by the use of GPIOs and CPU and other functions.
Solution would be here to detect brownout and force ESP32 to go to deep sleep, and then wake it up after brownout. But this would require an external source attached to a ESP32 pin to trigger deep sleep, and I don't see any pin to trigger it
Maybe I could have a circuit that would give me a signal when there is a brownout. I could attach this signal to a GPIO pin and trigger an interrupt that makes ESP32 go into deep sleep
But it seems too much for something that I am sure is super basic and should be implemented already somehow in a more convenient way
Could anyone share with me any experiences of how to preserve RTC using minimum external circuitry?