cancel
Showing results for 
Search instead for 
Did you mean: 

PWM Out follow PWM in(Capture) as same as Duty cycle and Frequence(Synchronize)

TerryKuo
Associate

Hello every body.

MCUSTM32F103RBT6  LQFP-64 Package

PWM Capture in on PA6(TIM3-CH1)

The PWM Capture signal source is Frequence is 50KHZ to 1.0MHZ,

Duty cycle and Frequence always change by loading switch.

PWM Out Function on foue output are

PA8(TIM1-CH1) PA10(TIM1-CH3) & PB8(TIM4-CH3) PB10(TIM2-CH3)

My Question as below.

Question 1

I can capture in PA6(TIM3-CH1) Duty cycle and Frequence is okay(TIM3-CH1 detect rise edge,TIM3-CH2 detect falling edgeand I used the Interrupt capture in the signal, and used the PA6(TIM3-CH1) master trigger(TRGI) to another PWM out as PA8(TIM1-CH1) PA10(TIM1-CH3) & PB8(TIM4-CH3) PB10(TIM2-CH3), The foue output trigger by ITR2(TIM3)-TRGI used the TI1FI1 or TI1F_ED.

How can i do the four output PA8(TIM1-CH1) PA10(TIM1-CH3) & PB8(TIM4-CH3) PB10(TIM2-CH3), follow the PA6(TIM3-CH1)s Duty cycle and Frequence

I mean as same as PA6(TIM3-CH1) ’s Duty cycle and Frequence on foue output.

Now my programe can follow the Duty cycle Frequencebut the dutys polarity is wrong.(It used ITR2(TIM3)-TRGI is TI1F_ED. The wrong polarity is random.

If used TI1FI1 by ITR2(TIM3), The four output duty cycle is gone. And Frequence is Half Speed.

 

Question 2

If Question 1 can get resolved.

My other question is three output PA10(TIM1-CH3) & PB8(TIM4-CH3) PB10(TIM2-CH3),How to Shift the Phase But Duty cycle and Frequence still as same as PA6(TIM3-CH1).

 

 Thany every one.

 

 

 

1 REPLY 1
Sarra.S
ST Employee

Hello @TerryKuo, welcome to ST Community 

I'll try to summarize what you said and you can correct me 

Master Slave1 Slave2 Slave3
TIM3 TIM1 TIM4 TIM2

internal trigger connection: ITR2 for all slaves 

And you want to get TIM3's same duty cycle and frequency. 

Can you please explain the TIM1 configuration in your .ioc file? 

SarraS_0-1706866550421.png

Your output signal should be configured in PWM input mode to be able to capture both the period and the duty cycle of the incoming PWM signal (TIM3) 

 

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.