K82 : LLWU and GPIO digital filters combination

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

K82 : LLWU and GPIO digital filters combination

781 Views
EugeneHiihtaja
Senior Contributor I

Hello !

Do I understand right and for the same GPIO pin, LLWU and GPIO digital pins totally independent ?

If LLWU filter is set, Falling edge detection is postponed for ~ 5ms ( 5 clocks) maximum.

It means when pin will be low, LLWU interrupt is happens and MCU can continue with Low state detection on 

GPIO pin. If GPIO digital filter is set to 100 and clocked by LPO, GPIO interrupts happens only when external line will have stable low signal while 100 ms.

Can it work like this ? 

LLWU pins supports only edge detection, and if filter applied it means low/high state should be stable for ~ 5 ms.

Is this so ?

Please clarify.

Regards,

Eugene

0 Kudos
5 Replies

619 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Please check below table about  modules working status at different low power mode:

pastedImage_1.png

pastedImage_2.png

The GPIO module doesn't work during LLSx and VLLSx low power mode.

So, there only support edge trigger with LLWU module at LLSx and VLLSx low power mode.

Wish it helps.


Have a great day,
Mike

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

0 Kudos

619 Views
EugeneHiihtaja
Senior Contributor I

Hi Mike !

I understand that in LLWU mode we can detect edges only  but it is no really  clear how LLWU filter react on it.

If it falling edge drop to low and state there ~3-5ms, it will be detected ? is this so ?

After wakeup from LLWU, GPIO is activated and can start to detect low level already. And if filter there 100 ms, it should skip low pulses what is less than 100 ms long. Does those filtering work like this ?

I think if pin is low and GPIO filter in progress, I shouldn't put  MCU back to low power mode, becouse it cancel detection, but if LLWU wakeup happens again, GPIO should restart detection of  gpio low level from beginning . Is this so ?

Please clarify GPIO digital filter reset/resume in LLS3 mode and can GPIO filter handler rejection of low level pulses what is less than 100 ms long ?

Regards,

Eugene

0 Kudos

619 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Eugene,

Sorry for the later reply.

Please check AN4503 chapter 14.1.4 about Filtered wake-up inputs:

pastedImage_1.png

Wish it helps.


Have a great day,
Mike

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

0 Kudos

619 Views
EugeneHiihtaja
Senior Contributor I

Hi Mike !

 But how-to interpret this text properly ?

If I configure desired pins for LLWU wakeup via MCUExpresso config tool it generate both calls, for wakeup and for filters and at list 4 pins can have filter:

/* LLWU digital filters configuration. */
const llwu_external_pin_filter_mode_t LLWU_filter_config[4] = {
{
.pinIndex = 12U,
.filterMode = kLLWU_PinFilterFallingEdge
},
{
.pinIndex = 13U,
.filterMode = kLLWU_PinFilterFallingEdge
},
{
.pinIndex = 14U,
.filterMode = kLLWU_PinFilterFallingEdge
},
{
.pinIndex = 15U,
.filterMode = kLLWU_PinFilterFallingEdge
}
};

void LLWU_init(void) {

LLWU_SetExternalWakeupPinMode(LLWU_PERIPHERAL, 12U, kLLWU_ExternalPinFallingEdge);
/* Initialize the LLWU wakeup pin 13. */
LLWU_SetExternalWakeupPinMode(LLWU_PERIPHERAL, 13U, kLLWU_ExternalPinFallingEdge);
/* Initialize the LLWU wakeup pin 14. */
LLWU_SetExternalWakeupPinMode(LLWU_PERIPHERAL, 14U, kLLWU_ExternalPinFallingEdge);
/* Initialize the LLWU wakeup pin 15. */
LLWU_SetExternalWakeupPinMode(LLWU_PERIPHERAL, 15U, kLLWU_ExternalPinFallingEdge);


/* Initialize digital filter on wakeup pin 12. */
LLWU_SetPinFilterMode(LLWU_PERIPHERAL, 0U, LLWU_filter_config[0]);
/* Initialize digital filter on wakeup pin 13. */
LLWU_SetPinFilterMode(LLWU_PERIPHERAL, 1U, LLWU_filter_config[1]);
/* Initialize digital filter on wakeup pin 14. */
LLWU_SetPinFilterMode(LLWU_PERIPHERAL, 2U, LLWU_filter_config[2]);
/* Initialize digital filter on wakeup pin 15. */
LLWU_SetPinFilterMode(LLWU_PERIPHERAL, 3U, LLWU_filter_config[3]);


/* Enable interrupt LLWU_IRQN request in the NVIC */
EnableIRQ(LLWU_IRQN);
}

 

So. do I undestand right K82 capabilites :

- max 4 filters

-  set filters and wake up API should be used

But in may case I can simplify task like this :

- wakeup due LLWU asap to RUN mode, no any filters

- GPIO lines are configured for detect level interrupts ( Zero or One ) and they start to detect level

- GPIO should have digital filters for 100 clocks of LPO and all levels with duration less than 100 ms will be rejected

- be sure if MCU is not going to LLS3 when GPIO filtering ongoing.

What is difficult to test if 100 ms level is really detected properly. Some pulse generator required.

Or it should work by design ?

Regards,

Eugene

0 Kudos

619 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Eugene,

First of all, sorry for the later reply.

If you check the MCUXpresso SDK provided [power_manager] demo, which call below function to set  LLWU wakeup pin:

LLWU_SetExternalWakeupPinMode(LLWU, LLWU_WAKEUP_PIN_IDX, LLWU_WAKEUP_PIN_TYPE);

This code located at void APP_SetWakeupConfig(app_power_mode_t targetMode) function at <power_manager.c> file.

You could find [power_manager] demo with below path:

..\FRDM-K82F\boards\frdmk82f\demo_apps\power_manager

If your system requires 100ms filter with GPIO pin wake up input, it can't use LLWU external wake up pin.

Customer should select to use GPIO module interrupt as low power mode wake up source.

So, with this limitation, customer system can't enter into LLSx and VLLSx low power mode.

Or, customer can consider to use module as wake up source, such as LPTMR.

BTW: I will take the Chinese New Year vacation soon and will be back at Feb. 14th.
If there with any update, I will ask my global colleague to continue support.
There could cause delay reply possibility.
Sorry for that may bring any inconvenience to you.

Have a great day,
Mike

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

0 Kudos