I'm using the MKL05Z series and currently go into a sleep mode (LLS) when the voltage on the microcontroller drops below my Low Voltage Warning threshold. I need to exit my low power routine when power is restored to the device. My current method of doing this is to periodically wake up every 64ms, check the state of low voltage warning flag, clear the flag, increment a counter. If the LVW flag is still set, I re-enter sleep mode. However, if the flag is not set, it must mean the power is restored and I exit sleep mode and continue on with the tasks in the code.
This has worked okay for what I need. However, periodically waking up every 64ms over an allowed period of 3 seconds has two negative effects, which I am trying to clean up:
1) The current leakage on my costly capacitor is enough to warrant a 100µF capacitor, which must be small, ceramic, and cheap..... If I did not have to periodically wake up to poll the LVW flag, I could get away with a lower value on the cap and much cheaper.
2) If power is restored to the device and the microcontroller detects it 63ms later, it causes undesired delays.
What I would absolutely love is if the microcontroller had the ability to wake on a rising voltage threshold in a similar fashion that a falling threshold is set for the low voltage warning. This has the benefit of exiting sleep mode when power is restored without the need for additional components such as those that would be needed for even a LLWU detection. I'm hoping someone can tell me that there is already a way to achieve what I am looking for (wake upon rising voltage threshold) as if there was some secret feature that never made it to the user manual.... Or am I the only one in the world who would want to wake up the microcontroller when voltage has been restored to the device???