Problem in Wakeup from LLS mode using Wakeup timer

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem in Wakeup from LLS mode using Wakeup timer

ソリューションへジャンプ
681件の閲覧回数
Embionics
Contributor III

Hello

 

I am trying LLS mode for KL25Z freedom board.

To wake up from interrupt I am using wake up timer.

For this I m referring “PEx_low_power_demo “code from KL25_SC.exe

This code is working.

But when I prepare my own code with same CPU and timer setting my code is not working.

I compare generated files related to timer both are exactly same through my code is not working

I have attached my code in which RED led will continuously blink after coming out of the LLS mode.

Please let me know if any changes required in code or in setting?

 

Regards

Amreen

Original Attachment has been moved to: Sensor_Base_Code.rar

ラベル(1)
タグ(4)
0 件の賞賛
1 解決策
498件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Amreen,

      Thank you for your interesting in our product, I would like to provide service for you!

     I already checked your code, I find you missed some code when you are using the LPTMR as the wake up source.

    Please add some code in your events.c

    the Cpu_OnLLSWakeUpINT function should be like the following:

void Cpu_OnLLSWakeUpINT(void)

{

  /* Write your code here ... */

    SIM_SCGC5 |= SIM_SCGC5_LPTMR_MASK;

    LPTMR0_CSR |=  LPTMR_CSR_TCF_MASK;   // write 1 to TCF to clear the LPT timer compare flag

    LPTMR0_CSR = ( LPTMR_CSR_TEN_MASK | LPTMR_CSR_TIE_MASK | LPTMR_CSR_TCF_MASK  );

}

then when you run your code, you will find your red light will blinking after wakeup.

If you still not OK, please get the attached code, this is modifed by me based on your code.

Wish it helps you!

If you still have question, please contact with me !


Have a great day,
(my name)

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

元の投稿で解決策を見る

0 件の賞賛
1 返信
499件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Amreen,

      Thank you for your interesting in our product, I would like to provide service for you!

     I already checked your code, I find you missed some code when you are using the LPTMR as the wake up source.

    Please add some code in your events.c

    the Cpu_OnLLSWakeUpINT function should be like the following:

void Cpu_OnLLSWakeUpINT(void)

{

  /* Write your code here ... */

    SIM_SCGC5 |= SIM_SCGC5_LPTMR_MASK;

    LPTMR0_CSR |=  LPTMR_CSR_TCF_MASK;   // write 1 to TCF to clear the LPT timer compare flag

    LPTMR0_CSR = ( LPTMR_CSR_TEN_MASK | LPTMR_CSR_TIE_MASK | LPTMR_CSR_TCF_MASK  );

}

then when you run your code, you will find your red light will blinking after wakeup.

If you still not OK, please get the attached code, this is modifed by me based on your code.

Wish it helps you!

If you still have question, please contact with me !


Have a great day,
(my name)

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

0 件の賞賛