cancel
Showing results for 
Search instead for 
Did you mean: 

Timer synchronization

PAN12
Associate II

Hello Everyone 

i am using stm32G031J6 Microcontroller. I want to generate a PWM signal from Timer 1 working as slave in gated mode, that has a pulse width = 10us and pulse period = 44us  In this microcontroller i am using Timer 3 as a Master which has a PWM signal that has a Burst width = 7ms and Burst Period = 16.67 ms. Currently i am getting PWM signal on my Timer 1 and timer 3, but the problem is that They are Not SYNCHRONISED, can anyone help me please

This is my configuration for Timer 3 as Master in Cube MX , slave mode - Disable, Trigger source - Internal clock, Channel3 - PWM Generation No output, Parameter settings: Prescaler - 64-1, Counter Period - 16676-1, PWM Generation channel 3 - PWM mode 2 and Pulse : 7000-1

This is my configuration for Timer 1 as a slave in gated mode, channel - PWM Generation CH1, Trigger Source:ITR2

Parameter settings : Prescaler : 64-1, Counter Period: 44-1, Pulse : 10

 

Can anyone please help how i can synchronise these two timers

                                                                 

 

11 REPLIES 11
PAN12
Associate II

Hii 

 

Thanks for your quick response.  Yes this is exactly what PWM signal do. The PWM signal which i am getting is Jumping and they are not periodic in nature, they are changing their state frequently.

 

Second Answer : want TIM1_CH1 to be a slave and only output during the high period of TIM3_CH3. So when TIM3_CH3 is High we get pwm output from TIM1_CH1 and when TIM_CH3 is low we do not want any PWM from TIM_CH1. 

Something like this:   Please go to Periodic Trigger signal

 

STM32 Timers #10. Timer in Gated Mode (controllerstech.com)

Read out and post content of TIM registers.

JW