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.

MSP430FR2355: Unclear on LPM3 instruction??

Part Number: MSP430FR2355

When you go into LPM3 within main and wait....Then an ISR goes off....When you return from ISR 'without' using LPM3_EXIT will you process the next block of commands after LPM3 until you reach the next LPM3?

I am wondering if the stack pointer upon leaving the ISR will be pointing at the existing command ( in which case I stay in LPM3 ) or the 'next command' (in which case I process code)?

  • The status register, which contains the mode control bits as well, gets pushed to the stack when processing an interrupt. The ISR runs in regular mode. When the ISR exits, the saved version of the status register is restored. Which means that processor returns to the mode it was in before the interrupt.

    LPM3_EXIT fiddles with the saved value of the status register on the stack.

  • Thanks David....

    That what I thought....LPM3_EXIT allows code to move on in main and VS without LPM3_EXIT which in this case puts me right back into LPM3

    Steve

**Attention** This is a public forum