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

Part Number: MSP430F5249

How to detect BOR(Brown-Out Reset) in MSP430F5 series ?

Any API to detect BOR?

  • You can use SYS to know the BOR happens:

  • Unable to enter into Reset_ISR() whether need to enable interrupt at the initial? 
    Following ISR used to catch BOR interrupt:
    #pragma vector=RESET_VECTOR
    __interrupt void Reset_ISR( void ) { switch ( __even_in_range(SYSRSTIV, SYSRSTIV_PMMKEY)) { case SYSRSTIV_BOR: // SYSRSTIV : BOR //__no_operation(); break; default: break; } }
  • I think __interrupt and void Reset_ISR(void) must both be on the same line. Also be aware that you have two other types events which will cause a BOR.

  • Unable to enter into Reset_ISR() whether need to enable interrupt at the initial?

    The MSP430 Reset Vector is normally handled by the C runtime start-up code, and after a reset main() will be called. 

    In main() you can read SYSRSTIV to check the reset causes(s). E.g.:

    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);
    

    There may be more than one reset cause recorded, so the above code keeps reading SYSRSTIV until zero is returned.

**Attention** This is a public forum