请教一下大家,互补PWM如何设置两个脚均为低电平。我用这个库函数只能让一个脚低电平,一个脚高电平,TIM_ForcedOC2Config(TIM1,TIM_ForcedAction_InActive);
切换IO的话比较麻烦,我设置刹车输入为高电平,输出两个脚都是为低电平,但是感觉这样设计不太合理。
TIM_BDTRInitStructure.TIM_OSSRState = TIM_OSSRState_Enable;
TIM_BDTRInitStructure.TIM_OSSIState = TIM_OSSIState_Enable;
TIM_BDTRInitStructure.TIM_LOCKLevel = TIM_LOCKLevel_1;
TIM_BDTRInitStructure.TIM_DeadTime = 40;
TIM_BDTRInitStructure.TIM_Break = TIM_Break_Enable;
TIM_BDTRInitStructure.TIM_BreakPolarity = TIM_BreakPolarity_High;
TIM_BDTRInitStructure.TIM_AutomaticOutput = TIM_AutomaticOutput_Enable;
方法应该就在刹车功能里面,但是我没找到,大家帮忙看下有没有好的方法,感谢了。
我需要两个脚都为低,然后输出PWM 来切换。
|