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.

[参考译文] MSPM0L2228:防止通过 RTCRDY 中断唤醒

Guru**** 2390755 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1415223/mspm0l2228-prevent-wake-up-by-the-rtcrdy-interrupt

器件型号:MSPM0L2228

工具与软件:

您好!

您能告诉我如何在待机模式下阻止由 RTCRDY 中断唤醒吗?
为了实现这一点、我将0xA9000100h 写入 RTC。 CLKCFG 寄存器并启用 RTCRDY 中断、如下所示:

1.将0xA9000100h 写入 RTC。 CLKCFG 寄存器
2)使用 TI 样片(RTC_A_TAMP_TIMESTAMP_EVENT)并添加 RTC_A->GPRCM。 CLKCFG = 0xA9000100U;写入第44行。

/*
 * Copyright (c) 2021, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
#include "ti/devices/msp/peripherals/hw_rtc.h"
#include "ti_msp_dl_config.h"

volatile bool gCheckTSEVT = false;
volatile uint32_t counter = 0;
volatile uint8_t gBlink;

int main(void)
{
    /* Initialization */
    SYSCFG_DL_init();
    
    RTC_A->GPRCM.CLKCFG = 0xA9000100U;

    /* Enable the RTC interrupt at NVIC */
    NVIC_EnableIRQ(RTC_A_INT_IRQn);

    /* Start RTC clock */
    DL_RTC_A_enableClockControl(RTC_A);

    while (1) {
        __WFI();

        /* Wait in a while() loop until the time stamp interrupt triggers - Trigger a tamper event externally */
        while (gCheckTSEVT == false)
            ;

        /* Blink LED a number of times equal to amount of time stamp events detected */
        if (DL_RTC_A_getTimeStampEventCause(
                RTC_A, DL_RTC_A_TIME_STAMP_EVENT_CAUSE_TIO_0) ==
            DL_RTC_A_TIME_STAMP_EVENT_CAUSE_TIO_0) {
            for (gBlink = 0; gBlink < (2 * counter); gBlink++) {
                DL_GPIO_togglePins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN);
                delay_cycles(16000000);
            }
        }
    }
}

void LFSS_IRQHandler()
{
    switch (DL_RTC_A_getPendingInterrupt(RTC_A)) {
        case DL_RTC_A_IIDX_TSEVT:
            counter++;
            gCheckTSEVT = true;
        default:
            break;
    }
}


2.启用 RTCRDY 中断。



然而、Default_Handler 在寄存器被设置时被调用。

是否有正确的设置或其他方法?

此致、
Sho Takayama.

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

    尊敬的 Sho:
    请让我明天再给您讨论这个问题。 同时、您是否可以尝试删除  RTC_A->GPRCM。 CLKCFG = 0xA9000100U 系列是否保留所有其他配置?  如果这对您有帮助、请告诉我。

    此致、

    Diego Abad

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

    尊敬的 Diego:

    感谢您的及时响应。 我将继续操作、删除 RTC_A->GPRCM。 CLKCFG = 0xA9000100U 行、同时按照建议保持其他配置不变。
    我无法尝试将 RTCRDY 中断作为唤醒源禁用、但其他一切都正常。

    此致、
    Sho Takayama.

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

    尊敬的 Sho:
    由于所有中断均可屏蔽、因此您应该无法通过不使用该中断来唤醒 MCU 来"屏蔽"或"调用"该中断。

    此致、

    Diego Abad

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

    尊敬的 Diego:

    是否可以执行以下操作?

    1.启用 RTCRDY 中断。
    2.将0xA9000100写入 RTC。 CLKCFG 寄存器、用于防止 RTCRDY 中断用作唤醒源。

    此致、
    Sho Takayama.

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

    尊敬的 Sho:

    将 0xA9000100写入 RTC。 CLKCFG 寄存器将阻止 异步时钟请求 启动 SYSOSC、尽管您提到的要使用的功耗模式(待机)将禁用 SYSOSC。 我看不到将该值写入 RTC 寄存器如何阻止 RTCRDY ( 基于 RTCRDY 位的上升沿生成的中断)发生。 因此、我的最佳建议是不要使用 RTCRDY 中断。

    此致、
    Diego Abad