AnsweredAssumed Answered

Deep Sleep and VLPS on MK64FN1M0VLL12

Question asked by Jakub Pankau on Jan 5, 2017
Latest reply on Jan 6, 2017 by Jakub Pankau

So I'm trying to put my microcontroller into deep sleep mode (stop) or the VLPS mode. In my code I'm calling a function that suppose to put the uC in sleep mode and then I would like to use a UART port as a wake up. From what I have read in STOP mode any interrupt should wake the microcontroller (without use of the LLWU). Here is a code that I'm using to put the system in sleep:


 NVIC_EnableIRQ(UART4_RX_TX_IRQn);  //enable UART4 interrupts
 /* Set the STOPM field to 0b010 for VLPS mode */
 //exit to run on interrupt
 /*wait for write to complete to SMC before stopping core */
 dummyread = SMC_PMCTRL;
 /* Now execute the stop instruction to go into VLPS */
/* Set the SLEEPDEEP bit to enable deep sleep mode - enter stop mode*/
 #ifdef CMSIS
 /* WFI instruction will start entry into STOP mode */


There are multiple issues that I observed with both STOP and VLPS modes:

   1. The current is regular RUN mode is around 40mA at 3V, which is what the datasheet specifies. After I execute the    sleep instruction it decreases to around 25 mA, which is way to big. According to datasheet it should be around    0.5mA.

   2. The system does not wake up, when I send any command through UART. It looks like it is not responding at all.

   3. The sleep function does not work in debug mode. It looks like the instructions are executed but it does not go    into any sleep modes. (I'm using Keil development studio).


Any help or suggestions is greatly appreciated.