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.

MSP430F5529: 通过MSP430的引脚P2.0发送PWM信号(3V的高低电平),从示波器观测到信号输出波形不正确,是一条横线?以下为测试连接图片和MSP430输出PWM信号代码,不知道哪里出了问题?

Part Number: MSP430F5529

#include <msp430.h>
#define TASSEL_SMCLK
#define MC_UP

int main(void)
{
    WDTCTL = WDTPW | WDTHOLD;   // stop watchdog timer
    //引脚P2.0配置为TA0.1(方向输出,功能引脚)
    P2DIR |= BIT0;
    P2SEL |= BIT0;
    //选择SMCLK,增计数模式,清除TAR
    TA0CTL=TASSEL_SMCLK+MC_UP+TACLR;
    //TA0CTL=TASSEL_2+MC_UP+TACLR;
    TA0CCR0=10000;//增计数模式下,该数值表示周期
    TA0CCTL2=OUTMOD_6;//设置输出模式
    //TA0CCTL1=OUTMODE_3
    TA0CCR2=1000;//设置占空比
    _EINT();//开启中断
    while(1)
    {
        LPM0;
    }
}