# LLS and wake up with LLWU

Question asked by Matteo Pirro on Feb 22, 2017
Latest reply on Feb 23, 2017 by Kerry Zhou

Hello,

I'm trying to use an external pin to wake up my KL15Z4 from LLS using LLWU.

First of all I configure LLWU module.

/* Clear flags for external sources */
dev->regMap->F1 |= 0xFF;
dev->regMap->F2 |= 0xFF;

/* Disable all external sources*/
dev->regMap->PE1 &= 0;
dev->regMap->PE2 &= 0;
dev->regMap->PE3 &= 0;
dev->regMap->PE4 &= 0;

/* Disable all internal sources */
dev->regMap->ME &= 0;

// suppose the pin is in the first PE register

dev->regMap->PE1 &= ~(0b11 << pin*2);
dev->regMap->PE1 |= (event << pin*2);
dev->regMap->F1 |= (1 << pin*2);

NVIC_ICPR = 1 << 7 //LLWU interrupt

NVIC_ISER = 1 << 7; //LLWU interrupt

And then I put the MCU in LLS state.

The debugger disconnects and I am not able to wake up the system with the external pin I configured.

I don't have any instruments to understand where I'm wrong. Could you help me?

Consider I'm able to put the MCU in stop and to get it back in run mode using an external interrupt.

Do you need other part of my code?

Thank you