使用msp430f5529LP,用定时器A开捕获模式,捕获方波,P1.2口输入,幅值2.8V,一直进不了中断
#include<msp430f5529.h>
#define uchar unsigned char
#define uint unsigned int
void TIMEA_INIT()
{
TA0CCTL1|=CM_3+CCIS_1+CCIE+CAP+SCS;
TA0CTL=TASSEL_1+TACLR+MC_1;
}
void main()
{
WDTCTL = WDTPW + WDTHOLD; //关闭看门狗
P1DIR = 0XFF;P1OUT = 0xff;
P1SEL|=BIT2;
TIMEA_INIT();
__bis_SR_register(LPM0_bits+GIE);
}
#pragma vector=TIMER0_A0_VECTOR //定时器冲断
__interrupt void TIMER0_A0_ISR(void)
{
P1OUT&=~BIT0;
}
