cancel
Showing results for 
Search instead for 
Did you mean: 

Generate 4 PWM with dynamic Frequency and Duty change with synchronization

tejas
Associate II
Posted on April 08, 2015 at 07:41

Hi All,

I'm using Stm32f100RE. 

For certain application I need to generate 4 PWM signals (four different pins). The duty and frequency of these PWM will be varied dynamically, other requirement is all the PWM should be synchronized to start at a time.

The timers used for PWM are TIM2, TIM3, TIM4 and TIM 12, I've configured these timers for PWM1 mode  with Output enable High.

The problem I'm Facing is

1) If I Enable OC-preloadconfig there is a delay between timer enable and actual output. on other hand if I Disable OC-PreloadConfig actual PWM output starts immediately, but the PWM output will be High as soon as I write to CCR register, and continue to be high till timer is enabled.

I need to eliminate this high signal.

2) For syncronization, I've used TIM5 and TIM1 with output trigger enable, 

where TIM5 triggers TIM12 and TIM1 (configured for input trigger gated). 

TIM1 further triggers TIM2, TIM3,TIM4  (configured for input trigger gated).

so here if TIM5 is enabled all the timer gets enabled. 

Is there any better way of synchronization ? or any better arrangement to get 4 PWM = output?

Please Help

Thanks 

Tejas H

#pwm #stm32f #synchronization
0 REPLIES 0