Interrupt in Low power Mode (using LLWU pin as a interrupt pin)

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

Interrupt in Low power Mode (using LLWU pin as a interrupt pin)

2,410 Views
Embionics
Contributor III

Hello,

I am working with freedom KL25Z for low power modes testing.

I have tested normal stop mode

In this mode controller goes into stop mode when i am giving interrupt it is getting out off stop mode and while loop is executing where i have toggled the LED.

 

Now I am trying VLLS3 mode in PEx_low_power_demo code given by you at the start of this thread.

 

I have made following 3 changes to that code as

1) at power on Green LED will Glow.

2) Before entering into VLLS mode turn off green and turn on Blue LED.

3) When Come out off VLLS3 mode turn off blue LED & RED LED will Toggle Continuously.

 

As per my understanding, before entering into VLLS we have to set PTD6  LLWU pin  for interrupt.

To do this, I set PTD6 as GPIO with interrupt disable, set PTD6 a input pin and then

enable and select the falling edge detect type for the external wake up input pin PTD6.

 

In  event "Cpu_OnLLSWakeUpINT", I set LPTMR access enable.

Also set  TCF,TEN,TIE bits in LPTMR0_CSR as LPTMR is enable.

 

I am considering that when I am giving falling edge at PTD6 the toggling of RED LED should work.

But the code is not coming out off VLLS3 As toggling of RED LED is not occurred & only BLUE LED is ON.

 

Is it right method to test VLLS3 mode?

I have also attached the code. Please suggest if there any modification require to it.

 

Thanks,

Amreen

Original Attachment has been moved to: PEx_low_power_demo(1).rar

0 Kudos
Reply
8 Replies

1,344 Views
EmilioBrivio
Contributor III

Hi Amreen,

Pay attention that the demo of VLLS3 has some printf that will never occur (a printf after entring VLLS3 mode will never appear on your console /terminal ). When you wake up from VLLS3 you start from the reset flow ( but with RAM preserved -- pay attention to all register and hw settings that must be rewritten  --- ). That means that you need to check the register (like here  if (! ( (PMC_REGSC & PMC_REGSC_ACKISO_MASK) == PMC_REGSC_ACKISO_MASK) )    ) to avoid that the start up routine clean your ram area (the ones automatically created and in the sample code  these lines and control must be added in __arm_start.c  before RAM clean action ) . Otherwise you have low power consumption but your code will start from the beginning and you never known what you have to do...remember that all GPIO port and all register must be set again before cancel the ACKISO.

I modify the demo to work in a way that wake up properly and the ram is reserved. Please try this one. And give a look at the code.

https://dl.dropboxusercontent.com/u/72140558/KL05_VLLS3_wakeupPTA7.zip

Regards,

Emilio.

0 Kudos
Reply

1,344 Views
Embionics
Contributor III

Hello All,

My requirement is processor should not RESET after wake up.

I tried LLS mode and PTD6 (LLWU ) pin for wakeup .

I it working fine.

I want to set the PTD 6 pin as a External interrupt with LLWU So that when rising edge occurred ot PTD6 the cpu should wakeup from LLS mode and execute external event.

When in RUN mode(After Wakeup) and rising edge occurred at PTD6 it should execute same external interrupt event.

Is it possible to use a pin as a external interrupt and also set as LLWU pin in CPU setting?

I tried this i made PTD6 as External interrupt as well as LLWU Pin.

When i given rising edge it i coming ot off LLS mode but not executing external interrupt event.

Regards,

Amreen

0 Kudos
Reply

1,344 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Amreen,

I think it should be ok to do that, but PE doesn't support to configure one pin as External interrupt as well as LLWU wakeup resource. so you have to do part of the settings manually.

result.png

Please kindly let me know if you have any further issue.


Have a great day,
Kan

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

0 Kudos
Reply

1,344 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Amreen,

Are you referring to the PEx low power demo from KL25_SC? I am not sure which revision is on your hand? Actually the latest is Rev 10, so would you please help to confirm?


Have a great day,
Kan

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

0 Kudos
Reply

1,344 Views
Embionics
Contributor III

Hello Kan,

Yes i am referring PEx low power demo from KL25_SC.

I am working with Rev3.

But now i have downloaded latest rev 10.

It seem that PEx low power demo code is same in both rev.

I will also try the code "low_power_demo" code from Rev 10.

Thanks

-Amreen

0 Kudos
Reply

1,344 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Amreen,

Actaully I can not unzip your demo , seems this file is corrupted . so I can only go thru your description of the implementation, It seems fine, but I am not sure which platform you are using, if you use FRDM-KL25Z, please note the PTD6 has no external pull-ups, so you have to enable the internal pull-up as you configured this pin as falling edge interrupt.

Please kindly let me know if you have any issue.

Have a great day,
Kan

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

0 Kudos
Reply

1,344 Views
gibbon1
Contributor III

I can't really go over your code, but try LLS mode instead of VLLS3 and see if it works.

Note the data sheet says that the processor exits VLLS3 via 'Wakeup Reset'  so code execution follows the reset path after wake up.

LLS exits via an 'interrupt', so code execution continues as normal.

Failing that try VLPS (uses the AWIC to wake up the up)

0 Kudos
Reply

1,344 Views
Embionics
Contributor III

Hello Matthew,

I have tried VLPS mode and it working with my code.

I want to work with mode require lower power than VLPS.

In my code  when i entered into VLLS3 mode and after giving interrupt at LLWU pin(PTD4) my processor is not getting RESET or doing anything.

My requirement is processor should not RESET after wake up.

As you suggested i will LLS mode.

I will let you know the status.

Thanks

0 Kudos
Reply