I'm trying to use the RTC to wake up the KE06 uP from Stop Mode. It says the RTC alarm interrupt will start the AWIC which in turn triggers the clocks to start running The NVIC then takes over to service the interrupt. However, there is no alarm interrupt in the user guide, just the RTIF interrupt. I have the RTC_SC RTIF and RTIE bits both set.
In stop mode, the NVIC is in static state. The platform clock runs the AWIC, but the pllatform clock is stopped in stop mode. So how can you get the RTC to wake up the processor? I'm using the internal clock source and the FFL to run the uP.
the alarm interrupt is rtc interrupt. The primary function of the Asynchronous Wake-up Interrupt Controller (AWIC) is
to detect asynchronous wake-up events in stop modes and signal to clock control logic to resume system clocking. After clock restart, the NVIC observes the pending interrupt and performs the normal interrupt or event processing.
The RTC in the KE06 can be used to 'periodically' wake the processor from STOP mode. It is really only a 16 but timer but, when using a slow clock and high clock divider, can allow quite long periods - of course the period setting can be modified each time to emulate it firing at a certain time in the future (although not necessarily with high precision).
You also need to ensure that the chosen clock source is operation in STOP mode.
Attached is a binary file for the FRDM-KE06Z board which shows time keeping implementation on the KE06 (on VCOM interface of OpenSDA at 115'200 Baud, go to the "admin" menu to find commands for setting time and date, viewing present time and setting alarms. The present low power operating mode can be requested with "show_lp" and changed using "set_lp")
uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)
Low Power Wake-up
I think I may have figured it out.
One of the functions I call from my RTC interrupt routine runs longer than the interrupt time sometimes.
If the interrupt flag in the RTC status register is already set when I put the uP to sleep, will it fail to wake up?