This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G1106: Putting MCU to sleep using __WFI() and the Watchdog functionality

Part Number: MSPM0G1106
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi,

I've been navigating through the low power modes of the MSPM0G1106 mcu and ran into the following questions:

1. If I wanted to measure the current consumption of the MCU while RUN0/SLEEP0 mode is active, and the MCU remains asleep except when handling the SysTick interrupt every 1 ms, would the following test code be appropriate? (I'm using the MSPM0 SDK 2.1.0.03.)

int main(void)
{
    // Do initializaion. (SysTick starts firing every 1ms.)
    
    DL_SYSCTL_setPowerPolicyRUN0SLEEP0();

    while (1)
    {
        // Put the MCU to SLEEP0 mode. 
        __WFI();
    }
}

2. I also notice that when I add the __WFI() command inside the while loop above, the WWDT1, which I have enabled, never resets the MCU even though I do not service it regularly. (The reset works fine without the __WIF() command.)

According to the RUN bit in the WWDT1_WWDSTAT register, which is set to 1 (ON) while running the while(1) loop, the watchdog appears to be running. However, I don’t understand why the MCU doesn’t reset when the watchdog should have expired.

FYI. my WWDT1 uses LFCLK as its clock source.

Thank you,

Kyungjae Lee

  • Hi,

    1. The test code seems fine. 

    2. Could you send your code with WWDT configuration here. We can take a look into it. 

    Best regards,

    Cash Hao

  • Hi Cash,

    Thanks for your response. Here's my WWDT1 configuration:

    And here's the test code:

    int main(void)
    {
        SYSCFG_DL_init();
        
        DL_SYSCTL_setPowerPolicyRUN0SLEEP0();
    
        while (1)
        {
            // Put the MCU to SLEEP0 mode. 
            __WFI();
        }
    }

    The API to service the watchdog ( DL_WWDT_restart(WWDT1_INST) ) has been removed intentionally to test if the watchdog expiration is properly resetting the MCU. I have also noticed that calling DL_SYSCTL_setPowerPolicyRUN0SLEEP0() does not have impact on this behavior, but calling __WFI() does. I'm wondering if the structure of this while(1) loop is causing this behavior.

    Please let me know if you need more details.

    My development environment is:

    • CCS 12.7
    • MSPM0 SDK 2.1.0.03
    • SysConfig 1.19.0

    Thank you,

    Kyungjae Lee

  • Hi,

    Try enable below function in sysconfig. 

    Best regards,

    Cash Hao

  • Hi,

    That did the trick. Thank you!

    Best regards,

    Kyungjae Lee