This code working as TB0 in Capture mode.
it does not enter in the Interrupt Service Routine.
As I have tested with breakpoint in the IAR
#include <msp430fr2311.h>
#define NUMBER_TIMER_CAPTURES 20
volatile unsigned int timerBcaptureValues[NUMBER_TIMER_CAPTURES];
unsigned int Index = 0;
void Start_Signal();
void Read_Response();
void main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
P2SEL1 &= ~BIT1;
P2SEL0 |= BIT1;
P2DIR |= BIT1; // set Data Pin to output Direction
P2OUT &= ~BIT1; // Set output to low
__delay_cycles(18000); // low for 18 ms
P2DIR &= ~BIT1;
P2REN |= BIT1;
TB0CTL |= TBSSEL_2 | MC_2 | TBCLR ; // Use SMCLK as clock source, clear TB0R
TB0CCTL0 |= CM_2 | CCIS_0 | CAP | SCS | CCI | CCIE; // Select Input Signal
// Capture rising edge,
// Use CCI0A=SMCLK,
// Synchronous capture,
// Enable capture mode,
// Enable capture interrupt
TB0CTL |= TBSSEL_2 | MC_2 | TBCLR ; // Use SMCLK as clock source, clear TB0R
__bis_SR_register( GIE);
}
// Timer0_B3 CCR0, TB Interrupt Handler
#pragma vector = TIMER0_B0_VECTOR
__interrupt void TIMER0_B0_ISR(void)
{
TB0CCTL0 &= ~CCIFG;
timerBcaptureValues[Index++] = TB0CCR0;
if (Index >= 20)
{
Index = 0;
}
}