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.

MSP430使用TIMERA实现通讯问题

例程中,使用TACTL进行发射的程序为:

 if(TxDate & 0x0001)           //发送的是1
      {
        CCTL0 &= ~OUTMOD2;          //OUTMOD0是置位
      }              
      else                          //发送的是0
      {
        CCTL0 |= OUTMOD2;           //

      }

为什么 CCTL0 &= ~OUTMOD2,在端口会输出高电平?

  • 例程最刚开始把OUTMOD0置“1”了

    所以,

    发“1”时, OUTMOD0==1, OUTMOD2==0,意思是发送高电平(SET)  

    发“0”时, OUTMOD0==1,OUTMOD2==1,意思是RESET(低电平)

    具体请参考user's guide上关于TACCTLx的定义