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.

[参考译文] MSP430FR5043:RTC 中断

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1272772/msp430fr5043-rtc-interrupt

器件型号:MSP430FR5043

您好!

可以使用 RTC 中断而不是1秒中断每5秒中断一次吗?

谢谢你!

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

    尊敬的 Anburaja:

    因为除法是二进制(2、4、8等) 我认为您无法精确地获得5s。 您可以将中断设置为1s 间隔并使计数器递增、然后对第5个计数进行处理。   此处可参考 RTC 计数器模式的示例代码。

    另一种选择是使用计时器、将计时器的时钟源设置为 ACLK (32.768kHz 时钟)、并使用 ID 和/或 IDEX 寄存器对该时钟进行分频、从而将该时钟值分频。 然后、您可以将捕获比较寄存器(CCRx)设置为等于5s 的值。

    下面是一些示例数学运算:
    等式:CCR 值=定时器周期*定时器时钟频率- 1。

    如果我们将 ACLK 进行4分频、我们得到计时器 CLK 频率= 8192Hz、TimerPeriod = 5s。 因此、CCR 值将被设置为(8192 * 5)- 1 = 0x9FFF (十六进制)或40959 (十进制)。

    这里是 计时器示例代码 、可提供帮助。

    此致、
    卢克