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.

CCS/MSP430FR59941: Enabling of the SYSNMI interrupt

Part Number: MSP430FR59941

Tool/software: Code Composer Studio

Hi MSP430 team,

I have question from one of my customers for example code of enabling the SYSNMI interrupt. Is there a code in resource explorer that I can point him to? Here is his question below  for context.

"

I am attempting to setup the MPU on our board and was using the TI provided example code as my base. The code is missing the enabling of the SYSNMI interrupt. Can you provide an example of how to do so. I have found a lot of into online but most of it is for NMI and not SYSNMI.

 

    // NMI interrupt triggers on falling edge of RST~/NMI pin
    SFRRPCR |= SYSNMIIES__FALLING;

    // Configure RST~/NMI pin as NMI
    SFRRPCR |= SYSNMI__NMI_L;       // RST~/NMI

 

    // Enable NMI interrupt
    SFRIE1 |= NMIIE__ENABLE;

 

The above code was for UNMI_VECTOR not SYSNMI_VECTOR though."

Please let me know if you  have any questions.

Thank you for the support!

Connor Connaughton

  • Hi Connor,

    I don't think the code examples include this because the NMI source is internal, not external. Your customer's code looks right after reviewing the user's guide. My only comment would be to ensure SYSNMI is 0 in the SFRRPCR register by manually clearing just that bit before changing SYSNMIIES. The SYSNMI bit should be 0 after a reset, but this guarantees it.

    // Ensure SYSNMI is zero to avoid triggering an accidental NMI
    SFRRPCR &= ~SYSNMI;
    
    // NMI interrupt triggers on falling edge of RST~/NMI pin
    SFRRPCR |= SYSNMIIES__FALLING;
    
    // Configure RST~/NMI pin as NMI
    SFRRPCR |= SYSNMI__NMI_L;       // RST~/NMI
    
    // Enable NMI interrupt
    SFRIE1 |= NMIIE__ENABLE;

    Regards,

    James

**Attention** This is a public forum