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.

MSP430F6779A: What is proper process to do System Non-maskable Interrupt Service Routine?

Part Number: MSP430F6779A

as we have setting the reset pin to NMI for prevent PMM26

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
int _system_pre_init(void)
{
/* Insert your low-level initializations here */
__disable_interrupt();
WDTCTL = WDTPW+WDTHOLD;
// Clear RTCHOLD Bit after reset
RTCCTL0_H = RTCKEY_H; // unlock
RTCCTL1 &= ~RTCHOLD; // release RTC
RTCCTL0_H = 0x00; // lock
SFRRPCR = SYSNMI | SYSNMIIES | SYSRSTRE;
/* Return value:
* 1 - Perform data segment initialization.
* 0 - Skip data segment initialization.
*/
return 1;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

What is proper process to do System Non-maskable Interrupt Service Routine?

Can it be blank as below?

Fullscreen
1
2
3
4
5
6
7
8
//------------------------------------------------------------------------------
// Interrupt Service Routine
//------------------------------------------------------------------------------
#pragma vector=SYSNMI_VECTOR /* 0xFFFC System Non-maskable */
__interrupt void int_SYSNMI(void)
{
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi TinK,

    You will also want to set NMIIE in the SFRIE1 register. 

    I also believe the external NMIIFG is a User NMI, so your vector should be UNMI_VECTOR. At a minimum I would read the SYSUNIV register to clear the NMIIFG in each ISR. 

    Best Regards,
    Brandon Fisher

  • Hi Brandon Fisher,

    Thank you for information.

    If the NMIIE is clear (disable).

    Fullscreen
    1
    SFRIE1 &= ~(NMIIE); // SFRIE1 �? NMI Interrupt Disable(b4)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    What processes are required in User NMI interrupt service routine in case NMIIE  is clear?

  • Hi TinK,

    Your USER_NMI could look something like this: 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    // UNMI Interrupt Service Routine
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector=UNMI_VECTOR
    __interrupt void UNMI_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(UNMI_VECTOR))) UNMI_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
    switch(__even_in_range(SYSUNIV, SYSUNIV_AUXSWGIFG))
    {
    case SYSUNIV_NONE: break; // No interrupt Pending
    case SYSUNIV_NMIIFG:
    //Trigger POR
    PMMCTL0 = PMMPW | PMMSWPOR;
    break; // NMIIFG
    case SYSUNIV_OFIFG: break; // OFIFG
    case SYSUNIV_ACCVIFG: break; // ACCVIFG
    case SYSUNIV_AUXSWGIFG: // BUSIFG
    break;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    On NMIIFG it should trigger a POR.

    Best Regards,
    Brandon Fisher

  • Hi Brandon Fisher,

    Are there any problems if no process in USER_NMI in my present source that the NMIIE is disable?

    SFRIE1 &= ~(NMIIE); // SFRIE1

  • IF NMIEE is disabled I expect you will never trigger the UNMI ISR. In that case it wont matter what you have inside the handler.

    Best regards,
    Brandon Fisher

**Attention** This is a public forum