Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Slide 10 Slide 11 Slide 12 Product List
SYS/BIOS: MSP430 Support Slide 7

To explain how SYS/BIOS implements an interrupt service routine (ISR), it might be good to start with what an ISR looks like without SYS/BIOS. Typically, an interrupt handler is a C function that is tagged with the "interrupt" keyword. This function takes no arguments, and has a void return type. A #pragma is used to associate the function to the corresponding interrupt vector. When the interrupt source has been enabled and the interrupt asserted by the peripheral, the CPU is vectored to the ISR. Because of the interrupt keyword, the return instruction at the end of the function is actually a return from interrupt instruction instead of return from subroutine. Which will additionally restore the Status Register that was pushed onto the stack at the start of the ISR. On the MSP430 there are bits in this Status Register that control transitions to low power modes. Because these bits are restored as part of the return from interrupt, by default, the CPU will automatically return to the power mode in effect at the time the interrupt occurred.

PTM Published on: 2012-07-12