[RTD600 IP] S32K3X4EVB-T172 LPCMP Wake-up

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[RTD600 IP] S32K3X4EVB-T172 LPCMP Wake-up

[RTD600 IP] S32K3X4EVB-T172 LPCMP Wake-up

This example project will show user how to use and configure the basic functionalities of WKPU + LPCMP. 

 ------------------------------------------------------------------------------
* Test HW: S32K3X4EVB-T172 (SCH-53148 REV B2)
* 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 & LPCMP units for wake-up. The S32K3XX's LPCMP can operate in trigger mode in both standby and run mode to continuously scan the input channels. RTC-API and LPCMP must be configured before entering into standby mode as per below shown figure:

Snag_13de950.png
 
See chapters 61.1.5 Comparator Trigger Mode & 61.1.6 Interaction with RTC API to cause wakeup from the S32K3XXRM (Rev. 12) for further information.
 
The register configurations before entering Standby mode for LPCMP trigger mode operation is the following:
 
  1. Configure RTC.APIVAL to set the period of the round robin operation.
  2. Execute standby mode entry.

The routine waits for SW5 to be pressed, then turns off the green LED, and enters Wkpu_EnterStandby() function which:

  1. Switches CORE_CLK to FIRC.
  2. Initializes the WKPU instance.
  3. Configures WKPU2 & WKPU42 (PTB19).
  4. Initializes and enables interrupt for LPCMP.
  5. Initializes RTC and sets the timer value (in RTCC - APIVAL) to 100ms.
  6. Starts timer.
  7. Enters standby (or fast standby).

While in standby, PTA0/1/2 are active; if a voltage higher than 2.5V is detected (ICU LPCMP DAC Voltage Level = 127), or SW6 is pressed MCU will wake-up. 

After wake-up, MCU resets and polls for SW5 to be pressed again.

The RTC timer value can be changed with RTC_PERIOD_DELAY_MS(x) macro defined in Wkpu.h.

This example is provided as is with no guarantees and no support.

Attachments
No ratings
Version history
Last update:
‎01-14-2026 01:56 PM
Updated by: