I am new to the MSP430. For some reason I can not get the interrupts to
work, they never trigger. The
code in the interrupt service routine never runs. Any help that you can
offer would be greatly appreciated. I have read around on several
forums and have not found similar problems, so it must be something
dumb that I am doing. I have included the code below. I am using CCE.
Best regards,
Patrick
#include "msp430x42x0.h"
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= 0x01; // Set P1.0 to output direction
TACTL = MC_2;
CCR0 = TAR; // Current state of TA counter
CCR0 += 1000; // Some time till first trigger
CCTL0 = CCIE; // enable capture/compare interrupt
for (;;)
{
volatile unsigned int i; // volatile to prevent optimization
i = 10000; // SW Delay
do i--;
while (i != 0);
}
}
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
P1OUT ^= 0x01;
CCR0 += 10000;
CCTL0 &= ~CCIFG;
}