Trying to skip PWM outputs upon low modulation (STM32F405)
I am using 3 Channels to generate 6 pwm using complementary pwm by timer 1. I want to release outputs of CH1 and CH1N when modulation is low (ie. PWM near 50%), and do the same for other channels (shifted 120degrees in time).
I try playing with register CCER :
TIM1->CCER &= TIM1_OC1_DISABLE; // using #define TIM1_OC1_DISABLE ((uint16_t)0xFFFE)
and later :
TIM1->CCER |= TIM1_OC1_ENABLE; // using #define TIM1_OC1_ENABLE ((uint16_t)0x0001)
Disabling works fine, but re-enabling is done with approx 10ms delay for some reasons when I need a few tens of us max delay.. (PWM is at 30kHz, center aligned)..
Using MOE bits works fine, but does skip outputs on all channels simultaneously.
Any idea ? Thks, Pierre
