Skip to main content
Alex Z
Associate
August 2, 2017
Question

Timer generate a delayed pulse with same width as input

  • August 2, 2017
  • 1 reply
  • 3673 views
Posted on August 02, 2017 at 20:25

Hi all, is it possible to use timer to capture the input pulse, and generate the output pulse with same width and a certain delay.

0690X00000603zfQAA.jpg

I have tried use one pulse mode with connect input on two channel, one trigger with rise edge and one with falling. but it did not work.

Thanks all for help!

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    August 2, 2017
    Posted on August 02, 2017 at 20:42

    Pretty sure one-pulse isn't going to work, the TIM has a single counting element, which you'd want in maximal mode.

    Time stamp the input edges, and use toggle of place output edges ie CCR = CNT + x, CNT + y

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    waclawek.jan
    Super User
    August 2, 2017
    Posted on August 02, 2017 at 22:55

    Nice challenge. I believe it could be made to run with no software (except setup) with two coupled timers and a DMA.

    JW

    waclawek.jan
    Super User
    August 2, 2017
    Posted on August 02, 2017 at 22:58

    Clive's trick with toggle would make it doable with your method on a single timer, but only in the special case that the pulse is guaranteed to last longer than the delay (as is the depicted case).

    JW