CC2530的PWM问题
我希望用cc2530的P1_6,P1_7脚输出可调的PWM功能. 经检查, 觉得用TIMER3的Alter 2的channel 0,1 对于P1_6, P1_7. 但是写好程序以后,P1_6什么输出也没有。请教有什么问题。
程序如下:
P1SEL &= ~(0xC0); //set P1_6 as peripheral
P1DIR |= 0xC0; //set P1_6 as output
CLKCONCMD &= ~0x40; //设置时钟源32MHz晶振
while(!(SLEEPSTA & 0x40)); //等待晶振稳定为32MHz
CLKCONCMD &= ~0x07; //设置系统主频为32MHz
//CLKCONCMD |= 0x30; // time1的定时时钟为 500KHz
SLEEPCMD |= 0x04; //关闭不用的RC振荡器
PERCFG |= 0x20;//选择Timer3的备用位置2
P2SEL |= 0x60;//设置Timer3优先
T3CC0 = 0xF7; // PWM signal period
T3CCTL0 = 0x24;
T3CC1 = 0x7F; // PWM duty cycle, Channel 1 (P1_6)
T3CCTL1 = 0x24; // Channel 1 in compare mode, Set output on compare-up, clear on compare-down
T3CTL |= 0x03;
Have you checked this thread with your own code?
http://e2e.ti.com/support/wireless_connectivity/zigbee_6lowpan_802-15-4_mac/f/158/t/399413#pi239031348=1
Thank you.