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.

[参考译文] MSP430F5249:MSP430F5249

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1006142/msp430f5249-msp430f5249

器件型号:MSP430F5249

如何检测 MSP430F5系列中的 BOR (欠压复位)?

是否有用于检测  BOR 的 API?

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

    您可以使用 SYS 来了解 BOR 发生的情况:

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    无法进入 RESET_ISR(),是否需要在初始时启用中断? 
    以下用于捕获 BOR 中断的 ISR:
    #pragma vector=reset_vector
    __interrupt void Reset_isr (void) { 开关(_偶数_IN_RANGE (SYSRSTIVSYSRSTIV_PMMKEY)) 案例 SYSRSTIV_BOR// SYSRSTIV:BOR //__no_operation(); 中断; 默认值:break
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我认为__interrupt,而且void Reset_ISR(void)必须都在同一条线路上。 还要注意、您还有另外两种类型的事件会导致 BOR。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="483654" URL"~/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1006142/msp430f5249-msp430f5249/3719467 #371964)]无法进入 Reset_ISR(),是否需要在初始时启用中断? [/报价]

    MSP430复位矢量通常由 C 运行时启动代码处理、并且在复位后将调用 main()。  

    在 main()中,您可以读取 SYSRSTIV 以检查 复位原因。 例如:

    int main(void)
    {
        volatile uint16_t reset_cause;
        volatile bool halt_on_unexpected_reset_cause = true;
    
        WDTCTL = WDTPW | WDTHOLD;   // stop watchdog timer
    
        do
        {
            reset_cause = SYSRSTIV;
            switch (reset_cause)
            {
            case SYSRSTIV_NONE:
            case SYSRSTIV_BOR:
            case SYSRSTIV_RSTNMI:
                /* Continue with the program, as probably a power up */
                break;
    
            default:
                /* Unexpected reset, halt to allow inspection in the debugger */
                while (halt_on_unexpected_reset_cause)
                {
                }
                break;
            }
        } while (reset_cause != 0);
    

    可能会记录多个复位原因、因此上述代码会一直读取 SYSRSTIV、直到返回0。