I have a project targeting the MKL03Z32 that goes into deep sleep VLLS3 and wakes from LLWU_P4. I want to keep accurate track of time, so the RTC unit is enabled during both wake and deep sleep. This all seems to work as expected.
The only hiccup is that it seems that when the micro wakes from VLLS3 it turns of the RTC bit in SIM->SCGC6 which turns off the clock to the RTC module. As a result, the RTC stops.
I currently set a bit in the System File Register (which keeps state through this wake event) that is set once the RTC is configured the first time and then I manually turn on the RTC bit in SIM->SCGC6 as one of the first things in the main loop.
This does function but the RTC is turned off for a small amount of time every time it wakes and thus my timing is accumulating error. Is there a way to keep the RTC clock enabled during a wake event?
If it matters, I'm using an external crystal as the source for the RTC.
Thanks in advance,