complementary pwm for 6 step commutation
I am driving bldc motor using my bldc driver, I use stm32f103xx as MCU. Using 6 step commutation the control was ok, and i driven in e-scooter using my driver. But there is a small problem at starting, once the motor gets its motion it goes good. So i thought of applying uni polar complementary pwm technique for it.
- Coded in stm32f103 using register language.
- Used timer 1 for complementary 6 pwm.
- And i complemented 3 channels (ch1,ch2&ch3) shown below.
First generated pwm signal for 10khz and then i coded below..
TIM1->CCER|=TIM_CCER_CC1NE;
(using above line ch1's(A8) signal is complement in chn1 (B13))
TIM1->CCER|=TIM_CCER_CC1NP;
(using above line ch1's polarity can be changed that is low for high or vise versa)
My problem...
I need to enable and disable complementary pwm simultaneously.
But by using this TIM1->CCER|=TIM_CCER_CC1NE;
TIM1->CCER&=~TIM_CCER_CC1NE;
it requires a delay between them to work properly.
So how to activate and deactivate complementary pwm simultaneously (in register language).