I am using the msp430g2452 and I use IAR
As I have tried the program to capture input in the port 1.1. I am trying to use the CCI0A as the capture input to the timer.
But the program does not get into the ISR what so ever.
I can read the CCI and CCIE bit as 1 of the register TACCTL0
The TAR register is continuously running.
TACCR0 is continuously showing some value of 0x188
#include <msp430g2452.h>
#include <stdio.h>
void initTimer_A(void);
unsigned int buffer[20];
unsigned char i=0;
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; //Stop watchdog timer
BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1MHz
DCOCTL = CALDCO_1MHZ;
P1SEL |= BIT1;
initTimer_A();
_BIS_SR(LPM0_bits + GIE);
while(1);
}
void initTimer_A(void)
{
//Timer Configuration
TACTL = TACLR;
TACTL = TASSEL_2 + ID_0 + MC_2 + TAIE;
TACCTL0 = CM_1 + CCIS_0 + SCS + CAP + CCIE;
}
//Timer ISR
#pragma vector = TIMER0_A0_VECTOR
__interrupt void Timer_A0_CCR1_ISR(void)
{
buffer[i++] = TACCR0;
if (i>10)
{
for(int j=0;j<10;j++)
printf("time= %d",buffer[j]);
}
}