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.

Timer Capture of External Pin



HI Guys,

 

Been struggling wth this all day.

Can't seem to get an external pin to trip the Capture logic.

Everything works great if I just do simple compare mode... switching to capture is eluding me ...

Anyone see what I am doing wrong?

I expect to see an LED toggel for each event.

 

Note: I don't see Timer B >> TBCCTLO >> COV change state in the CCS registers window - should I?

(I run the app for a while, pause it, look at the registers, restart, etc)

 

MSPF2274

---------------------------------------------------

WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
  P1DIR |= 0x01;                            // Set P1.0 to output direction TEST SIGNAL
  P2DIR |= 0x01;                            // Set P2.0 to output direction TEST SIGNAL
 
  // Setup Clock Module
  BCSCTL1 = DIVA_0;                            // VLO Clk Divider
  BCSCTL3 = LFXT1S_2;                        // Select VLO clock to ACLK
 
  // Make sure P4.3 is pulled up and routed to module

  P4REN |= 0x18;                              // Pullups on 4.3 and 4.4
  P4SEL |= 0x18;                            // Rout Capture inputs to module
   
  // Timer B Control Register setup

  TBCTL = TBSSEL_1 + MC_1;                  // ACLK, upmode   
   
  // Timer B Capture/Compare Setup 
  
  TBCCTL0 = CM1 + CCIS0 + SCS + CAP + CCIE; // Falling edge, CCIxB (P4.4), Sync, Capture_Enabled, interrupt enabled

  __bis_SR_register(LPM0_bits + GIE);       // Enter LPM0 w/ interrupt
}

// Timer B0 interrupt service routine

#pragma vector=TIMERB0_VECTOR
__interrupt void Timer_B (void)
{
  P1OUT ^= 0x01;                            // Toggle P1.0 using exclusive-OR (Drive LED)
  P2OUT ^= 0x01;                            // Toggle P1.0 using exclusive-OR (Drive IO, inverted)
}

**Attention** This is a public forum