求思路 我用的是msp430f5438A 有参考代码就更好了
#include
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P8DIR |= 0x08; // P2.2 output
P8SEL |= 0x08; // P2.2 options select
TA0CCR0 = 34-1; // PWM Period
TA0CCTL3 = OUTMOD_7; // CCR1 reset/set
TA0CCR3 = 17; // CCR1 PWM duty cycle
TA0CTL = TASSEL__SMCLK + MC_1 + TACLR; // ACLK, up mode, clear TAR
while(1)
{
;
}
}