Hello all,
I'm quite new to the MSP430.
I created an small program:
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P2OUT =0x00;
P2DIR |= 0x02;
CCTL0=CCIE;
TACCR0 = 62500;
TACTL=TASSEL_2| ID_3 |MC_1 |TAIE;
_enable_interrupt();
while (1){
}
return 0;
}
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A (void){
P2OUT ^=0x02;
TACTL &= ~TAIFG;
}
The program works fine if I use the SMCLK but when I want to use the ACLK(Tassel_1) it does not work. I found out that maybe I need to change to ACK= VCO, so I put the follwoing:
BCSCTL3 |= LFXT1S_2;
Once I put that, It started working for few seconds but after that it jumped to an infinite state with "ISR TRAP". I kind of solved the problem with:
IFG1 &= ~OFIFG;
But it was still going to the infinite state after some more seconds. The rare thing is, if I put a breakpoint inside the interrupt, it works fine all the time I click to run. Is it a problem with the timmings?
Thanks and best regards,
Victor