Return from interrupt – Texas Instruments MSP430x4xx User Manual

Page 29

Advertising
background image

System Reset and Initialization

2-11

System Resets, Interrupts, and Operating Modes

Return From Interrupt

The interrupt handling routine terminates with the instruction:

RETI

(return from an interrupt service routine)

The return from the interrupt takes 5 cycles to execute the following actions
and is illustrated in Figure 2−7.

1) The SR with all previous settings pops from the stack. All previous settings

of GIE, CPUOFF, etc. are now in effect, regardless of the settings used
during the interrupt service routine.

2) The PC pops from the stack and begins execution at the point where it was

interrupted.

Figure 2−7. Return From Interrupt

Item1

Item2

SP

TOS

Item1

Item2

SP

TOS

PC

SR

Before

After

PC

SR

Return From Interrupt

Interrupt nesting is enabled if the GIE bit is set inside an interrupt service
routine. When interrupt nesting is enabled, any interrupt occurring during an
interrupt service routine will interrupt the routine, regardless of the interrupt
priorities.

Advertising