Reply
Posts: 2,801
Registered: ‎02-07-2002
Accepted Solution

Is LFXO ready a wakeup source or not?

Hi,

 

On and EFR32FG is the LFXO ready interrupt a wakeup source or not? The reference manual 12.2 seems to say so:

Wakeup interrupt based on LFRCO or LFXO ready, allowing to wait for low frequency oscillator startup while being in EM2 Deep-Sleep avoiding the need for polling.

 

But Table 11.3 makes no mention of the LFXO ready interrupt or the CMU.

Posts: 400
Registered: ‎02-21-2014

Re: Is LFXO ready a wakeup source or not?

Well, there's definitely an interrupt enable flag for LFXORDY, so it might have just been an omission from that table. I'll experiment with it and let you know my results.

Posts: 400
Registered: ‎02-21-2014

Re: Is LFXO ready a wakeup source or not?

It does seem like this works. Here's the code I ran:

 

#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) {
  }
}

I had to disable the LFXO, since it appears to be enabled by default (?). After that, I turn the LFXO back on and enter EM2 until an LFXO ready interrupt, which wakes the device. You can see the result here from AEM:

 

PG1_EM2_LFXORDY_wakeup.PNG

 

I'll put in a ticket to be added to the table you mentioned.

Posts: 400
Registered: ‎02-21-2014

Re: Is LFXO ready a wakeup source or not?

MCUAPPS-8201

Posts: 297
Registered: ‎09-18-2015

Re: Is LFXO ready a wakeup source or not?

Hey @BrianL,

 

Might you need to enable cmuClock_HFLE (I think that's the non-deprecated name or is it cmuClock_CORELE) since the LFXORDY signal might need to be synchronized between the HF and what is effectively an LF clock domains?

 

Just a thought...

 

John

Posts: 2,801
Registered: ‎02-07-2002

Re: Is LFXO ready a wakeup source or not?

Thanks.


BrianL wrote:

I had to disable the LFXO, since it appears to be enabled by default (?).


I think I also saw something like that. I haven't checked LFXOENS out of reset yet, but the reference manual says it should be 0.

 

And if the LFXO really is already enabled, can I trust it?

Posts: 2,801
Registered: ‎02-07-2002

Re: Is LFXO ready a wakeup source or not?

After a reset the CMU_STATUS has the following bits set to 1:

HFRCOENS (expected)

HFRCORDY (expected)

LFRCOENS (surprise)

LFRCORDY (surprise)

LFXOENS (surprise)

LFXORDY (surprise)

 

And when I route these two clocks to a pin I can see them oscillating. I think some errata are required here.

Posts: 2,801
Registered: ‎02-07-2002

Re: Is LFXO ready a wakeup source or not?

@BrianL @JohnB

I'm referencing you in this reply to create a bit more emphasis on this:

I think some errata are required here.

Posts: 400
Registered: ‎02-21-2014

Re: Is LFXO ready a wakeup source or not?

I think you're right. I put in an internal ticket to look at this, either for a doc change or an errata: MCUAPPS-8211