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.

LP-MSPM0G3507: wake up from STANDBY mode.

Part Number: LP-MSPM0G3507
Other Parts Discussed in Thread: MSPM0G3507

Hi, M0 Team.

I'm testing timer example (timx_timer_mode_periodic_standby_LP_MSPM0G3507_nortos_ticlang)

This example seems like to enter STANDBY mode.

What should I do to change from STANDBY mode to RUN mode?

I want to wake up from STANDBYmode whenever a timer interrupt occurs.

I make a counter variable. But gMainloopCounter does not increment.

#include "ti_msp_dl_config.h"

int16_t gInteruptCounter = 0;
int16_t gMainloopCounter = 0;

int main(void)
{
    SYSCFG_DL_init();

    NVIC_EnableIRQ(TIMER_0_INST_INT_IRQN);
    DL_SYSCTL_enableSleepOnExit();

    DL_TimerG_startCounter(TIMER_0_INST);

    while (1)
    {
        __WFI();

        gMainloopCounter++;
    }
}

void TIMER_0_INST_IRQHandler(void)
{
    switch (DL_TimerG_getPendingInterrupt(TIMER_0_INST)) {
        case DL_TIMER_IIDX_LOAD:
            gInteruptCounter++;
            DL_GPIO_togglePins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN);
            break;
        default:
            break;
 

In the case of msp430, functions like __bic_SR_register_on_exit(LPM3_bits) is used within the ISR.

Should M0 also use function? 

  • Hi Sy,

    Remove the call to DL_SYSCTL_enableSleepOnExit() and your counter should begin to increment.

    Sleep on exit is a mode that prevents the device from returning to the main loop after waking to handle an interrupt, instead after the handler is done it just goes back to sleep. In your case, you want the main loop to run because you have your counter increment there. 

    Best Regards,
    Brandon Fisher