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.

MSP-EXP430FR5994: TimerA ISR to increment variable every second

Part Number: MSP-EXP430FR5994

Hi,

I want to create a TimerA ISR to increment a value by 1 every second. I run into an ISR trap when I compile, I was wondering if my set up is wrong.

int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop Watchdog
initGPIO(); // Initializes GPIO pins
initClockTo16MHz(); // Initialize Clock
initUART(); // Initializes UART Communication

Timer_A_initUpModeParam initUpParam = {0};
initUpParam.clockSource = TIMER_A_CLOCKSOURCE_SMCLK;
initUpParam.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
initUpParam.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
initUpParam.timerPeriod = 16000;
initUpParam.timerClear = TIMER_A_DO_CLEAR;
initUpParam.startTimer = false;
//Initiaze compare mode

Timer_A_initUpMode(TIMER_A1_BASE, &initUpParam);
Timer_A_enableInterrupt(TIMER_A1_BASE);
Timer_A_startCounter( TIMER_A1_BASE, TIMER_A_UP_MODE);

}

#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = TIMER0_A1_VECTOR
__interrupt void Timer0_A1_ISR (void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMER0_A1_VECTOR))) Timer0_A1_ISR (void)
#else
#error Compiler not supported!
#endif
{
if(coordinator.aresManager.mSec < 1000){
coordinator.aresManager.mSec++;
}
else{
coordinator.aresManager.mSec = 0;
}
}

**Attention** This is a public forum