This example project will show user how to use and configure the basic functionalities of WKPU + GPT RTC API.
------------------------------------------------------------------------------
* Test HW: S32K3X4EVB-T172 (SCH-53148 REV B2) or S32K344MINI-EVB
* MCU: S32K344
* IDE: S32DS3.5 & S32DS3.6
* SDK release: RTD 6.0.0
* Debugger: PE Micro
* Target: internal_FLASH
------------------------------------------------------------------------------
This example routine configures the WKPU & RTC units for wake-up. The RTC is present in always ON domain, hence available in RUN mode as well as in STANDBY mode.
Julin_AragnM_0-1771625665539.png
The chip contains one instance of RTC (Real Time Clock) timer and API (Autonomous Periodic Interrupt) timer, where both can perform 32-bit comparisons. Both RTC and API timers can generate interrupts as well as wake-up from low power modes.
The following figure highlights the path for RTC API wake-up. Please refer to Chapter 69.3.2 API functional description from the S32K3XX reference manual (Rev. 12) for further information.
Julin_AragnM_1-1771625661011.png
The routine waits for SW5 to be pressed, then:
- Turns off the green LED
- Switches CORE_CLK to Option C - Boot Standby mode (CORE_CLK @ 24 MHz).
- Initializes the ICU driver.
- Configures RTC_API channel (WKPU0)
- Initializes GPT module.
- Starts timer and sets RTC_API_TIME.
- Enters standby.
After the period defined, RTC API generates an interruption and MCU wakes up. After wake-up, MCU resets and polls for SW5 to be pressed again.
The RTC API value can be changed with RTC_API_TIME definition.
This example is provided as is with no guarantees and no support.