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.