MSP430: MSP430F5529 Launchpad
IDE: IAR Embedded Workbench
I am trying to setup a periodic tick at 1ms. My code setups TimerA in up mode, CCR0 counting 0 to 999, with an SMCLK at 4MHz divided by 4 resulting in a 1MHz input clock. Before I leave my initialize function, I set TAIE in TA0CTL to (what I thought would) enable the interrupt for TimerA vector0. However, this seems to have the opposite effect and I don't break inside my TIMER0_A0_VECTOR ISR. When I leave out the interrupt enable line, interrupts are being generated. I can't find much information in the family user guide about this (looking at slau208m). Is this correct?
Here is my code:
#define SYSTEM_TIMER_us (1000)
///// Hardware /////
// TASSEL_2 : SMCLK (4MHz)
// ID_2 : Divide input clock (SMCLK) by 4 (resulting in 1MHZ)
// MC_1 : Put in up mode to CCRO
TA0CTL = TASSEL_2 + MC_1 + ID_2;
// Set CCR0 to expire every 1ms
TA0CCR0 = SYSTEM_TIMER_us - 1;
// Clear CCR0 interrupt flag
TA0CCTL0 &= ~CCIFG;
// Allow interrupt
TA0CCTL0 |= CCIE;
// Clear any pending flags
TA0CTL &= ~TAIFG;
// Enable TimerA interrupts
TA0CTL |= TAIE; //<<<<Line in question