|
void main(void)
{
unsigned int j;
WDTCTL=WDTPW+WDTHOLD;
LCD_Init();
P1DIR |=BIT0+BIT4;
P1SEL |=BIT2;
flag=0;
TACTL=TASSEL0+TACLR+TAIE+MC0;
CCTL1=CM0+SCS+CAP+CCIE;
CCR1=32768;
_EINT();
while(1)
{
for(j=0;j<50000;j++);
P1OUT^=BIT4;
}
#pragma vector=TIMERA1_VECTOR
__interrupt void TimerA1(void)
{
switch(TAIV)
{
case 2:
if(flag==1)
{
counter++;
LCD_Display(counter);
break;
}
else
{
LCD_Display(counter1);
Delay_ms(1000);
flag=1;
break;
}
case 10:
LCD_Display(counter2);
Delay_ms(1000);
break;
default:
break;
}
总是进不去case 10那段的程序,书上不是说计数到ccr1时就将中断标志位TAIFG置位吗,此时应该可以进这个中断吧?不是用的仿真
请大虾指点
|
|