Enter low power mode with: "LPMx" (where "x" is the mode). Do this only OUTSIDE an interrupt handler.
Exit with "LPMx_EXIT" (again, "x" is the number of the specific mode) only from INSIDE an interrupt handler. These macros exist both in the MSP_GCC compiler and the IAR compiler. Mark Sutton Axonn LLC [email protected] _____ From: [email protected] [mailto:[email protected]] On Behalf Of Ori Idan Sent: Tuesday, September 18, 2007 9:04 AM To: thln Cc: GCC for MSP430 - http://mspgcc.sf.net Subject: Re: [Mspgcc-users] Exiting from low power mode I need a C only solution since my application will be later ported to IAR compiler. Also, I could not find the SR bits defined, where does bits like CPUOFF are defined? -- Ori Idan On 9/18/07, thln <[email protected]> wrote: Hi, You can do that: Irq_Routine: ... IRQ Code ... Wakeup_PowerDown: bic #(CPUOFF),0(SP) ; Wake Up (after RETI) reti ----- Original Message ----- From: Ori Idan To: [email protected] Sent: Tuesday, September 18, 2007 3:54 PM Subject: [Mspgcc-users] Exiting from low power mode When I enter a low power mode, I set bits in register SR I understand that this register is pushed on the stack when entering interrupt service routine. How do I change the SR from within the interrupt service routine so that I can exit low power mode when returning from the interrupt? I would like to do it in C without resorting to assembly. -- Ori Idan
