Wakeup from LLS mode on K60

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

Wakeup from LLS mode on K60

ソリューションへジャンプ
1,924件の閲覧回数
danielchai
Senior Contributor I

Hi All,

I have a question about wake up from LLS mode. I read the manual of K60 and it said it can be wake up from LLS using wakeup pin or wakeup module. And I read the demo code uses timer to wake it up. My question is how could I wake up system from LLS using wake up pin such as PTE2, PTE4..

Thank you.

-Daniel

1 解決策
1,550件の閲覧回数
chris_brown
NXP Employee
NXP Employee

Hi Daniel,

Here are the general steps you will want to follow to get that to happen:

1) Make sure the pin you want to use is an LLWU pin listed in the LLWU input table in chapter 3 (it looks like PTE2 and PTE4 are for the K60).

2) Configure the pin you want to use for a digital function (any digital function should work, but personally, I recommend using the GPIO function).

3) Configure the pin in the LLWU pin enable register (it looks like these should be LLWU_P1 and LLWU_P2 respectively).  The pin enable registers are LLWU_PEx.  Consult the reference manual for which pin is controlled by which register. 

4) I would also recommend enabling the LLWU interrupt in the NVIC.  You can then check to see which wakeup pin woke you from LLS using the LLWU_Fx registers.  Remember to clear the flag before leaving the interrupt routine. 

That should be it.  :smileyhappy:

~Chris

元の投稿で解決策を見る

0 件の賞賛
返信
6 返答(返信)
1,550件の閲覧回数
jvasil
Contributor III

Chris's answer is the first place I've seen the NVIC mentioned in the context of the LLWU interrupt.  Every other place I've read about this--including multiple Freescale application notes--just say "enable the LLWU interrupt."  Since the NVIC is disabled while in LLS (& VLLSx) mode, it is very counter-intuitive to have to enable this ISR in the NVIC!  I'd reached the conclusion that this is what the app note comment meant earlier today but it is nice to read this comment that makes me more positive about expecting a positive outcome when I try coding this tomorrow!!

James

0 件の賞賛
返信
1,550件の閲覧回数
mjbcswitzerland
Specialist V

Hi James

Please see http://www.utasker.com/kinetis/LLWU.html

The NVIC is needed some "some" of the LLWU modules but not for the LLWU pins.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 件の賞賛
返信
1,551件の閲覧回数
chris_brown
NXP Employee
NXP Employee

Hi Daniel,

Here are the general steps you will want to follow to get that to happen:

1) Make sure the pin you want to use is an LLWU pin listed in the LLWU input table in chapter 3 (it looks like PTE2 and PTE4 are for the K60).

2) Configure the pin you want to use for a digital function (any digital function should work, but personally, I recommend using the GPIO function).

3) Configure the pin in the LLWU pin enable register (it looks like these should be LLWU_P1 and LLWU_P2 respectively).  The pin enable registers are LLWU_PEx.  Consult the reference manual for which pin is controlled by which register. 

4) I would also recommend enabling the LLWU interrupt in the NVIC.  You can then check to see which wakeup pin woke you from LLS using the LLWU_Fx registers.  Remember to clear the flag before leaving the interrupt routine. 

That should be it.  :smileyhappy:

~Chris

0 件の賞賛
返信
1,550件の閲覧回数
danielchai
Senior Contributor I

Hi Chris,

One more question is that when I configure the pin in LLWU pin enable register, do I have to use

LLWU_PE1 = LLWU_PE1_WUPE0(0x02); // defining PORT E1 as a wakeup source for LLWU

or there is some library function I can call from user level?

Thank you.

-Daniel

1,550件の閲覧回数
Premjee
Contributor II

Hello Daniel,

                    If you are still having problem getting the LLWU source, I believe ARM does a memory clear when waking up from LLS/VLLS, you will need to reserve some memory space by offsetting it in the build section of component inspector for the CPU, and storing the wake up source in that location

Cpu_OnLLSWakeUpINT(void)

{

/* Write your code here ... */

LLWU_Source = Cpu_GetLLSWakeUpFlags();

/* release ACKISO */

if (PMC_REGSCPMC_REGSC_ACKISO_MASK)

{
PMC_REGSC |= PMC_REGSC_ACKISO_MASK;

}


}


1,550件の閲覧回数
danielchai
Senior Contributor I

Hi JEEVAN,

That helps.

Thank you.