Hi
I am generating PWM 133 khz at one of the pin of msp430f6632 (using SYSBIOS environment in CODE composer studio)
/*Configure GPIO Port 1 pin 1 as output */
GPIO_setAsOutputPin(GPIO_PORT_P1,GPIO_PIN1);
GPIO_setOutputHighOnPin(GPIO_PORT_P1,GPIO_PIN1);
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,GPIO_PIN1);
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P4,GPIO_PIN0);
TIMER_B_generatePWM(0x03C0,
TIMER_B_CLOCKSOURCE_SMCLK,
TIMER_B_CLOCKSOURCE_DIVIDER_4,
15,
TIMER_B_CAPTURECOMPARE_REGISTER_0,
TIMER_B_OUTPUTMODE_RESET_SET,
7
);
and this pin out is shorted to another pin of same controller, where i have configured TImer A in capture mode
/*Configure timer1_A3 in capture mode */
TA1CCTL0 = CM_1 + CCIS_0 + SCS + CAP + CCIE;
//Start the timer
TA1CTL = TASSEL_2 + ID_3 + MC_2 ;
===> Now I wanted to capture the pulse width of this signal so i am storing timing register TA1CCR0 value at a buffer , but problem is that i am not able to get any count.
if i am running the code with debugger i am able to get the correct count but free running is giving some garbage value.
unsigned int capture_array[32];
int *uc_first_cap = capture_array;
void TimerISR()
{
index++;
*uc_first_cap= TA1CCR0; <--------------------- Wrong value of count being stored
uc_first_cap++;
if(index==32)
{
TA1CTL = TASSEL_1 + ID_0 + MC_0 ;
}
}