This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5438A: How to write capture program

Part Number: MSP430F5438A

Hi team,

Here's an issue from the customer may need your help:

void TimrA1Init_captrue(void)
{

undefined
     TA0CTL = TASSEL0+TACLR+TAIE+MC1; //The clock signal selects MCLK and the count mode is continuous boost mode
     TA0CCTL1 = CM1+SCS+CAP+CCIE; //Input falling edge capture, CCI1A is the capture signal source
     P1SEL |=BIT2; //Set the P1.2 port to the function module CCI1A input capture
}

unsigned int TimeGap=0;
#pragma vector=TIMER0_A1_VECTOR //Timer A interrupt handling
__interrupt void timer_a(void)
{
      switch(TA0IV) //Vector query
     {
         case 2:
               TimeGap=TA0R;//Gets the pulse interval
               TA0R=0;

                break;
         default:
                break;
     }
}

Q: TimeGap=TA0R; // Get pulse interval, is this correct? Or the following statement is correct: TimeGap = TA1CCR0;

Could you help check this case? Thanks.

Best Regards,

Cherry

**Attention** This is a public forum