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.

G2553设置了采样端口之后无法进入串口中断



在一段程序里面增加串口采样对外部设备进行控制,无法进入串口中断,经过测试,在屏蔽ADC采样端口设置语句之后,可以进入中断。

采样端口语句  : ADC10AE0 |= 0x03;  

是否ADC采样和串口中断有冲突?该如何解决

另外两个中断函数,不知是否影响。

// ADC10 interrupt service routine
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR(void)
{
  __bic_SR_register_on_exit(CPUOFF);        // Clear CPUOFF bit from 0(SR)
}

#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{

  while (!(IFG2&UCA0TXIFG));                // USCI_A0 TX buffer ready?
  j = UCA0RXBUF;                    // TX -> RXed character

  if(j=='a')
  { P2OUT|=BIT3;
  while((IFG2&UCA0TXIFG)==0); //查询发送是否结束
         {IFG2&=~UCA0TXIFG; //清除发送一标志位
         UCA0TXBUF = 'a';
         }
  }
  if(j=='b')
  { P2OUT&=~BIT3;
  while((IFG2&UCA0TXIFG)==0); //查询发送是否结束
         {IFG2&=~UCA0TXIFG; //清除发送一标志位
         UCA0TXBUF = 'b';
         }
  }
}