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.

MSP432P401Y: low power modes and watchdog

Part Number: MSP432P401Y

Hi everybody ,

 I would like to use Watchdog  and do idle : is it possible and how ? 

I do  --> Idle.addFunc('&power_idlefunc')        devices  goes low power OK , but then  watchdog is not refreshd  so I get a reset ...

how could I do this ?     I must disable watchog  before enetrering idel only ?

any suggestion/strategy ?

thank you 

BR

Carlo

  • Hi Carlo,

    You would like to enable Watchdog when enter low power mode?

    Generally, user will disable watchdog when use low power mode, which low power mode you use? maybe I can check if there are some method that can keep watchdog run.

    Thanks!

    Best Regards

    Johnson

  • Hi  Johnson , 

    my goal is  lower power consumption and ideally Wtahdog on to avoid hainging : is it possible ?

    I do enter low power this way Idle.addFunc('&power_idlefunc')     

    any other idea ? 

    shoudl I disable Watchdog ? 

    thank  you 

    BR

    Carlo

  • Hi Colombo,

    WDT be able to work in LPM mode, but you need keep the WDT source clock is normal in this mode.

    Which source clock used in WDT?

    Thanks!

    Best Regards

    Johnson

  • Hi He , 

    I need the lowest power consumption , which one you suggest ?  please  coudl you confirm  clock and  what to do  on the sytem to get my  goal?

    thank you 

    BR

    Carlo

  • Close this thread, communicate by email.

  • HI HE , 

    sorry for delay    , we tested usinge external LFXT   but it is not working in LPM .

    could you kindly give suggestion ?  did you try ?

    thank you 

    BR

    Carlo

  • Hi Carlo,

    I tested in my side, the WDT can run normal in LPM3 mode.

    Attach the example code I used as your reference:(WDT will reset MCU and then P1.0/LED will Blink):

    #include "msp.h"
    
    
    void main(void)
    {
        WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD;                 // Halt watchdog timer
    
        // Configure GPIO
        P1->DIR |= BIT0;                        // Set P1.0 to output - SET BREAKPOINT HERE
        P1->OUT ^= BIT0;                        // Toggle P1.0
    
        PJ->SEL0 |= BIT0 | BIT1;                // set LFXT pin as second function
    
        CS->KEY = CS_KEY_VAL;                   // Unlock CS module for register access
        CS->CTL2 |= CS_CTL2_LFXT_EN;            // LFXT on
    
        // Loop until XT1, XT2 & DCO fault flag is cleared
        do
        {
            // Clear XT2,XT1,DCO fault flags
           CS->CLRIFG |= CS_CLRIFG_CLR_DCOR_OPNIFG |
                   CS_CLRIFG_CLR_HFXTIFG |
                   CS_CLRIFG_CLR_LFXTIFG |
                   CS_CLRIFG_CLR_FCNTLFIFG;
           SYSCTL->NMI_CTLSTAT &= ~ SYSCTL_NMI_CTLSTAT_CS_SRC;
        } while ((SYSCTL->NMI_CTLSTAT | SYSCTL_NMI_CTLSTAT_CS_FLG)
                && (CS->IFG & CS_IFG_LFXTIFG)); // Test oscillator fault flag
    
        // Select ACLK as LFXTCLK
        CS->CTL1 &= ~(CS_CTL1_SELA_MASK) | CS_CTL1_SELA_0;
        // Lock CS module from unintended accesses
        CS->KEY = 0;
    
    
        // WDT 250ms, ACLK
        WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_SSEL__ACLK | WDT_A_CTL_CNTCL | WDT_A_CTL_IS_5;
        
        // Go to LPM3 mode
        // Setting the sleep deep bit
        SCB->SCR |= (SCB_SCR_SLEEPDEEP_Msk);
    
        // Ensures SLEEPONEXIT takes effect immediately
        __DSB();
    
        __sleep();
        __no_operation();                       // For debugger
    
    
    }
    

    Thanks!

    Best Regards

    Johnson

  • HI Johson 

    WORKING !  t

    hank you very much 

    BR

    Carlo