how to wakeup kl16 from vlps using uart0

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

how to wakeup kl16 from vlps using uart0

1,133 Views
edwincal
Contributor II

Hi All,

How do you wake up a KL16 from VLPS (Very Low Power Stop) mode using UART0?

We are using a MKL16Z128VFT4 and according to the reference manual, UART0  is in Async operation (fully functional provided you are still clocking it) in VLPS. Can I clock it using the LPO since it is the only clock available and still ON during VLPS mode?

Any idea is welcomed and will be much appreciated.

Thanks,

Edwin

Labels (1)
Tags (3)
6 Replies

880 Views
edwincal
Contributor II

Hi Mark,

Thanks for the info. However, our board has been made already.

We chose UART0 not realizing we cannot use it for wake up on edge (according to the reference manual below).

Wake up on edge is only available on UART1 and UART2.

pastedImage_1.png

That is why I posted my question on using UART0, if it can be done using UART0 (wake up from VLPS) then we don't need to re-spin our board.

Thanks,

Edwin

0 Kudos

880 Views
mjbcswitzerland
Specialist V

Edwin

UART0 will need to be clocked (as you know) so that it wakes the system with a reception interrupt.

You have the 4MHz fast IRC (as you also know) which has 3% tolerance in the KL26. If you can generate an accurate enough baud rate for your requirement (from 4MHz clock, 4..32 over-sampling and baud speed divider) you may be OK.
Alternatively, if you use a crystal/oscillator you can use a potentially higher speed from OSCERCLK (probably more stability over voltage and temperature too).

If you don't mind losing the first character(s) on wake-up you could use an inaccurate clock to get at least a wake-up interrupt and then switch to the normal setup.

Regards


Mark

880 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Edwin,

     1. How do you wake up a KL16 from VLPS (Very Low Power Stop) mode using UART0?

      You just need to know, the VLPS recovery method, you can find it from the reference manual:

pastedImage_1.png

It is the interrupt, so if you want to use the UART0 to wake up it, you just need to enable the UART0 interrupt, then when the UART0 happens, the MCU will be waked up.

2.Can I clock it using the LPO since it is the only clock available and still ON during VLPS mode?

  You need to check, whether the LPO can be the UART0 clock source:

pastedImage_2.png

You can find no LPO can be selected.

But don't worry, you can use the MCGIRCLK, this clock also works in VLPS mode.

3. Some sample code for you

   Actually, in our KL25 sample code, there has a UART0 DMA STOP wake up code, you can refer to it.

  Please download the code from this link:

https://www.nxp.com/downloads/en/lab-test-software/KL25_SC.exe 

The code folder:

 kl25_sc_rev10\klxx-sc-baremetal\build\keil\low_power_dma_uart_demo

Wish it helps you!

If you still have question about it, please kindly let me know.

Have a great day,

Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

879 Views
edwincal
Contributor II

Hi Kerry,

I assume that after the processor wakes up from an interrupt, that you have to revert back the original settings of the configuration registers (like MCG_C1, MCG_C2, SIM_SOPT etc..) prior to entering VLPS, right?

Edwin

0 Kudos

879 Views
edwincal
Contributor II

Thanks Kerry,

I will check it out.

Edwin

0 Kudos