Tool/software: Code Composer Studio
Hello I have to make this servo work with the msp430 to start and stop with the onboard push button and also lit the red led to display a stop and green to display it start . I start the code but keep getting errors in the interrupts. Can someone please tell what's wrong
Here the code
#include<msp430.h> int cnt; int main (void)
{ WDTCTL = WDTPW + WDTHOLD;
P1DIR &= ~BIT3; P1REN |= BIT3;
P1OUT |= BIT3;
P1DIR |= BIT0 + BIT6;
P1OUT |= BIT6;
P1OUT &= ~BIT0; P1DIR |= BIT2;
P1SEL |= BIT2; P1SEL2 &= ~BIT2; P1DIR |= BIT2;
P1SEL |= BIT2; P1SEL2 &= ~BIT2;
TA0CTL = MC_1 + TASSEL_2;
TA0CCTL1 = OUTMOD_6;
TA0CCR0 = 20000;
TA0CCR1 = 2000; TA1CTL = MC_1 + TASSEL_2;
TA1CCTL0 = CCIE;
TA1CCR0 = 3000; P1IE |= BIT3;
P1IES |= BIT3;
P1IFG = 0;
_enable_interrupts();
while(1) {
}
} #pragma vector = PORT1_VECTOR __interrupt void Port_1(void)
{ TA0CTL ^= MC_1; P1OUT ^= BIT0 + BIT6; P1IFG &= ~BIT3;
} #pragma vector = TIMER1_A0_VECTOR __interrupt void Timer1_A0_ISR(void)
{
cnt++;
if(cnt == 500)
{ TA0CCR1 = 650;
}
if(cnt == 1000)
{ TA0CCR1 = 3000; cnt = 0; }
}