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.

CODECOMPOSER: What is TI_ISR_TRAP Code ?

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: MSP430FG6426

CPU: MSP430FG6426 + Code Composer Studio V12 is used.

I am having trouble with the following code being executed while debugging.

What are the conditions under which this code is executed?

  • Hi there,

    The code you highlight means "SR=0x10".

    This is a basic definition of the function we can call it "__TI_ISR_TRAP", and it represents an address. When there is a call of "__TI_ISR_TRAP", it will be executed. If you want to set it as interrupt and can be called by MCU, you can refer to our code example (.c) and get supports.

    By the way, we usually do NOT help customers review their own code here, except it is TI's code example.

    Best Regards

    Sal

  • ISR_TRAP is the default ISR, called when an (enabled) interrupt is triggered and no vector for it has been assigned ("#pragma vector="). 

    Common causes: (1) the programmer forgot (2) the vector= name is misspelled [the compiler usually gives a Warning for this] (3) you accidentally set an IE bit somewhere. [Edit: I forgot (4) using the wrong timer vector for the IE(s) being used]

    In the general case, figuring this out is not easy, but often a quick inspection turns something up.

**Attention** This is a public forum