I am trying to get the timer capture mode to work on the MSP430. Currently I am using a g2353 model of the MSP430 family.
I have found a few examples for this but have been unable to get any of them to work.
My goal is to use this functionality to calculate the frequency of an input signal. I realize that the ISR in my code below is wrong because I am not resetting the interrupt flag among other things.
I am just trying to get the program to reach the ISR as my first goal, which I have been unable to accomplish.
If anyone could give me some pointers on where I should look to fix this I would greatly appreciate it.
#include "msp430g2353.h"
void main(void){
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1MHz
DCOCTL = CALDCO_1MHZ;
P1DIR = 0x01; // Set P1.0 out,1.1 input dir
P1OUT &= ~0x01; // LED off
P1SEL |= BIT1; // P1.1 CCI0A
TACTL = TASSEL_2 + MC_2; // SMCLK, contmode
TACCTL0 = CCIS0 + SCS + CAP + CCIE + CM_1;
_BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/ interrupt
while(1){};
}
#pragma vector=TIMER0_A0_VECTOR
__interrupt void TimerA0(void)
{
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
}