Skip to main content
lidiriel
Associate II
June 3, 2019
Solved

How can you parameter a timer with two trigger on two separate input channel ?

  • June 3, 2019
  • 3 replies
  • 1064 views

I have two signal T and D like :

           ____

T ________|    |__________________

          t1   t2

                      _________

D _____________________________________|         |__________ 

                                       t3        t4

Is it possible to get the next wafeforme S with connect T on input

channel 1 and D on input channel 2 of a timer ?

S ______________________                   _______________

                        |________________|

                       ti               tf

ti = t1 + custom delay

tf = t3

i think is not possible but perhaps there are a correct timer configuration for this use case.

I can use GPIO and interruption but i would like operate very fast.

thanks

This topic has been closed for replies.
Best answer by waclawek.jan

Use one of the Advanced timers.

For the T-to-S delay, use the retriggerable OPM mode, as described in RM, setting ARR so that it covers the longest required pulse on S (and of course set the appropriate polarity of output pulse, either by selecting the appropriate PWM mode, or using TIMx_CCER.CCxP),

For the D-to-S reset, use the TIMx_ETR pin/signal, as outlined in the Clearing the OCxREF signal on an external event subchapter, through setting TIMx_CCMRy.OCxCE.

JW

3 replies

lidiriel
lidirielAuthor
Associate II
June 3, 2019

In my message the wave form are illegible : so i draw a new figure :0690X000008i9kdQAA.png

S : t6 (high to low) = T : t1 (low to high) + custom delay

S : t9 (low to high) = D : t9 (low to high)

lidiriel

waclawek.jan
waclawek.janBest answer
Super User
June 4, 2019

Use one of the Advanced timers.

For the T-to-S delay, use the retriggerable OPM mode, as described in RM, setting ARR so that it covers the longest required pulse on S (and of course set the appropriate polarity of output pulse, either by selecting the appropriate PWM mode, or using TIMx_CCER.CCxP),

For the D-to-S reset, use the TIMx_ETR pin/signal, as outlined in the Clearing the OCxREF signal on an external event subchapter, through setting TIMx_CCMRy.OCxCE.

JW

lidiriel
lidirielAuthor
Associate II
June 7, 2019

thanks a lot it's work.