主题中讨论的其他器件:MSP-EXP430FR6989、 MSP430FR2433
您好!
我正在评估几个 MSP430器件、目前正在使用 MSP4306989。
是否有办法 通过 RTC 以任意1毫秒的间隔从 LPM3.5唤醒? 通过 RT0PS 和 RT1PS 看起来有几个 RTC 除法选项(/2、/4、/8等)和 RTCNT 8、16、24、32位溢出选项。 但是、是否有方法将中断设置为、例如、5ms?
日历模式中 RTC 的最大中断频率为1分钟、对吧?
我能够通过 Timer_A 模块实现正确的中断间隔、但器件似乎没有正确进入 LPM3.5。 我想这是因为 ACLK 在 LPM3.5中不可用。 是否可以通过计时器模块从 LPM3.5唤醒?
void Sleep_LPM35_MS(uint16_t millisec)
{
/* Timer */
TA1CTL &= ~MC_3; // Stop timer
TA1CTL |= TACLR; // Clear timer
TA1CCTL0 = CCIE; // TACCR0 interrupt enabled
TA1CCR0 = millisec; // @ 1kHz (32kHz XTL / 32)
TA1CTL = TASSEL__ACLK | MC__UP; // ACLK, up mode (start counter)
/* Enter LPMx.5 */
PMMCTL0_H = PMMPW_H; // Open PMM Registers for write
PMMCTL0_L |= PMMREGOFF; // and set PMMREGOFF
// Enter LPM3.5 mode with interrupts enabled. Note that this operation does
// not return. The LPM3.5 will exit through a RESET event, resulting in a
// re-start of the code.
__bis_SR_register(LPM4_bits | GIE);
__no_operation();
}
在另一个评估套件(MSP-EXP430FR6989)上、我能够通过 RTCMOD 寄存器实现所需的行为。 但我在6989上看不到 RTCMOD。 FR6989是否具有类似的功能?
// Crystal clock = 32kHz => /1000 = 32Hz => 31.25ms
void hibernate_seconds(uint8_t delay)
{
const uint16_t freq = 32; // Hz
// Configure RTC
RTCMOD = freq * delay; // Interrupt and reset every n-cycles
RTCCTL |= RTCSS__XT1CLK | RTCSR | RTCPS__1000;
RTCCTL |= RTCIE;
// Enter LPM3.5 mode with interrupts enabled. Note that this operation does
// not return. The LPM3.5 will exit through a RESET event, resulting in a
// re-start of the code.
PMMCTL0_H = PMMPW_H; // Open PMM Registers for write
PMMCTL0_L |= PMMREGOFF; // and set PMMREGOFF
__bis_SR_register(LPM3_bits | GIE);
__no_operation();
}
谢谢、
Brian



