2016-05-30 01:31 AM
Hi!
I'm trying to run a bldc motor with stm32f407 IC. The most common method to do that is six-step mode control. I configured TIM1 in complementary mode. but as you know, timer mode must be changed during each step.For example, TIM1 channel 1 CCx and CCxN should be in PWM1 mode in one step and it changes to forcedaction_InActive mode on the next step. My problem is that in some steps, both CCx and CCNx should be zero simultaneously and it seems there is no mode defined for that! what can i do? i tried to disable CCx and CCxN during those steps but when i do that both of them goes high! I use ''TIM_SelectOCxM() function to change the modes and TIM_CCxCmd() and TIM_CCxNCmd() to enable and disable TIM outputs.Thanks for your help.2016-05-30 09:53 PM
> i tried to disable CCx and CCxN during those steps but when i do that both of them goes high!
Disabling timer channels does exactly what it says: it disables the outputs, i.e. makes them high-Z. What you may want is one of the Force modes (TIMx_CCMRy.CCzM=0b100 or 0b101), or a PWM mode set to its extreme, with polarity of one channel set to opposite to the polarity of other channel (TIMx_CCER.CCxP/CCxNP). TIM1 is maybe unnecessary tricky in that it has the advanced output module, see TIMx_BDTR. There is a table after TIMx_CCER's description, listing the outputs states in various settings. JW2016-05-31 09:40 AM
Hi a.m.a,
Refer to the ''TIM_6Step'' example in package at this path: STM32Cube_FW_F4_V1.12.0\Projects\STM324xG_EVAL\Examples\TIM -Hannibal-2016-06-06 09:48 PM
Hi JW! and thanks to Hannibal .
I tried to use forced modes by configuring CCxE,CCxNE,CCxP,CCxNP,OISx,OISxN and OSSR,OSSI bits in different modes according to the table coming right after TIMx_CCER's description. but i didn't succeed! always at least one of them is high. I don't know what else I can do? I need help. Thank you.