cancel
Showing results for 
Search instead for 
Did you mean: 

Weird PWM Timer3 master and PWM Timer1 slave behaviour

Xxoyo.1
Associate III

Hello, I have a timer 3 master and timer 1 slave. When a button is pressed, master is activated as long as button is pressed, and then slave is triggered based on master's output signal (high / low) (gated slave control)

(

This is a continuation of my previous post here -> https://community.st.com/s/feed/0D53W00000uWUzeSAG

)

 Correct outputs (below)

0693W00000BcAQEQA3.png 

0693W00000BcAQiQAN.png 

Wrong outputs (below)

0693W00000BcAHIQA3.png 

0693W00000BcAO4QAN.png 

0693W00000BcASPQA3.png0693W00000BcASUQA3.png

4 REPLIES 4
TDK
Guru

Is there a question? If you want the signal to be low, set it low during the falling edge interrupt.

If you feel a post has answered your question, please click "Accept as Solution".
Xxoyo.1
Associate III

Hello, sorry for not clarifying the question at the start. My question is to why there is a portion of the slave output being held high when the master is already low level?

I would like to set it low during falling edge interrupt, but how to do that? Do i need to use forced timer output?

Thank your for your assistance!

Another option is to set the master's "active" time to integer multiple of the slave's period.

JW

TDK
Guru

The timer output channels run a on a very specified set of conditions. You need to ensure the CCRx value is what you what at the end of the period. As JW says, this can be done by ensuring the active duration is a multiple of the period.

Otherwise just set CCRx value to what you want (i.e. a value that produces a low output) at the end of the falling period.

If you feel a post has answered your question, please click "Accept as Solution".