Jump to content

cant not use capture timer interrupt msp430g2553

Recommended Posts

#define IRout BIT0
int main(void)
	WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
	BCSCTL1 = CALBC1_1MHZ;                    // Set DCO

	P2DIR &= ~IRout;
	P2SEL |= IRout;
	P2SEL2 &= ~IRout;
	TA1CCTL0 = CM_2 + CCIS_0 + CAP + CCIE + SCS;		// Capture on falling edge, CCI0A, interrupt Enable
	TA1CTL = TASSEL_2 + MC_2 + TACLR + ID_0;		//

	__bis_SR_register(LPM0_bits+GIE);					// Go to sleep while waiting for trigger
	 while (true) {
  #pragma vector=TIMER1_A0_VECTOR
__interrupt void Timer1A0(void)

Hi guys,

Below is my program, it's can not detect a falling edge. I set a break point at line "while true", it can not jump to that position.

What I was wrong?

Thank in advance!

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...