Wake from EM2 using LFXO Ready interrupt

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero Employee</font></font> </a> BrianL on ‎06-12-2017 04:54 PM

Question

On EFR32 and EFM32PG devices, the CMU section states that the LFXO Ready interrupt can be used to wake the device from EM2. However, the EMU section does not state that this is an available wake-up source. Can the LFXO ready flag wake the device from EM2?

Answer

Yes. The EMU  wake-up table has erroneously omitted the LFXO ready interrupt as an EM2 wakeup source. As an example, this firmware can demonstrate this feature:

 

 

#include "em_device.h"
#include "em_chip.h"
#include "em_cmu.h"
#include "em_emu.h"

void CMU_IRQHandler(void)
{
  CMU_IntClear(CMU_IFC_LFXORDY);
  CMU_IntDisable(CMU_IEN_LFXORDY);
}

int main(void) {

  /* Chip errata */
  CHIP_Init();

  CMU_OscillatorEnable(cmuOsc_LFXO, false, false);

  // Enable LFXO ready interrupt
  CMU_IntClear(CMU_IFC_LFXORDY);
  CMU_IntEnable(CMU_IEN_LFXORDY);
  NVIC_EnableIRQ(CMU_IRQn);

  // Enable LFXO, don't wait for it to be ready
  CMU_OscillatorEnable(cmuOsc_LFXO, true, false);

  // Enter EM2 until LFXO is ready
  EMU_EnterEM2(true);

  /* Infinite loop */
  while (1) {
  }
}

 

Here is the AEM measurements from this code running. As you can see, the device goes into EM2 while the LFXO is turning on, and wakes when the LFXO is ready:

 

PG1_EM2_LFXORDY_wakeup.PNG