AnsweredAssumed Answered

Wakeup problem in LLS mode !!

Question asked by Alexandru Nan on Mar 2, 2012
Latest reply on Oct 8, 2013 by Daniel Chai

I'm using K60N512 and mode of LLS low power  -> power_mode=LPM_OPERATION_MODE_STOP;

after setting ok the sources for wake up and watching to the registers value before entering in sleep mode. The core is not recovering from sleep. The problem is the example what is wake up by the RTC interrupt is working but by pin wakeup is not working. I've tested the connection before entering in sleep and the isr for that pin is working.

this is the code for pin initialization


 and this is the code for setting sleep mode:

power_mode = LPM_OPERATION_MODE_STOP;        printf("**************** Current Mode : %s **********************\n", predefined_power_modes_names[power_mode]);                set.PE1=1;//LPM_CPU_OPERATION_MODES[power_mode].PE1|0x01;        set.PE2=LPM_CPU_OPERATION_MODES[power_mode].PE2+2;        set.PE3=LPM_CPU_OPERATION_MODES[power_mode].PE3;        set.PE4=LPM_CPU_OPERATION_MODES[power_mode].PE4;        set.FLAGS=LPM_CPU_OPERATION_MODES[power_mode].FLAGS;        set.ME=LPM_CPU_OPERATION_MODES[power_mode].ME;        set.MODE_INDEX=LPM_CPU_OPERATION_MODES[power_mode].MODE_INDEX;                        pstOpMode = &set;                //_lpm_set_cpu_operation_mode(pstOpMode,power_mode);       /* if (MQX_OK != _lpm_install (&set, power_mode))        {        printf ("Error during LPM install!\n");        }*/        display_operation_mode_setting(power_mode);        printf(        "Info: STOP mode is mapped to Kinets LLS mode by default.\n"        "      Core and most peripherals are inactive in this mode, reacting only to\n"        "      specified wake up events. The events can be changed in BSP (init_lpm.c).\n"        "      Serial line is turned off in this mode. The core will wake up from\n"        "      RTC interrupt.\n");                /* Wake up in 60 seconds */        set_rtc_alarm(20);        //enable WAKE up pin 0 from LLWU as pin PTE1, and B10 connector on tower)        //LPM_CPU_OPERATION_MODES[power_mode].PE1=(uint_8)0x01;       _int_install_isr(INT_LLW,(pointer)llwu_isr,NULL);       _bsp_int_init(INT_LLW,2,0,TRUE);        /* Change the operation mode */        printf ("\nSetting operation mode to %s ... \n", predefined_power_modes_names[power_mode]);        _lpm_set_operation_mode (power_mode);               /* Return to RUN mode */        _lpm_set_operation_mode (LPM_OPERATION_MODE_RUN);                printf("\nCore is awake. Moved to next operation mode.\n");

 and this is the interrupt for wakeup:

void llwu_isr(void){ _lpm_wakeup_core();  _lpm_set_operation_mode (LPM_OPERATION_MODE_RUN);// printf("Core wake up by LLWU PIN0 source\n"); LLWU_CS |= LLWU_CS_ACKISO_MASK;    // clear LLWU acknowledge flag     LLWU_F1 = 0xFF;            // clear wakeup flags     LLWU_F2 = 0xFF;            // clear wakeup flags     LLWU_F3 = 0xFF;            // clear wakeup flags}