#define IRout BIT0
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
BCSCTL1 = CALBC1_1MHZ; // Set DCO
DCOCTL = CALDCO_1MHZ;
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)
{
__bic_SR_register_on_exit(LPM0_bits);
}
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!