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.

SVMLIFG in PMMIFG and SYSSNIV?

Little confused on how this works. if I enable SVMLIE like this

    PMMCTL0_H = PMMPW_H;
    PMMRIE |= SVMLIE;
    PMMCTL0_H = 0x00;  

which place should I handle the interrupt? The SVMLIFG flag is in both SYSSNIV and PMMIFG.

  • Dan-o said:
    The SVMLIFG flag is in both SYSSNIV and PMMIFG.

    No, the flag is only in PMMIFG.
    SYSSNIV gives you an event identifier if this flag is set (and at the same time clears it).

    All xxxIV registers work that way: priorizing interrupt sources whose IFG and IE bits are both set. If multiple interrupts are pending, the one woth the highest priority is reportet first. Next read of the register returns the event number of the next highest pending interrupt.

    Teh SYSSNIV register can only be used inside the SNMI ISR. Because it only contains a value (other than 0) if an interrupt is pending. And since NMI is nto maskable, this means that at the very moment an interupt is pending, the ISR is called. The only way to see anything in this register from main code is when teh ISR doesn't handle the interrupt (does not read SYSSNIV nor clear the IFG bit), because between two (of the then endless) SNMI ISR calls, one main code instruction is executed. So it will eventually be able to read the register and 'find' the offending interrupt.

    Inspecting the register by the debugger will also clear the reported interrupt(s) and influence the code!

  • ok thanks for the help!

**Attention** This is a public forum