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.

MSP430FR4133: Help Understanding the Timer Interrupt Nomenclature

Part Number: MSP430FR4133
Other Parts Discussed in Thread: MSP-EXP430FR4133

Hi everyone,

I am trying to learn how to use timers on the MSP-EXP430FR4133 development board but I am having difficulty understanding the nomenclature of the timers and their interrupts.

From the product specific data sheet, I see that this particular chip has "Two 16-Bit Timers With Three Capture/Compare Registers Each (Timer_A3)" so I have taken this to mean that the name "Timer_A3" is the name that TI have given to the particular variant of Timer_A that happens to have 3 capture/compare registers.  So far, fairly straightforward...

Now I refer to the "MSP430FR4xx and MSP430FR2xx Family User Guide" which states that "There may be multiple instantiations of Timer_A on a given device. The prefix TAx is used, where x is a greater than equal to zero indicating the Timer_A instantiation. For devices with one instantiation, x = 0. The suffix n, where n = 0 to 6, represents the specific capture/compare registers associated with the Timer_A instantiation." 

So, this would lead me to believe that my two timers are called TA0 and TA1. Is this correct?

Where I get confused is when I try to understand the naming of the interrupt vectors... I have been given the following example code which runs as intended on the device.

#include <msp430.h>
#include <driverlib.h>

volatile bool TimerA0_CCR0_interrupt_hit = 0;
volatile unsigned int TimerA0_period = 16000;


#pragma vector = TIMER0_A0_VECTOR //Timer A0 interrupt ISR
__interrupt void TIMERA0_ISR0(void)
{
TimerA0_CCR0_interrupt_hit=1; //On A0 interrupt hit, set the flag
}

#pragma vector = TIMER0_A1_VECTOR //Timer A1 interrupt ISR
__interrupt void TIMERA0_ISR1(void)
{
switch(__even_in_range(TA0IV,10)) //Clears the flag
{
; //Not used
}
}

So here we see Timer 0 being referred to as TIMER0_A0_VECTOR. Where has this "A" come from and why is it not "A3"?

Also, as I understand it, the TIMERA0_ISR0(void) above is triggered ONLY by a capture/compare interrupt from timer TA0. Furthermore, TIMERA0_ISR1(void), is triggered by any other interrupts originating from TA0 which in this case I am not interested in because I just use the c/c interrupt to blink an LED. Is my understanding of this correct?

Sorry for the long winded post. I think I understand the concepts but I'm really struggling with the intricacies of the interrupt vector names.

  • The two timer modules can be called TA0/TA1 or Timer0_A3/Timer1_A3 or Timer_A0/Timer_A1.

    "A" stands for the type of timer hardware; other chips can also have "B" or "D" timers.

    As for the interrupt vector symbols, their names are constructed somewhat differently for historical reasons; it's best not to try to make sense of them, but to look them up by their description in the header file (here for gcc):

    #define TIMER1_A1_VECTOR        (54)        /* 0xFFF2 Timer1_A3 CC1-2, TA */
    #define TIMER1_A0_VECTOR        (55)        /* 0xFFF4 Timer1_A3 CC0 */
    #define TIMER0_A1_VECTOR        (56)        /* 0xFFF6 Timer0_A3 CC1-2, TA */
    #define TIMER0_A0_VECTOR        (57)        /* 0xFFE8 Timer0_A3 CC0 */
  • Thanks for this Clemens, I was just struggling to join the dots between the various datasheets and user guides. The naming of the vectors was causing me some confusion and I began to suspect that some legacy naming might be in use.

    Is my understanding correct about how the two interrupt vectors interact? ie that:

    #pragma vector = TIMER0_A0_VECTOR

     is the highest priority interrupt and is triggered by a c/c event on TA0

    and that:

    #pragma vector = TIMER0_A1_VECTOR //Timer A1 interrupt ISR
    
    __interrupt void TIMERA0_ISR1(void)
    
    {
    
    switch(__even_in_range(TA0IV,10)) //Clears the flag
    
    {
    
    ; //Not used
    
    }

    is a lower priority interrupt triggered by the same timer and that we use the switch statement to switch between the various interrupt cases/flags.

**Attention** This is a public forum