low power mode and pwm with TPM

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

low power mode and pwm with TPM

1,046 Views
tuomasaaltio
Contributor II

I need to generate PWM and keep cpu in low power mode. Is it possible to wake up at time overflow interrupt and then put cpu to stop mode?

Labels (1)
0 Kudos
5 Replies

849 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi tuomas aaltio,

     I don't know which chip you are using, now take MKL25 as an example:

pastedImage_1.png

You can find in the STOP mode, async operation, the TPM is full function in PSTOP2, it can generate PWM if you don't use the interrupt. If you use interrupt, the STOP mode will be wake up.

 pastedImage_2.png

Wish it helps you!


Have a great day,
Kerry

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

0 Kudos

849 Views
tuomasaaltio
Contributor II

current consumption is too large in partial stop 2 mode. I tried partial stop mode, but seems to be that tpm interrupt doesn't wake cpu up. Shoud it be possible to use tpm interrupt to wake us from stop mode ?

0 Kudos

849 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi tuomas aaltio,

    Yes, the TPM interrupt can wake up the stop mode:

pastedImage_1.png

pastedImage_2.png

But take care, you must make sure, the clock which you are using for TPM can still work in the stop mode.

Wish it helps you!


Have a great day,
Kerry

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

0 Kudos

849 Views
tuomasaaltio
Contributor II

I got it working with

OSC0->CR |= OSC_CR_EREFSTEN_MASK;

0 Kudos

849 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi tuomas aaltio,

  Please check these information from the reference manual:

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

pastedImage_1.png

So, you can use MCGPLLCLK with PLLSTEN=1, MCGIRCLK with C1[IRCLKEN]=1 and C1[IREFSTEN] =1, or OSCERCLK with EREFSTEN=1.

Wish it helps you!


Have a great day,
Kerry

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