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.

CCS: question about MSP430 interrupts

Tool/software: Code Composer Studio

Hello everyone,

I read about interrupts and watched the TI training videos about them, but there is one thing I don't understand. I know that interrupts are less power consuming but are they actually faster.

For example, If I use them in measurement projects will I get better accuracy at my measurements.

Also, i have one more side question, on the forums and on some TI example codes i saw this line of code:  IFG1 & WDTIFG for example if (IFG1 & WDTIFG)  { do something} etc. and i just can't wrap my head around it.

I would appreciate it and thank you for answering my other questions this forum really helped me with a lot of things i didn't understand.                                            

  • An interrupt has a certain overhead cost (time to enter and exit the ISR + bookkeeping), so in the strictest sense interrupts are not faster. In exchange, they allow you to use the time between events to do other things -- either computational work or Low Power Mode. As the time between events decreases, this benefit decreases; in some cases (a fast serial port, a quick ADC operation) the result is a net loss -- 0 benefit, same cost. Part of the system design is in estimating (guessing) the probable time between events.

    TI has done a pretty good job of isolating all the components in the MCU, so usually there is no accuracy benefit to LPM (with interrupts). An exception might be doing an ADC operation with Vcc as the reference, since CPU activity could cause noise on Vcc. (And not only the CPU -- if you want high accuracy, you should try to avoid using Vcc as a reference.)

    The result of a bitwise AND between a register (IFG1) and a single-bit constant (WDTIFG) tells you whether the bit is not-set (=0) or set (non-0).

  • Thank you very much that's all I needed to know.

**Attention** This is a public forum