How to use AWIC on K21?

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

How to use AWIC on K21?

Jump to solution
2,019 Views
jimyang
Contributor II

Hello, I need to wake-up K21 from VLPS mode, use pin interrupts wake-up source. Any body know how to program AWIC to implement this? I can't find any register description on arm.com or k21 related documents...

Thanks!

1 Solution
1,538 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

As Luciano mentioned, it need to make sure there without any other interrupt source affection during enter into VLPS mode except PORTD interrupt.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

10 Replies
1,538 Views
jimyang
Contributor II

Fixed, thanks all~

0 Kudos
1,538 Views
mjbcswitzerland
Specialist V

Hi

The following may help: http://www.utasker.com/kinetis/LLWU.html

The AWIC is used by LLWU, whereby it is LLWU itself that needs to be understood by the programmer since the AWIC is not controllable; it is just there to do the actual internal work.


For K21s the following include LLWU (including all low power modes, such as VLPS) and pin wakeups:
- http://www.utasker.com/kinetis/TWR-K21D50M.html
- http://www.utasker.com/kinetis/TWR-K21F120M.html

Regards

Mark
Kinetis for professionals: http://www.utasker.com/kinetis.html

0 Kudos
1,538 Views
jimyang
Contributor II

Hi Mark,

I am using PTD5, not LLWU_Px pins, is it also support this pin to wake-up?

Thanks!

0 Kudos
1,538 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

NXP provides low power demo for customer reference.

Please check related board link to find related sample code:

TWR-K21D50M Sample Code.

TWR-K21F120M board LAB Code.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,538 Views
jimyang
Contributor II

Hi Ma Hui,

Thanks for your kindly reply!

We use K21F120M, so I downloaded and checked the board LAB code.

But I found it only use LLS power mode, and not use pin interrupts for wake-up.

Currently we use PTD5 pin as wake-up pin on our board, seems it can't set as LLWU_Px function.

Refer to "K21 Sub-Family Reference Manual":

Table 7-1, VLPS mode, "AWIC is used to wake up from interrupt"

Table 3-8. AWIC Stop and VLPS Wake-up Sources, "Any enabled pin interrupt is capable of waking the system"

So I really want to know if non-LLWU_Px pin interrupts can config as wake-up sources?

Thank you so much!

BR

Jim Yang

0 Kudos
1,536 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

In the TWR-K21F120M board LAB code low power example demo, it just need change to call enter_vlps() function to enter VLPS mode.

The PTD5 as wake up source should wake up the chip from VLPS mode. The VLPS low power mode doesn't need to using LLWU module, which just using general interrupt.

Could you let me know what's your K21 product part number and mask set?

You could find related info from chip surface.

Thank you for the attention.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,536 Views
jimyang
Contributor II

Hi Ma Hui,

I found these info from chip surface:

MK21 FN1M0V12 3N03G CTAV1445A

Actually I already config PTD5 as general interrupt, but when call enter_vlps() it will not block in this function, seems it exit VLPS mode immediately.

Maybe other interrupts will also wake-up this mode?

Is there any other registers indicate the type of wake-up sources?

Thank you so much!

BR,

Jim Yang

0 Kudos
1,539 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

As Luciano mentioned, it need to make sure there without any other interrupt source affection during enter into VLPS mode except PORTD interrupt.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,538 Views
lucianomoretti
Contributor IV

Hi Jim:
VLPS mode will exit on any ADC or pin interrupt. Before you go to sleep you need to disable any interrupts that you don't want waking the system. Then when you wake up you'll need to reenable the interrupts that you turned off again.

1,538 Views
mjbcswitzerland
Specialist V

Jim


Low Leakage modes can only be woken by LLWU pins.

VLPS is woken by any interrupt (assuming the peripheral's clock has not been stopped in that mode).

See also https://community.nxp.com/message/421247  for a reference to a VLPS usage which is included in the uTasker project and has been proven in industrial products.

Regards

Mark