Hello, I'm working with KL16Z256 in VLLS1 mode. I want to wake up by a rising edge on pin PTB0. This pin doesn´t support GPIO interrupt, only LLWU source. However, I need to enable the GPIO interrupt to wake up. My code is:
PORTB_PCR0 = (uint32_t)((PORTB_PCR0 & (uint32_t)~(uint32_t)(PORT_PCR_ISF_MASK | PORT_PCR_MUX(0x07) | PORT_PCR_IRQC_MASK))
| (uint32_t)(PORT_PCR_MUX(0x01)) | (uint32_t)(PORT_PCR_IRQC(0x09)) );
psLLWUStruct->PE2 |= LLWU_PE2_WUPE5(0x01); | //Rising edge |
SMC_STOPCTRL = SMC_STOPCTRL_VLLSM(0x01);
SMC_PMPROT = 0x0A; //Added to allow VLLS
SMC_PMCTRL = SMC_PMCTRL_STOPM(u8LowPowerType);
MCG_C6 &= ~MCG_C6_CME0_MASK; // Disable MCG clock monitor
stop(); // Goto STOP with SLEEPDEEP enabled
If I don't use the first setence, it doesn´t work.
On the other hand, it work only the first time, once the microcontroler wake up, it reset all the time.
I have cleared the LLWU flash... what is wrong???
Thank you,
María José
Hi María José
You may find some practical information here:
http://www.utasker.com/kinetis/LLWU.html
You should not need to configure the GPIO mode for operation but you should clear the wakeup interrupt source after each reset, and acknowledge the isolation mode with
PMC_REGSC = PMC_REGSC_ACKISO;
Regards
Mark
Kinetis: µTasker Kinetis support
LLWU: µTasker LLWU Support
For the complete "out-of-the-box" Kinetis experience and faster time to market
Hi Mark,
I have cleared the wakeup interrupt source after each reset, and acknowledge the isolation mode with
PMC_REGSC = PMC_REGSC_ACKISO;
but the result is the same, I need to enable the GPIO interrupt to wake up.
I would like to test the uTaster, it is possible??
Thank you.
Hi María José
I have sent you a link to the lastest code including LLWU support (sent at 13:28 GMT).
Please tell me in case you don't receive it.
Regards
Mark