刚刚接触M3,用lm3s9b90开发板测试ccp管脚时,发现没有输出。代码如下:
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
GPIOPinTypeTimer(GPIO_PORTE_BASE, GPIO_PIN_2);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinTypeTimer(GPIO_PORTB_BASE, GPIO_PIN_2); TimerConfigure(TIMER1_BASE, TIMER_CFG_16_BIT_PAIR |
TIMER_CFG_A_PWM |
TIMER_CFG_B_PWM);
TimerControlLevel(TIMER1_BASE, TIMER_BOTH, true);
TimerLoadSet(TIMER1_BASE, TIMER_BOTH, 6000);
TimerMatchSet(TIMER1_BASE, TIMER_A, 3000);
TimerMatchSet(TIMER1_BASE, TIMER_B, 2000);
TimerEnable(TIMER1_BASE, TIMER_BOTH);
查看相关寄存器,发现相应的寄存器都有正确的写入,为什么就是没有输出呢。板子是没问题的,不知是哪里有了纰漏,望高手赐教。 |