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.

[参考译文] MSPM0G3507:在 MSPM0上退出待机模式

Guru**** 1794070 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1397605/mspm0g3507-exit-standby-mode-on-mspm0

器件型号:MSPM0G3507

工具与软件:

尊敬的专家: 
是否可以使用指令(如_BIC_SR_IRQ (CPUOFF);//在 MSP430上从0 (SR)清除 LPM)退出待机模式。
提前感谢。 
/*
 * Exit_Standby.c
 *
 *  Created on: 7 août 2024
 *      Author: Test Team
 */

#include "ti_msp_dl_config.h"

volatile unsigned char RX_Data = 0;

int main(void)
{
    SYSCFG_DL_init();

    NVIC_ClearPendingIRQ(UART_0_INST_INT_IRQN);
    NVIC_EnableIRQ(UART_0_INST_INT_IRQN);
    DL_SYSCTL_enableSleepOnExit();

    while (1) {
        __WFI();
        DL_GPIO_togglePins(GPIO_LEDS_PORT,
            GPIO_LEDS_USER_LED_1_PIN | GPIO_LEDS_USER_TEST_PIN);
    }
}

void UART_0_INST_IRQHandler(void)
{
    switch (DL_UART_Main_getPendingInterrupt(UART_0_INST)) {
        case DL_UART_MAIN_IIDX_RX:
            RX_Data = DL_UART_Main_receiveData(UART_0_INST);
            while (DL_UART_isBusy(UART_0_INST));
            DL_UART_Main_transmitData(UART_0_INST, RX_Data);

            if(RX_Data == "@")
            {
                // Exit standby mode only if RX car is "@"
            }
            break;
        default:
            break;
    }
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Thierry:

    您可以使用 DL_SYSCTL_disableSleepOnExit ()函数禁止在中断服务例程中重新进入低功耗模式。 如果您想稍后重新进入低功耗模式,可以 再次使用 DL_SYSCTL_enableSleepOnExit ()函数,然后使用 WFE ()或 WFI ()函数实际进入睡眠模式。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Dylan 
    中断中的 DL_SYSCTL_disableSleepOnExit ()运行良好。
    非常感谢。 

    /*
     * Exit_Standby.c
     *
     *  Created on: 7 août 2024
     *      Author: Test Team
     */
    
    #include "ti_msp_dl_config.h"
    
    volatile unsigned char RX_Data = 0;
    
    int main(void)
    {
        SYSCFG_DL_init();
    
        NVIC_ClearPendingIRQ(UART_0_INST_INT_IRQN);
        NVIC_EnableIRQ(UART_0_INST_INT_IRQN);
        DL_SYSCTL_enableSleepOnExit();
    
        while (1) {
            __WFI();
            DL_GPIO_togglePins(GPIO_LEDS_PORT,
                GPIO_LEDS_USER_LED_1_PIN | GPIO_LEDS_USER_TEST_PIN);
            DL_SYSCTL_enableSleepOnExit();
        }
    }
    
    void UART_0_INST_IRQHandler(void)
    {
        switch (DL_UART_Main_getPendingInterrupt(UART_0_INST)) {
            case DL_UART_MAIN_IIDX_RX:
                RX_Data = DL_UART_Main_receiveData(UART_0_INST);
                while (DL_UART_isBusy(UART_0_INST));
                DL_UART_Main_transmitData(UART_0_INST, RX_Data);
    
                if(RX_Data == "@")
                {
                    // Exit standby mode for toggle led in main only if RX car is "@"
                    DL_SYSCTL_disableSleepOnExit();
                }
                break;
            default:
                break;
        }
    }