Part Number:TMS320F280039C
switch(PortState){case 1:GPIO_setPadConfig(0, GPIO_PIN_TYPE_PULLUP);GPIO_setPadConfig(1, GPIO_PIN_TYPE_PULLUP);GPIO_setPinConfig(GPIO_0_EPWM1_A);EPWM_configureSignal(pfcpwmSignal[EPWM1_Num].epwmModule, &pfcpwmSignal[EPWM1_Num].EPWM_SignalParam);case 0:GPIO_setPinConfig(GPIO_0_GPIO0);GPIO_setPinConfig(GPIO_1_GPIO1);}
我以这种方式配置IO和pwm互相切换,当PortState为1,也就是PWM模式,然而发波失败,IO0和IO1一直是高电平。
请各位专家及时解答一下,谢谢~~~
zhao min:
switch(PortState){case 1:GPIO_setPadConfig(0, GPIO_PIN_TYPE_PULLUP);GPIO_setPadConfig(1, GPIO_PIN_TYPE_PULLUP);GPIO_setPinConfig(GPIO_0_EPWM1_A);GPIO_setPinConfig(GPIO_1_EPWM1_B);EPWM_configureSignal(pfcpwmSignal[EPWM1_Num].epwmModule, &pfcpwmSignal[EPWM1_Num].EPWM_SignalParam);case 0:GPIO_setPinConfig(GPIO_0_GPIO0);GPIO_setPinConfig(GPIO_1_GPIO1);}
,
zhao min:
已解决,这种方式有效,是自己其他逻辑错误
,
Lydia:
感谢分享结果以便于遇到类似情况的朋友参考。